summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reportdesign/inc/ModuleHelper.hxx110
-rw-r--r--reportdesign/inc/PropertyForward.hxx111
-rw-r--r--reportdesign/inc/ReportDefinition.hxx353
-rw-r--r--reportdesign/inc/ReportHelperDefines.hxx158
-rw-r--r--reportdesign/inc/ReportVisitor.hxx76
-rw-r--r--reportdesign/inc/RptDef.hxx119
-rw-r--r--reportdesign/inc/RptModel.hxx104
-rw-r--r--reportdesign/inc/RptObject.hxx267
-rw-r--r--reportdesign/inc/RptPage.hxx106
-rw-r--r--reportdesign/inc/RptResId.hrc255
-rw-r--r--reportdesign/inc/UndoActions.hxx323
-rw-r--r--reportdesign/inc/UndoEnv.hxx130
-rw-r--r--reportdesign/inc/dllapi.h51
-rw-r--r--reportdesign/inc/helpids.hrc131
-rw-r--r--reportdesign/inc/makefile.mk55
-rw-r--r--reportdesign/inc/pch/precompiled_reportdesign.cxx37
-rw-r--r--reportdesign/inc/pch/precompiled_reportdesign.hxx40
-rw-r--r--reportdesign/inc/rptui_slotid.hrc210
-rw-r--r--reportdesign/java/com/sun/star/report/DataRow.java54
-rw-r--r--reportdesign/java/com/sun/star/report/DataSource.java54
-rw-r--r--reportdesign/java/com/sun/star/report/DataSourceException.java105
-rw-r--r--reportdesign/java/com/sun/star/report/DataSourceFactory.java52
-rw-r--r--reportdesign/java/com/sun/star/report/ImageService.java67
-rw-r--r--reportdesign/java/com/sun/star/report/InputRepository.java81
-rw-r--r--reportdesign/java/com/sun/star/report/JobDefinitionException.java73
-rw-r--r--reportdesign/java/com/sun/star/report/JobProgressIndicator.java87
-rw-r--r--reportdesign/java/com/sun/star/report/JobProperties.java54
-rw-r--r--reportdesign/java/com/sun/star/report/OutputRepository.java67
-rw-r--r--reportdesign/java/com/sun/star/report/ParameterMap.java79
-rw-r--r--reportdesign/java/com/sun/star/report/ReportAddIn.java53
-rw-r--r--reportdesign/java/com/sun/star/report/ReportEngine.java64
-rw-r--r--reportdesign/java/com/sun/star/report/ReportEngineMetaData.java68
-rw-r--r--reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java58
-rw-r--r--reportdesign/java/com/sun/star/report/ReportExecutionException.java96
-rw-r--r--reportdesign/java/com/sun/star/report/ReportExpression.java60
-rw-r--r--reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java53
-rw-r--r--reportdesign/java/com/sun/star/report/ReportFunction.java56
-rw-r--r--reportdesign/java/com/sun/star/report/ReportJob.java97
-rw-r--r--reportdesign/java/com/sun/star/report/ReportJobDefinition.java66
-rw-r--r--reportdesign/java/com/sun/star/report/SDBCReportData.java327
-rw-r--r--reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java66
-rw-r--r--reportdesign/java/com/sun/star/report/SOImageService.java200
-rw-r--r--reportdesign/java/com/sun/star/report/StorageRepository.java147
-rw-r--r--reportdesign/java/com/sun/star/report/makefile.mk74
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java118
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/Manifest.mf7
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java85
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java74
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java81
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java134
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java261
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java340
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/StarReportData.java177
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java126
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java68
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/configuration.properties152
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java66
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java87
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java296
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java101
-rwxr-xr-xreportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java136
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java208
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java100
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java329
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java170
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java218
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java88
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java54
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java255
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java86
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java176
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java215
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java108
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java186
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java184
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java94
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java77
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/makefile.mk114
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java66
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java62
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java83
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java66
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java78
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java69
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java91
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java53
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java70
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java67
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java62
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java78
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java92
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java136
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java139
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java214
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java132
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java52
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java79
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java85
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/RawText.java56
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java119
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java54
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java63
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/module.properties52
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-form.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-style.css10
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-table.css37
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/oasis-text.css9
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java471
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java1469
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java513
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java380
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java114
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java714
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java442
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java60
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java251
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java97
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java1380
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java111
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java67
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java100
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java62
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java198
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java70
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java75
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java80
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java48
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java136
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java102
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java248
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java116
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java124
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java133
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd422
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java92
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java48
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java109
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java108
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java128
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java129
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java181
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java48
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java151
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java120
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java179
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java121
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties119
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt8
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java65
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java112
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java113
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java148
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java110
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java106
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java84
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java55
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java63
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java68
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java63
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java55
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java55
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java55
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java57
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java72
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java72
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java58
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java52
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java56
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java55
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java63
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java61
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java81
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java54
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java58
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java61
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java61
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java64
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java56
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java63
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java115
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java153
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java127
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java187
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java106
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/smil.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/star-office.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/star-report.css73
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/star-rpt.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java124
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java111
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java144
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java84
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java65
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java120
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java115
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java76
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml116
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd98
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/svg.css5
-rw-r--r--reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css5
-rw-r--r--reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java88
-rw-r--r--reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java134
-rw-r--r--reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java129
-rw-r--r--reportdesign/java/com/sun/star/report/util/makefile.mk48
-rw-r--r--reportdesign/java/jfreereport.properties37
-rw-r--r--reportdesign/java/loader.properties38
-rw-r--r--reportdesign/java/makefile.mk52
-rw-r--r--reportdesign/prj/build.lst17
-rw-r--r--reportdesign/prj/d.lst29
-rw-r--r--reportdesign/prj/rpt.xml14
-rw-r--r--reportdesign/source/core/api/FixedLine.cxx551
-rw-r--r--reportdesign/source/core/api/FixedText.cxx390
-rw-r--r--reportdesign/source/core/api/FormatCondition.cxx190
-rw-r--r--reportdesign/source/core/api/FormattedField.cxx411
-rw-r--r--reportdesign/source/core/api/Function.cxx244
-rw-r--r--reportdesign/source/core/api/Functions.cxx230
-rw-r--r--reportdesign/source/core/api/Group.cxx379
-rw-r--r--reportdesign/source/core/api/Groups.cxx229
-rw-r--r--reportdesign/source/core/api/ImageControl.cxx502
-rw-r--r--reportdesign/source/core/api/ReportComponent.cxx150
-rw-r--r--reportdesign/source/core/api/ReportControlModel.cxx177
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx2456
-rw-r--r--reportdesign/source/core/api/ReportEngineJFree.cxx506
-rw-r--r--reportdesign/source/core/api/ReportVisitor.cxx101
-rw-r--r--reportdesign/source/core/api/Section.cxx729
-rw-r--r--reportdesign/source/core/api/Shape.cxx512
-rw-r--r--reportdesign/source/core/api/Tools.cxx91
-rw-r--r--reportdesign/source/core/api/makefile.mk71
-rw-r--r--reportdesign/source/core/api/services.cxx121
-rw-r--r--reportdesign/source/core/inc/FixedLine.hxx194
-rw-r--r--reportdesign/source/core/inc/FixedText.hxx183
-rw-r--r--reportdesign/source/core/inc/FormatCondition.hxx137
-rw-r--r--reportdesign/source/core/inc/FormattedField.hxx189
-rw-r--r--reportdesign/source/core/inc/Function.hxx147
-rw-r--r--reportdesign/source/core/inc/Functions.hxx121
-rw-r--r--reportdesign/source/core/inc/Group.hxx183
-rw-r--r--reportdesign/source/core/inc/Groups.hxx120
-rw-r--r--reportdesign/source/core/inc/ImageControl.hxx184
-rw-r--r--reportdesign/source/core/inc/ReportComponent.hxx118
-rw-r--r--reportdesign/source/core/inc/ReportControlModel.hxx161
-rw-r--r--reportdesign/source/core/inc/ReportDrawPage.hxx62
-rw-r--r--reportdesign/source/core/inc/ReportEngineJFree.hxx178
-rw-r--r--reportdesign/source/core/inc/ReportHelperImpl.hxx879
-rw-r--r--reportdesign/source/core/inc/ReportUndoFactory.hxx95
-rw-r--r--reportdesign/source/core/inc/RptObjectListener.hxx79
-rw-r--r--reportdesign/source/core/inc/Section.hxx236
-rw-r--r--reportdesign/source/core/inc/Shape.hxx196
-rw-r--r--reportdesign/source/core/inc/Tools.hxx161
-rw-r--r--reportdesign/source/core/inc/core_resource.hrc67
-rw-r--r--reportdesign/source/core/inc/core_resource.hxx90
-rw-r--r--reportdesign/source/core/resource/core_resource.cxx118
-rw-r--r--reportdesign/source/core/resource/makefile.mk56
-rw-r--r--reportdesign/source/core/resource/strings.src119
-rw-r--r--reportdesign/source/core/sdr/ModuleHelper.cxx168
-rw-r--r--reportdesign/source/core/sdr/PropertyForward.cxx223
-rw-r--r--reportdesign/source/core/sdr/ReportDrawPage.cxx135
-rw-r--r--reportdesign/source/core/sdr/ReportUndoFactory.cxx189
-rw-r--r--reportdesign/source/core/sdr/RptModel.cxx194
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx921
-rw-r--r--reportdesign/source/core/sdr/RptObjectListener.cxx117
-rw-r--r--reportdesign/source/core/sdr/RptPage.cxx221
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx989
-rw-r--r--reportdesign/source/core/sdr/formatnormalizer.cxx288
-rw-r--r--reportdesign/source/core/sdr/formatnormalizer.hxx108
-rw-r--r--reportdesign/source/core/sdr/makefile.mk60
-rw-r--r--reportdesign/source/filter/xml/dbloader2.cxx138
-rw-r--r--reportdesign/source/filter/xml/dbloader2.hxx197
-rw-r--r--reportdesign/source/filter/xml/makefile.mk99
-rw-r--r--reportdesign/source/filter/xml/xmlAutoStyle.cxx118
-rw-r--r--reportdesign/source/filter/xml/xmlAutoStyle.hxx76
-rw-r--r--reportdesign/source/filter/xml/xmlCell.cxx327
-rw-r--r--reportdesign/source/filter/xml/xmlCell.hxx84
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.cxx223
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.hxx74
-rw-r--r--reportdesign/source/filter/xml/xmlComponent.cxx164
-rw-r--r--reportdesign/source/filter/xml/xmlComponent.hxx76
-rw-r--r--reportdesign/source/filter/xml/xmlCondPrtExpr.cxx131
-rw-r--r--reportdesign/source/filter/xml/xmlCondPrtExpr.hxx70
-rw-r--r--reportdesign/source/filter/xml/xmlControlProperty.cxx392
-rw-r--r--reportdesign/source/filter/xml/xmlControlProperty.hxx106
-rw-r--r--reportdesign/source/filter/xml/xmlEnums.hxx183
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx1667
-rw-r--r--reportdesign/source/filter/xml/xmlExport.hxx327
-rw-r--r--reportdesign/source/filter/xml/xmlFixedContent.cxx239
-rw-r--r--reportdesign/source/filter/xml/xmlFixedContent.hxx81
-rw-r--r--reportdesign/source/filter/xml/xmlFormatCondition.cxx158
-rw-r--r--reportdesign/source/filter/xml/xmlFormatCondition.hxx69
-rw-r--r--reportdesign/source/filter/xml/xmlFormattedField.cxx139
-rw-r--r--reportdesign/source/filter/xml/xmlFormattedField.hxx67
-rw-r--r--reportdesign/source/filter/xml/xmlFunction.cxx156
-rw-r--r--reportdesign/source/filter/xml/xmlFunction.hxx81
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx251
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.hxx80
-rw-r--r--reportdesign/source/filter/xml/xmlHelper.cxx487
-rw-r--r--reportdesign/source/filter/xml/xmlHelper.hxx112
-rw-r--r--reportdesign/source/filter/xml/xmlImage.cxx142
-rw-r--r--reportdesign/source/filter/xml/xmlImage.hxx65
-rw-r--r--reportdesign/source/filter/xml/xmlMasterFields.cxx146
-rw-r--r--reportdesign/source/filter/xml/xmlMasterFields.hxx67
-rw-r--r--reportdesign/source/filter/xml/xmlPropertyHandler.cxx75
-rw-r--r--reportdesign/source/filter/xml/xmlPropertyHandler.hxx62
-rw-r--r--reportdesign/source/filter/xml/xmlReport.cxx254
-rw-r--r--reportdesign/source/filter/xml/xmlReport.hxx73
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.cxx173
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.hxx70
-rw-r--r--reportdesign/source/filter/xml/xmlReportElementBase.cxx137
-rw-r--r--reportdesign/source/filter/xml/xmlReportElementBase.hxx81
-rw-r--r--reportdesign/source/filter/xml/xmlRow.cxx213
-rw-r--r--reportdesign/source/filter/xml/xmlRow.hxx73
-rw-r--r--reportdesign/source/filter/xml/xmlSection.cxx193
-rw-r--r--reportdesign/source/filter/xml/xmlSection.hxx76
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.cxx503
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.hxx190
-rw-r--r--reportdesign/source/filter/xml/xmlSubDocument.cxx134
-rw-r--r--reportdesign/source/filter/xml/xmlSubDocument.hxx77
-rw-r--r--reportdesign/source/filter/xml/xmlTable.cxx341
-rw-r--r--reportdesign/source/filter/xml/xmlTable.hxx111
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx1068
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.hxx277
-rw-r--r--reportdesign/source/filter/xml/xmlservices.cxx116
-rw-r--r--reportdesign/source/inc/GroupProperties.hxx62
-rw-r--r--reportdesign/source/inc/constasciistring.hxx61
-rw-r--r--reportdesign/source/inc/corestrings.hrc49
-rw-r--r--reportdesign/source/inc/stringconstants.hrc254
-rw-r--r--reportdesign/source/inc/uistrings.hrc71
-rw-r--r--reportdesign/source/inc/xmlstrings.hrc62
-rw-r--r--reportdesign/source/shared/corestrings.cxx43
-rw-r--r--reportdesign/source/shared/makefile.mk75
-rw-r--r--reportdesign/source/shared/stringconstants.cxx238
-rw-r--r--reportdesign/source/shared/uistrings.cxx62
-rw-r--r--reportdesign/source/shared/xmlstrings.cxx52
-rw-r--r--reportdesign/source/ui/dlg/AddField.cxx418
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx634
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.hrc93
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.src381
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx887
-rw-r--r--reportdesign/source/ui/dlg/Condition.hxx232
-rw-r--r--reportdesign/source/ui/dlg/DateTime.cxx282
-rw-r--r--reportdesign/source/ui/dlg/DateTime.hrc68
-rw-r--r--reportdesign/source/ui/dlg/DateTime.src153
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.cxx92
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.hxx69
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx1441
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.hrc78
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.src402
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx1004
-rw-r--r--reportdesign/source/ui/dlg/Navigator.src203
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.cxx185
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.hrc67
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.src193
-rw-r--r--reportdesign/source/ui/dlg/dlgpage.cxx113
-rw-r--r--reportdesign/source/ui/dlg/dlgpage.src337
-rw-r--r--reportdesign/source/ui/dlg/makefile.mk80
-rw-r--r--reportdesign/source/ui/inc/AddField.hxx120
-rw-r--r--reportdesign/source/ui/inc/ColorChanger.hxx78
-rw-r--r--reportdesign/source/ui/inc/ColorListener.hxx102
-rw-r--r--reportdesign/source/ui/inc/CondFormat.hxx194
-rw-r--r--reportdesign/source/ui/inc/DateTime.hxx118
-rw-r--r--reportdesign/source/ui/inc/DefaultInspection.hxx130
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx327
-rw-r--r--reportdesign/source/ui/inc/EndMarker.hxx63
-rw-r--r--reportdesign/source/ui/inc/GeometryHandler.hxx184
-rw-r--r--reportdesign/source/ui/inc/GroupsSorting.hxx209
-rw-r--r--reportdesign/source/ui/inc/MarkedSection.hxx68
-rw-r--r--reportdesign/source/ui/inc/Navigator.hxx66
-rw-r--r--reportdesign/source/ui/inc/PageNumber.hxx102
-rw-r--r--reportdesign/source/ui/inc/ReportComponentHandler.hxx135
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx423
-rw-r--r--reportdesign/source/ui/inc/ReportDefines.hxx47
-rw-r--r--reportdesign/source/ui/inc/ReportRuler.hxx75
-rw-r--r--reportdesign/source/ui/inc/ReportSection.hxx205
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx258
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx245
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx74
-rw-r--r--reportdesign/source/ui/inc/StartMarker.hxx105
-rw-r--r--reportdesign/source/ui/inc/UITools.hxx157
-rw-r--r--reportdesign/source/ui/inc/Undo.hxx176
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx333
-rw-r--r--reportdesign/source/ui/inc/dlgedclip.hxx98
-rw-r--r--reportdesign/source/ui/inc/dlgedfac.hxx60
-rw-r--r--reportdesign/source/ui/inc/dlgedfunc.hxx139
-rw-r--r--reportdesign/source/ui/inc/dlgpage.hxx64
-rw-r--r--reportdesign/source/ui/inc/metadata.hxx163
-rw-r--r--reportdesign/source/ui/inc/propbrw.hxx147
-rw-r--r--reportdesign/source/ui/inc/toolboxcontroller.hxx113
-rw-r--r--reportdesign/source/ui/inspection/DefaultInspection.cxx314
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx1165
-rw-r--r--reportdesign/source/ui/inspection/ReportComponentHandler.cxx269
-rw-r--r--reportdesign/source/ui/inspection/inspection.src251
-rw-r--r--reportdesign/source/ui/inspection/makefile.mk58
-rw-r--r--reportdesign/source/ui/inspection/metadata.cxx391
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx109
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx871
-rw-r--r--reportdesign/source/ui/misc/Undo.cxx465
-rw-r--r--reportdesign/source/ui/misc/makefile.mk66
-rw-r--r--reportdesign/source/ui/misc/rptuiservices.cxx102
-rw-r--r--reportdesign/source/ui/misc/toolboxcontroller.cxx434
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx740
-rw-r--r--reportdesign/source/ui/report/EndMarker.cxx118
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx3851
-rw-r--r--reportdesign/source/ui/report/ReportRuler.cxx78
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx763
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx535
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx588
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx199
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx342
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx1202
-rw-r--r--reportdesign/source/ui/report/dlgedclip.cxx127
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx137
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx987
-rw-r--r--reportdesign/source/ui/report/makefile.mk74
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx679
-rw-r--r--reportdesign/source/ui/report/report.src708
-rw-r--r--reportdesign/uiconfig/dbreport/accelerator/de-DE/default.xml15
-rw-r--r--reportdesign/uiconfig/dbreport/accelerator/en-GB/default.xml15
-rw-r--r--reportdesign/uiconfig/dbreport/accelerator/en-US/default.xml15
-rw-r--r--reportdesign/uiconfig/dbreport/menubar/menubar.xml167
-rw-r--r--reportdesign/uiconfig/dbreport/statusbar/statusbar.xml8
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/Formatting.xml22
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/alignmentbar.xml11
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/arrowshapes.xml34
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml29
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/calloutshapes.xml11
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/flowchartshapes.xml36
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml25
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/resizebar.xml9
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml9
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/starshapes.xml17
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/symbolshapes.xml24
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/toolbar.xml22
-rw-r--r--reportdesign/util/description.xml22
-rw-r--r--reportdesign/util/dll.pmk51
-rw-r--r--reportdesign/util/hidother.src139
-rw-r--r--reportdesign/util/makefile.mk259
-rw-r--r--reportdesign/util/makefile.pmk61
-rw-r--r--reportdesign/util/manifest.xml5
-rw-r--r--reportdesign/util/rpt.map9
-rw-r--r--reportdesign/util/rptui.map8
-rw-r--r--reportdesign/util/target.pmk42
441 files changed, 82921 insertions, 0 deletions
diff --git a/reportdesign/inc/ModuleHelper.hxx b/reportdesign/inc/ModuleHelper.hxx
new file mode 100644
index 000000000000..cde03bde7614
--- /dev/null
+++ b/reportdesign/inc/ModuleHelper.hxx
@@ -0,0 +1,110 @@
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#define _RPTUI_MODULE_HELPER_RPT_HXX_
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ModuleHelper.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _TOOLS_RESMGR_HXX
+#include <tools/resmgr.hxx>
+#endif
+#include "dllapi.h"
+//.........................................................................
+namespace rptui
+{
+//.........................................................................
+ //=========================================================================
+ //= OModule
+ //=========================================================================
+ class OModuleImpl;
+ class REPORTDESIGN_DLLPUBLIC OModule
+ {
+ friend class OModuleClient;
+
+ private:
+ OModule();
+ // not implemented. OModule is a static class
+
+ protected:
+ static ::osl::Mutex s_aMutex; /// access safety
+ static sal_Int32 s_nClients; /// number of registered clients
+ static OModuleImpl* s_pImpl; /// impl class. lives as long as at least one client for the module is registered
+
+ public:
+ /// get the vcl res manager of the module
+ static ResMgr* getResManager();
+ protected:
+ /// register a client for the module
+ static void registerClient();
+ /// revoke a client for the module
+ static void revokeClient();
+
+ private:
+ /** ensure that the impl class exists
+ @precond m_aMutex is guarded when this method gets called
+ */
+ static void ensureImpl();
+ };
+
+ //=========================================================================
+ //= OModuleClient
+ //=========================================================================
+ /** base class for objects which uses any global module-specific ressources
+ */
+ class REPORTDESIGN_DLLPUBLIC OModuleClient
+ {
+ public:
+ OModuleClient() { OModule::registerClient(); }
+ ~OModuleClient() { OModule::revokeClient(); }
+ };
+
+ //=========================================================================
+ //= ModuleRes
+ //=========================================================================
+ /** specialized ResId, using the ressource manager provided by the global module
+ */
+ class REPORTDESIGN_DLLPUBLIC ModuleRes : public ::ResId
+ {
+ public:
+ ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { }
+ };
+//.........................................................................
+} // namespace rptui
+//.........................................................................
+
+#endif // _RPTUI_MODULE_HELPER_RPT_HXX_
+
+
diff --git a/reportdesign/inc/PropertyForward.hxx b/reportdesign/inc/PropertyForward.hxx
new file mode 100644
index 000000000000..7f81d891a7ba
--- /dev/null
+++ b/reportdesign/inc/PropertyForward.hxx
@@ -0,0 +1,111 @@
+#ifndef RPTUI_PROPERTYSETFORWARD_HXX
+#define RPTUI_PROPERTYSETFORWARD_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PropertyForward.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE1_HXX_
+#include <cppuhelper/compbase1.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#include "dllapi.h"
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+ typedef ::cppu::WeakComponentImplHelper1< ::com::sun::star::beans::XPropertyChangeListener
+ > OPropertyForward_Base;
+
+ /** \class OPropertyMediator
+ * \brief This class ensures the communication between two XPropertySet instances.
+ * Identical properties will be set at the other propertyset.
+ * \ingroup reportdesign_source_ui_misc
+ */
+ class REPORTDESIGN_DLLPUBLIC OPropertyMediator : public ::cppu::BaseMutex
+ ,public OPropertyForward_Base
+ {
+ TPropertyNamePair m_aNameMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xSource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xSourceInfo;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDest;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> m_xDestInfo;
+ sal_Bool m_bInChange;
+ OPropertyMediator(OPropertyMediator&);
+ void operator =(OPropertyMediator&);
+ protected:
+ virtual ~OPropertyMediator();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ OPropertyMediator(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xSource
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xDest
+ ,const TPropertyNamePair& _aNameMap
+ ,sal_Bool _bReverse = sal_False);
+
+ // ::com::sun::star::beans::XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException);
+
+ /** stop the listening mode.
+ */
+ void stopListening();
+
+ /** starts the listening mode again.
+ */
+ void startListening();
+ };
+//........................................................................
+} // namespace rptui
+//........................................................................
+#endif // RPTUI_PROPERTYSETFORWARD_HXX
+
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
new file mode 100644
index 000000000000..4617bcbe2184
--- /dev/null
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -0,0 +1,353 @@
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#define REPORTDESIGN_API_REPORTDEFINITION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportDefinition.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE6_HXX_
+#include <cppuhelper/compbase6.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include <cppuhelper/basemutex.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#endif
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef SVX_UNOMOD_HXX
+#include <svx/unomod.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#endif
+#include <com/sun/star/frame/XModule.hpp>
+#include "ReportHelperDefines.hxx"
+#include <boost/shared_ptr.hpp>
+#include "dllapi.h"
+
+namespace rptui
+{
+ class OReportModel;
+}
+namespace comphelper
+{
+ class MediaDescriptor;
+}
+namespace reportdesign
+{
+ class OReportComponentProperties;
+ typedef ::cppu::WeakComponentImplHelper6< com::sun::star::report::XReportDefinition
+ ,com::sun::star::document::XEventBroadcaster
+ ,com::sun::star::lang::XServiceInfo
+ ,com::sun::star::frame::XModule
+ ,com::sun::star::lang::XUnoTunnel
+ ,SvxUnoDrawMSFactory> ReportDefinitionBase;
+ typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportDefinition> ReportDefinitionPropertySet;
+
+ struct OReportDefinitionImpl;
+ /** \class OReportDefinition Defines the implementation of a \interface com:::sun::star::report::XReportDefinition
+ * \ingroup reportdesign_api
+ *
+ */
+ class REPORTDESIGN_DLLPUBLIC OReportDefinition : public ::cppu::BaseMutex,
+ public ReportDefinitionBase,
+ public ReportDefinitionPropertySet
+ {
+ ::boost::shared_ptr<OReportComponentProperties> m_aProps;
+ ::boost::shared_ptr<OReportDefinitionImpl> m_pImpl;
+ private:
+ OReportDefinition(const OReportDefinition&);
+ OReportDefinition& operator=(const OReportDefinition&);
+
+ void setSection( const ::rtl::OUString& _sProperty
+ ,const sal_Bool& _bOn
+ ,const ::rtl::OUString& _sName
+ ,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _member);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+
+ /// write a single XML stream into the package
+ sal_Bool WriteThroughComponent(
+ /// the component we export
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XComponent> & xComponent,
+ const sal_Char* pStreamName, /// the stream name
+ const sal_Char* pServiceName, /// service name of the component
+ /// the argument (XInitialization)
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any> & rArguments,
+ /// output descriptor
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue> & rMediaDesc,
+ sal_Bool bPlainStream
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); /// neither compress nor encrypt
+
+ /// write a single output stream
+ /// (to be called either directly or by WriteThroughComponent(...))
+ sal_Bool WriteThroughComponent(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XOutputStream> & xOutputStream,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XComponent> & xComponent,
+ const sal_Char* pServiceName,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any> & rArguments,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::PropertyValue> & rMediaDesc);
+
+ void notifyEvent(const ::rtl::OUString& _sEventName);
+ void init();
+ void fillArgs(::comphelper::MediaDescriptor& _aDescriptor);
+ protected:
+ virtual ~OReportDefinition();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ explicit OReportDefinition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OReportDefinition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportDefinition
+ virtual ::rtl::OUString SAL_CALL getMimeType() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMimeType( const ::rtl::OUString& _mimetype ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCaption() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getGroupKeepTogether() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupKeepTogether( ::sal_Int16 _groupkeeptogether ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getPageHeaderOption() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPageHeaderOption( ::sal_Int16 _pageheaderoption ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getPageFooterOption() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPageFooterOption( ::sal_Int16 _pagefooteroption ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getMasterFields() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMasterFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _masterfields ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDetailFields() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDetailFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _detailfields ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCommand() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCommand( const ::rtl::OUString& _command ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCommandType() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCommandType( ::sal_Int32 _commandtype ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getFilter() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFilter( const ::rtl::OUString& _filter ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getEscapeProcessing() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEscapeProcessing( ::sal_Bool _escapeprocessing ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getReportHeaderOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setReportHeaderOn( ::sal_Bool _reportheaderon ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getReportFooterOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setReportFooterOn( ::sal_Bool _reportfooteron ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getPageHeaderOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPageHeaderOn( ::sal_Bool _pageheaderon ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getPageFooterOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPageFooterOn( ::sal_Bool _pagefooteron ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups > SAL_CALL getGroups() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getReportHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getPageHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getDetail() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getPageFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getReportFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventBroadcaster > SAL_CALL getEventBroadcaster( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableMimeTypes( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+
+ // XShape
+ SHAPE_HEADER()
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ //XFunctionsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > SAL_CALL getFunctions() throw (::com::sun::star::uno::RuntimeException);
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XCloseBroadcaster
+ virtual void SAL_CALL addCloseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeCloseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XCloseable
+ virtual void SAL_CALL close( ::sal_Bool DeliverOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XModel
+ virtual ::sal_Bool SAL_CALL attachResource( const ::rtl::OUString& URL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getURL( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getArgs( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL connectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disconnectController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL lockControllers( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL unlockControllers( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasControllersLocked( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > SAL_CALL getCurrentController( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCurrentController( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& Controller ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getCurrentSelection( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStorageBasedDocument
+ virtual void SAL_CALL loadFromStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescriptor ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescriptor ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL switchToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL getDocumentStorage( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addStorageChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStorageChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XViewDataSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getViewData( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setViewData( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& Data ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XLoadable
+ virtual void SAL_CALL initNew( ) throw (::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL load( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments ) throw (::com::sun::star::frame::DoubleInitializationException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XVisualObject
+ virtual void SAL_CALL setVisualAreaSize( ::sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMapUnit( ::sal_Int64 nAspect ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XModifiable
+ virtual ::sal_Bool SAL_CALL isModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setModified( ::sal_Bool bModified ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
+
+ // XModifyBroadcaster
+ virtual void SAL_CALL addModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeModifyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // document::XEventBroadcaster
+ virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // document::XEventListener
+ virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUIConfigurationManagerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDocumentSubStorageSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > SAL_CALL getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDocumentSubStoragesNames( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+
+ // SvxUnoDrawMSFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XStyleFamiliesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getStyleFamilies( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModule
+ virtual void SAL_CALL setIdentifier( const ::rtl::OUString& Identifier ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getIdentifier( ) throw (::com::sun::star::uno::RuntimeException);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext();
+
+ /** return the SdrModel of the real model
+ *
+ * \return
+ */
+ ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const;
+
+ static ::boost::shared_ptr<rptui::OReportModel> getSdrModel(::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
+ };
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+#endif // REPORTDESIGN_API_REPORTDEFINITION_HXX
+
diff --git a/reportdesign/inc/ReportHelperDefines.hxx b/reportdesign/inc/ReportHelperDefines.hxx
new file mode 100644
index 000000000000..5f9e2ee5d258
--- /dev/null
+++ b/reportdesign/inc/ReportHelperDefines.hxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportHelperDefines.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORTHELPERDEFINES_HXX
+#define INCLUDED_REPORTHELPERDEFINES_HXX
+
+#define REPORTCONTROLMODEL_HEADER() \
+ virtual ::rtl::OUString SAL_CALL getDataField() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setDataField(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getPrintWhenGroupChange() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setPrintWhenGroupChange(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getConditionalPrintExpression() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setConditionalPrintExpression(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition > SAL_CALL createFormatCondition() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception);
+
+#define SHAPE_HEADER() \
+ virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setPosition(const ::com::sun::star::awt::Point & aPosition) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setSize(const ::com::sun::star::awt::Size & aSize) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException);
+
+#define REPORTCOMPONENT_HEADER() \
+ virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::PropertyVetoException); \
+ virtual ::sal_Int32 SAL_CALL getHeight() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setHeight(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::sal_Int32 SAL_CALL getPositionX() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setPositionX(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::sal_Int32 SAL_CALL getPositionY() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setPositionY(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::sal_Int32 SAL_CALL getWidth() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setWidth(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::sal_Int16 SAL_CALL getControlBorder() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setControlBorder(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int32 SAL_CALL getControlBorderColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setControlBorderColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getPrintRepeatedValues() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setPrintRepeatedValues(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getSection() throw (::com::sun::star::uno::RuntimeException);
+
+#define REPORTCONTROLFORMAT_HEADER() \
+ virtual ::sal_Int32 SAL_CALL getControlBackground() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setControlBackground(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getControlBackgroundTransparent() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setControlBackgroundTransparent(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getParaAdjust() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setParaAdjust(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException); \
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setFontDescriptor(const ::com::sun::star::awt::FontDescriptor & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getControlTextEmphasis() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setControlTextEmphasis(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharEmphasis() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharEmphasis(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharCombineIsOn() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharCombineIsOn(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getCharCombinePrefix() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharCombinePrefix(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getCharCombineSuffix() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharCombineSuffix(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharHidden() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharHidden(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharShadowed() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharShadowed(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharContoured() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharContoured(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharCaseMap() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharCaseMap(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::com::sun::star::lang::Locale SAL_CALL getCharLocale() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharLocale(const ::com::sun::star::lang::Locale & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharEscapement() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharEscapement(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int8 SAL_CALL getCharEscapementHeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharEscapementHeight(::sal_Int8 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharAutoKerning() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharAutoKerning(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharFlash() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFlash(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharRelief() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharRelief(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getCharFontName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFontName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getCharFontStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFontStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharFontFamily() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFontFamily(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharFontCharSet() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFontCharSet(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharFontPitch() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharFontPitch(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int32 SAL_CALL getCharColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int32 SAL_CALL getCharUnderlineColor() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharUnderlineColor(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual float SAL_CALL getCharHeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharHeight(float the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharUnderline() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharUnderline(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual float SAL_CALL getCharWeight() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharWeight(float the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::com::sun::star::awt::FontSlant SAL_CALL getCharPosture() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharPosture(::com::sun::star::awt::FontSlant the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharStrikeout() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharStrikeout(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Bool SAL_CALL getCharWordMode() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharWordMode(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharRotation() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharRotation(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getCharScaleWidth() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setCharScaleWidth(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::sal_Int16 SAL_CALL getParaVertAlignment() throw (::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setParaVertAlignment(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException);\
+ virtual ::rtl::OUString SAL_CALL getHyperLinkURL() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setHyperLinkURL(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getHyperLinkTarget() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setHyperLinkTarget(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getHyperLinkName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setHyperLinkName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getVisitedCharStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setVisitedCharStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual ::rtl::OUString SAL_CALL getUnvisitedCharStyleName() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); \
+ virtual void SAL_CALL setUnvisitedCharStyleName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);\
+ virtual ::sal_Int16 SAL_CALL getCharKerning() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);\
+ virtual void SAL_CALL setCharKerning(::sal_Int16 the_value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+
+
+#endif // INCLUDED_REPORTHELPERDEFINES_HXX
+
diff --git a/reportdesign/inc/ReportVisitor.hxx b/reportdesign/inc/ReportVisitor.hxx
new file mode 100644
index 000000000000..b0917030f2e5
--- /dev/null
+++ b/reportdesign/inc/ReportVisitor.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportVisitor.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORT_VISTITOR_HXX
+#define INCLUDED_REPORT_VISTITOR_HXX
+
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#include "dllapi.h"
+
+namespace reportdesign
+{
+ class SAL_NO_VTABLE ITraverseReport
+ {
+ public:
+ virtual void traverseReport(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport) = 0;
+ virtual void traverseReportFunctions(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions>& _xFunctions) = 0;
+ virtual void traverseReportHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+ virtual void traverseReportFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+ virtual void traversePageHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+ virtual void traversePageFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+
+ virtual void traverseGroups(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups>& _xGroups) = 0;
+ virtual void traverseGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup) = 0;
+ virtual void traverseGroupFunctions(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions>& _xFunctions) = 0;
+ virtual void traverseGroupHeader(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+ virtual void traverseGroupFooter(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+
+ virtual void traverseDetail(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) = 0;
+ };
+
+ class REPORTDESIGN_DLLPUBLIC OReportVisitor
+ {
+ ITraverseReport* m_pTraverseReport;
+ public:
+ OReportVisitor(ITraverseReport* _pTraverseReport);
+ void start(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReportDefinition);
+ void start(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup);
+ };
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+#endif // INCLUDED_REPORT_VISTITOR_HXX
+
diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx
new file mode 100644
index 000000000000..3b0a007c9f48
--- /dev/null
+++ b/reportdesign/inc/RptDef.hxx
@@ -0,0 +1,119 @@
+#ifndef _REPORT_RPTUIDEF_HXX
+#define _REPORT_RPTUIDEF_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptDef.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#ifndef _SVDOBJ_HXX
+#include <svx/svdobj.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#include <svx/fmglob.hxx>
+#include "dllapi.h"
+
+FORWARD_DECLARE_INTERFACE(report,XReportComponent)
+FORWARD_DECLARE_INTERFACE(report,XReportDefinition)
+FORWARD_DECLARE_INTERFACE(style,XStyle)
+FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
+
+namespace rptui
+{
+
+const UINT32 ReportInventor = UINT32('R')*0x00000001+
+ UINT32('P')*0x00000100+
+ UINT32('T')*0x00010000+
+ UINT32('1')*0x01000000;
+
+
+#define OBJ_DLG_FIXEDTEXT ((UINT16) OBJ_MAXI + 1)
+#define OBJ_DLG_IMAGECONTROL OBJ_FM_IMAGECONTROL
+#define OBJ_DLG_FORMATTEDFIELD ((UINT16) OBJ_MAXI + 3)
+#define OBJ_DLG_HFIXEDLINE ((UINT16) OBJ_MAXI + 4)
+#define OBJ_DLG_VFIXEDLINE ((UINT16) OBJ_MAXI + 5)
+
+// allows the alignment and resizing of controls
+namespace ControlModification
+{
+ static const ::sal_Int32 NONE = (sal_Int32)0;
+ static const ::sal_Int32 LEFT = (sal_Int32)1;
+ static const ::sal_Int32 RIGHT = (sal_Int32)2;
+ static const ::sal_Int32 TOP = (sal_Int32)3;
+ static const ::sal_Int32 BOTTOM = (sal_Int32)4;
+ static const ::sal_Int32 CENTER_HORIZONTAL = (sal_Int32)5;
+ static const ::sal_Int32 CENTER_VERTICAL = (sal_Int32)6;
+ static const ::sal_Int32 WIDTH_SMALLEST = (sal_Int32)7;
+ static const ::sal_Int32 HEIGHT_SMALLEST = (sal_Int32)8;
+ static const ::sal_Int32 WIDTH_GREATEST = (sal_Int32)9;
+ static const ::sal_Int32 HEIGHT_GREATEST = (sal_Int32)10;
+}
+
+/** returns teh object type depending on the service name
+ @param _xComponent the report component
+*/
+REPORTDESIGN_DLLPUBLIC sal_uInt16 getObjectType(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+
+DECLARE_STL_USTRINGACCESS_MAP(::rtl::OUString , TPropertyNamePair);
+/** returns teh property name map for the givern property id
+ @param _nObjectId the object id
+*/
+REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId);
+REPORTDESIGN_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle> getUsedStyle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport);
+
+// -----------------------------------------------------------------------------
+template < typename T> T getStyleProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,const ::rtl::OUString& _sPropertyName)
+{
+ T nReturn;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xProp(getUsedStyle(_xReport),::com::sun::star::uno::UNO_QUERY_THROW);
+ xProp->getPropertyValue(_sPropertyName) >>= nReturn;
+ return nReturn;
+}
+// -----------------------------------------------------------------------------
+template<typename T> void setStyleProperty(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,const ::rtl::OUString& _sPropertyName,const T& _aValue)
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xProp(getUsedStyle(_xReport),::com::sun::star::uno::UNO_QUERY);
+ if ( xProp.is() )
+ xProp->setPropertyValue(_sPropertyName,::com::sun::star::uno::makeAny(_aValue));
+}
+}
+
+#endif // _REPORT_RPTUIDEF_HXX
diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx
new file mode 100644
index 000000000000..6012143ce150
--- /dev/null
+++ b/reportdesign/inc/RptModel.hxx
@@ -0,0 +1,104 @@
+#ifndef REPORT_RPTMODEL_HXX
+#define REPORT_RPTMODEL_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptModel.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _SVDMODEL_HXX
+#include <svx/svdmodel.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#include "dllapi.h"
+
+class Window;
+namespace dbaui
+{
+ class OSingleDocumentController;
+}
+namespace rptui
+{
+//============================================================================
+// OReportModel
+//============================================================================
+
+class OReportPage;
+class OXUndoEnvironment;
+
+class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
+{
+ friend class OReportPage;
+
+private:
+ OXUndoEnvironment* m_pUndoEnv;
+ ::dbaui::OSingleDocumentController* m_pController;
+
+ OReportModel( const OReportModel& );
+ void operator=(const OReportModel& rSrcModel);
+public:
+ TYPEINFO();
+
+ OReportModel();
+ virtual ~OReportModel();
+
+ virtual void SetChanged(sal_Bool bFlg = sal_True);
+ virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
+ virtual Window* GetCurDocViewWin();
+ virtual SdrPage* RemovePage(USHORT nPgNum);
+ /** returns the numbering type that is used to format page fields in drawing shapes */
+ virtual SvxNumType GetPageNumType() const;
+
+ OXUndoEnvironment& GetUndoEnv();
+ void SetModified(sal_Bool _bModified);
+
+ inline dbaui::OSingleDocumentController* getController() const { return m_pController; }
+ inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; }
+ void detachController();
+
+ OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+
+ /** returns the page which belongs to a section
+ *
+ * \param _xSection
+ * \return The page or <NULL/> when t´no page could be found.
+ */
+ OReportPage* getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+
+ /// returns the XReportDefinition which the OReportModel belongs to
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >
+ getReportDefinition() const;
+};
+}
+#endif
+
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
new file mode 100644
index 000000000000..f6b4cd05be8e
--- /dev/null
+++ b/reportdesign/inc/RptObject.hxx
@@ -0,0 +1,267 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptObject.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIOBJ_HXX
+#define _REPORT_RPTUIOBJ_HXX
+
+#ifndef _SVDOUNO_HXX
+#include <svx/svdouno.hxx>
+#endif
+
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
+#include <com/sun/star/container/XContainerListener.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+
+#ifndef _SVDOCIRC_HXX
+#include <svx/svdocirc.hxx>
+#endif
+#ifndef _SVDOGRP_HXX
+#include <svx/svdogrp.hxx>
+#endif
+#ifndef _SVDOASHP_HXX
+#include <svx/svdoashp.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#include <comphelper/implementationreference.hxx>
+#endif
+#include "dllapi.h"
+
+namespace rptui
+{
+typedef ::std::multimap< sal_Int16, ::rtl::OUString, ::std::less< sal_Int16 > > IndexToNameMap;
+ enum DlgEdHintKind
+ {
+ RPTUI_HINT_UNKNOWN,
+ RPTUI_HINT_WINDOWSCROLLED,
+ RPTUI_HINT_LAYERCHANGED,
+ RPTUI_HINT_OBJORDERCHANGED,
+ RPTUI_HINT_SELECTIONCHANGED
+ };
+
+ class OUnoObject;
+ class REPORTDESIGN_DLLPUBLIC DlgEdHint: public SfxHint
+ {
+ private:
+ DlgEdHintKind eHintKind;
+ OUnoObject* pDlgEdObj;
+
+ DlgEdHint(DlgEdHint&);
+ void operator =(DlgEdHint&);
+ public:
+ TYPEINFO();
+ DlgEdHint( DlgEdHintKind eHint );
+ DlgEdHint( DlgEdHintKind eHint, OUnoObject* pObj );
+ virtual ~DlgEdHint();
+
+ inline DlgEdHintKind GetKind() const { return eHintKind; }
+ inline OUnoObject* GetObject() const { return pDlgEdObj; }
+ };
+
+
+class OReportPage;
+class OPropertyMediator;
+
+class REPORTDESIGN_DLLPUBLIC OObjectBase
+{
+public:
+ typedef ::comphelper::ImplementationReference<OPropertyMediator,::com::sun::star::beans::XPropertyChangeListener> TMediator;
+protected:
+
+ mutable TMediator m_xMediator;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener> m_xPropertyChangeListener;
+ //mutable ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener>
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> m_xReportComponent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener> m_xContainerListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xSection;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xKeepShapeAlive;
+ ::rtl::OUString m_sComponentName;
+ sal_Bool m_bIsListening;
+
+ OObjectBase(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+ OObjectBase(const ::rtl::OUString& _sComponentName);
+
+ virtual ~OObjectBase();
+
+ inline sal_Bool isListening() const { return m_bIsListening; }
+
+ void SetPropsFromRect(const Rectangle& _rRect);
+ void PositionAndSizeChange( const ::com::sun::star::beans::PropertyChangeEvent& evt );
+
+ virtual void SetSnapRectImpl(const Rectangle& _rRect) = 0;
+ virtual SdrPage* GetImplPage() const = 0;
+ virtual void SetObjectItemHelper(const SfxPoolItem& rItem);
+ sal_Bool IsInside(const Rectangle& _rRect,const Point& rPnt,USHORT nTol) const;
+
+ /** called by instances of derived classes to implement their overloading of getUnoShape
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ getUnoShapeOf( SdrObject& _rSdrObject );
+
+public:
+ void StartListening();
+ void EndListening(sal_Bool bRemoveListener = sal_True);
+ // PropertyChangeListener
+ virtual void _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ContainerListener
+ void _elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void _elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+ void _elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
+
+ sal_Bool supportsService( const sal_Char* _pServiceName ) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> getReportComponent() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
+ inline void setOldParent(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) { m_xSection = _xSection; }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> getOldParent() const { return m_xSection;}
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> getSection() const;
+
+ /** releases the reference to our UNO shape (m_xKeepShapeAlive)
+ */
+ void releaseUnoShape() { m_xKeepShapeAlive.clear(); }
+
+ static SdrObject* createObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+ static sal_uInt16 getObjectType(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+};
+//============================================================================
+// OCustomShape
+//============================================================================
+class REPORTDESIGN_DLLPUBLIC OCustomShape: public SdrObjCustomShape , public OObjectBase
+{
+ friend class OReportPage;
+ friend class OObjectBase;
+ friend class DlgEdFactory;
+
+protected:
+ OCustomShape(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent);
+ OCustomShape(const ::rtl::OUString& _sComponentName);
+
+ virtual void NbcMove( const Size& rSize );
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+
+ virtual void SetSnapRectImpl(const Rectangle& _rRect);
+ virtual SdrPage* GetImplPage() const;
+ void SetObjectItemHelper(const SfxPoolItem& rItem);
+
+public:
+ TYPEINFO();
+
+ virtual ~OCustomShape();
+
+ virtual sal_Int32 GetStep() const;
+
+ virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
+};
+
+//============================================================================
+// OUnoObject
+//============================================================================
+class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
+{
+ friend class OReportPage;
+ friend class OObjectBase;
+ friend class DlgEdFactory;
+
+ sal_uInt16 m_nObjectType;
+
+ ::rtl::OUString GetDefaultName() const;
+protected:
+ OUnoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _xControlModel
+ ,sal_uInt16 _nObjectType);
+ OUnoObject(const ::rtl::OUString& _sComponentName
+ ,const ::rtl::OUString& rModelName
+ ,sal_uInt16 _nObjectType);
+ OUnoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent
+ ,const ::rtl::OUString& rModelName
+ ,sal_uInt16 _nObjectType);
+
+ virtual ~OUnoObject();
+
+ virtual void NbcMove( const Size& rSize );
+ virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcSetLogicRect(const Rectangle& rRect);
+ virtual FASTBOOL EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
+
+ virtual void SetSnapRectImpl(const Rectangle& _rRect);
+ virtual SdrPage* GetImplPage() const;
+
+public:
+ TYPEINFO();
+
+ virtual sal_Int32 GetStep() const;
+
+ virtual SdrObject* CheckHit(const Point& rPnt,USHORT nTol,const SetOfByte*) const;
+ virtual void _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
+
+ /** creates the m_xMediator when it doesn't already exist.
+ @param _bReverse when set to <TRUE/> then the properties from the uno control will be copied into report control
+ */
+ void CreateMediator(sal_Bool _bReverse = sal_False);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
+
+ inline sal_uInt16 getObjectId() const { return m_nObjectType; }
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
+};
+
+//============================================================================
+} // rptui
+//============================================================================
+#endif // _REPORT_RPTUIOBJ_HXX
+
diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx
new file mode 100644
index 000000000000..120db95ca884
--- /dev/null
+++ b/reportdesign/inc/RptPage.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptPage.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIPAGE_HXX
+#define _REPORT_RPTUIPAGE_HXX
+
+#ifndef _SVDPAGE_HXX
+#include "svx/svdpage.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#include "dllapi.h"
+
+namespace rptui
+{
+//============================================================================
+// OReportPage
+//============================================================================
+
+class OReportModel;
+//class OReportSection;
+
+class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
+{
+ OReportModel& rModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ m_xSection;
+
+ OReportPage(const OReportPage&);
+protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage();
+public:
+ TYPEINFO();
+
+ OReportPage( OReportModel& rModel
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,FASTBOOL bMasterPage=FALSE );
+
+ virtual ~OReportPage();
+
+ virtual SdrPage* Clone() const;
+ using SdrPage::Clone;
+
+ virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason);
+ virtual SdrObject* RemoveObject(ULONG nObjNum);
+
+ /** returns teh index inside the object list which belongs to the report component.
+ @param _xObject the report component
+ */
+ ULONG getIndexOf(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
+
+ /** removes the SdrObject which belongs to the report component.
+ @param _xObject the report component
+ */
+ void removeSdrObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
+
+ /** insert a new SdrObject which belongs to the report component.
+ @param _xObject the report component
+ */
+ void insertObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
+
+ //inline OReportSection* getReportSection() { return m_pView; }
+
+ /** sets the view to <NULL/>
+ */
+ //inline void clearSection() { m_pView = NULL; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const;
+};
+}
+#endif //_REPORT_RPTUIPAGE_HXX
diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc
new file mode 100644
index 000000000000..a929011b5629
--- /dev/null
+++ b/reportdesign/inc/RptResId.hrc
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptResId.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _RPTUI_DLGRESID_HRC
+#define _RPTUI_DLGRESID_HRC
+
+// include -----------------------------------------------------------
+
+#ifndef _SOLAR_HRC
+#include <svtools/solar.hrc>
+#endif
+
+#define RID_DIALOG_START RID_RPT_START
+#define RID_PAGE_START RID_RPT_START
+#define RID_ERRORBOX_START RID_RPT_START
+#define RID_QUERYBOX_START RID_RPT_START
+#define RID_TOOLBOX_START RID_RPT_START
+#define RID_BITMAP_START RID_RPT_START
+#define RID_IMAGE_START RID_RPT_START
+#define RID_IMAGELIST_START RID_RPT_START
+#define RID_MENU_START RID_RPT_START
+#define RID_STRING_START RID_RPT_START
+#define RID_UNTYPED_START RID_RPT_START
+#define RID_WARN_START RID_RPT_START
+#define RID_CONTROL_START RID_RPT_START
+#define RID_MISC_START RID_RPT_START
+
+// Dialog Control Id's -----------------------------------------------------------
+#define RID_GROUPS_SORTING ( RID_DIALOG_START + 0 )
+#define RID_PAGENUMBERS ( RID_DIALOG_START + 1 )
+#define RID_DATETIME_DLG ( RID_DIALOG_START + 2 )
+#define RID_CONDFORMAT ( RID_DIALOG_START + 3 )
+#define WIN_CONDITION ( RID_DIALOG_START + 4 )
+#define RID_NAVIGATOR ( RID_DIALOG_START + 5 )
+
+// strings
+#define RID_STR_CLASS_FORMATTEDFIELD ( RID_STRING_START + 1 )
+#define RID_STR_CLASS_FIXEDTEXT ( RID_STRING_START + 2 )
+#define RID_STR_CLASS_IMAGECONTROL ( RID_STRING_START + 3 )
+#define RID_STR_PROPTITLE_FIXEDTEXT ( RID_STRING_START + 4 )
+#define RID_STR_PROPTITLE_FORMATTED ( RID_STRING_START + 5 )
+#define RID_STR_PROPTITLE_SHAPE ( RID_STRING_START + 6 )
+#define RID_STR_PROPTITLE_IMAGECONTROL ( RID_STRING_START + 7 )
+#define RID_STR_PROPTITLE_REPORT ( RID_STRING_START + 8 )
+#define RID_STR_PROPTITLE_SECTION ( RID_STRING_START + 9 )
+#define RID_STR_PROPTITLE_FUNCTION ( RID_STRING_START + 10 )
+
+// undo strings
+#define RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER ( RID_STRING_START + 11 )
+#define RID_STR_UNDO_ADD_REPORTHEADERFOOTER ( RID_STRING_START + 12 )
+#define RID_STR_UNDO_REMOVE_PAGEHEADERFOOTER ( RID_STRING_START + 13 )
+#define RID_STR_UNDO_ADD_PAGEHEADERFOOTER ( RID_STRING_START + 14 )
+#define RID_STR_UNDO_PROPERTY ( RID_STRING_START + 15 )
+#define RID_STR_UNDO_REMOVE_GROUP ( RID_STRING_START + 16 )
+#define RID_STR_UNDO_APPEND_GROUP ( RID_STRING_START + 17 )
+#define RID_STR_UNDO_MOVE_GROUP ( RID_STRING_START + 18 )
+#define RID_STR_UNDO_CONDITIONAL_FORMATTING ( RID_STRING_START + 19 )
+#define RID_STR_UNDO_REMOVE_SELECTION ( RID_STRING_START + 20 )
+#define RID_STR_UNDO_PASTE ( RID_STRING_START + 21 )
+#define RID_STR_UNDO_CHANGE_SIZE ( RID_STRING_START + 22 )
+#define RID_STR_UNDO_INSERT_CONTROL ( RID_STRING_START + 23 )
+#define RID_STR_UNDO_DELETE_CONTROL ( RID_STRING_START + 24 )
+#define RID_STR_UNDO_GROUP ( RID_STRING_START + 25 )
+#define RID_STR_UNDO_UNGROUP ( RID_STRING_START + 26 )
+#define RID_STR_UNDO_CHANGEPOSITION ( RID_STRING_START + 27 )
+#define RID_STR_UNDO_ADDFUNCTION ( RID_STRING_START + 28 )
+#define RID_STR_UNDO_DELETEFUNCTION ( RID_STRING_START + 29 )
+
+// title of tab pages
+#define RID_STR_DESIGN_VIEW ( RID_STRING_START + 30 )
+#define RID_STR_PREVIEW_VIEW ( RID_STRING_START + 31 )
+// other
+#define STR_RPT_TITLE ( RID_STRING_START + 32 )
+#define STR_RPT_LABEL ( RID_STRING_START + 33 )
+#define STR_RPT_EXPRESSION ( RID_STRING_START + 34 )
+#define STR_RPT_SORTING ( RID_STRING_START + 35 )
+#define STR_RPT_PN_PAGE ( RID_STRING_START + 36 )
+#define STR_RPT_PN_PAGE_OF ( RID_STRING_START + 37 )
+#define STR_RPT_PREFIXCHARS ( RID_STRING_START + 38 )
+#define STR_RPT_YEAR ( RID_STRING_START + 39 )
+#define STR_RPT_QUARTER ( RID_STRING_START + 40 )
+#define STR_RPT_MONTH ( RID_STRING_START + 41 )
+#define STR_RPT_WEEK ( RID_STRING_START + 42 )
+#define STR_RPT_DAY ( RID_STRING_START + 43 )
+#define STR_RPT_HOUR ( RID_STRING_START + 44 )
+#define STR_RPT_MINUTE ( RID_STRING_START + 45 )
+#define STR_RPT_INTERVAL ( RID_STRING_START + 46 )
+#define STR_RPT_HELP_FIELD ( RID_STRING_START + 47 )
+#define STR_RPT_HELP_HEADER ( RID_STRING_START + 48 )
+#define STR_RPT_HELP_FOOTER ( RID_STRING_START + 49 )
+#define STR_RPT_HELP_GROUPON ( RID_STRING_START + 50 )
+#define STR_RPT_HELP_INTERVAL ( RID_STRING_START + 51 )
+#define STR_RPT_HELP_KEEP ( RID_STRING_START + 52 )
+#define STR_RPT_HELP_SORT ( RID_STRING_START + 53 )
+#define RID_STR_GROUPHEADER ( RID_STRING_START + 54 )
+#define RID_STR_GROUPFOOTER ( RID_STRING_START + 55 )
+#define RID_STR_UNDO_REMOVE_FUNCTION ( RID_STRING_START + 56 )
+#define STR_NUMBERED_CONDITION ( RID_STRING_START + 57 )
+
+// Property Browser Headline Id's -----------------------------------------------------------
+#define RID_STR_BRWTITLE_PROPERTIES ( RID_STRING_START + 60 )
+#define RID_STR_BRWTITLE_NO_PROPERTIES ( RID_STRING_START + 61 )
+#define RID_STR_BRWTITLE_MULTISELECT ( RID_STRING_START + 62 )
+#define STR_SHOW_RULER ( RID_STRING_START + 63 )
+#define STR_SHOW_GRID ( RID_STRING_START + 64 )
+
+#define STR_COLOR_WHITE ( RID_STRING_START + 65 )
+#define STR_CHARCOLOR ( RID_STRING_START + 66 )
+#define STR_CHARBACKGROUND ( RID_STRING_START + 67 )
+#define STR_TRANSPARENT ( RID_STRING_START + 68 )
+#define RID_STR_FIELDSELECTION ( RID_STRING_START + 69 )
+
+
+#define RID_STR_UNDO_ADD_GROUP_HEADER ( RID_STRING_START + 70 )
+#define RID_STR_UNDO_REMOVE_GROUP_HEADER ( RID_STRING_START + 71 )
+#define RID_STR_UNDO_ADD_GROUP_FOOTER ( RID_STRING_START + 72 )
+#define RID_STR_UNDO_REMOVE_GROUP_FOOTER ( RID_STRING_START + 73 )
+
+#define RID_STR_PROPPAGE_DEFAULT ( RID_STRING_START + 74 )
+#define RID_STR_PROPPAGE_DATA ( RID_STRING_START + 75 )
+
+#define RID_STR_FILTER ( RID_STRING_START + 76 )
+#define RID_STR_BOOL ( RID_STRING_START + 77 )
+
+#define RID_STR_FORCENEWPAGE (RID_STRING_START + 78)
+#define RID_STR_NEWROWORCOL (RID_STRING_START + 79)
+#define RID_STR_KEEPTOGETHER (RID_STRING_START + 80)
+#define RID_STR_CANGROW (RID_STRING_START + 81)
+#define RID_STR_CANSHRINK (RID_STRING_START + 82)
+#define RID_STR_REPEATSECTION (RID_STRING_START + 83)
+
+#define RID_STR_PROPTITLE_GROUP (RID_STRING_START + 84)
+#define RID_STR_PROPTITLE_FIXEDLINE (RID_STRING_START + 85)
+#define RID_STR_CLASS_FIXEDLINE (RID_STRING_START + 86)
+#define RID_STR_BACKTRANSPARENT (RID_STRING_START + 87)
+#define RID_STR_CONTROLBACKGROUNDTRANSPARENT (RID_STRING_START + 88)
+#define RID_STR_OVERLAP_OTHER_CONTROL (RID_STRING_START + 89)
+#define RID_STR_ILLEGAL_POSITION (RID_STRING_START + 90)
+#define RID_STR_PAGEHEADERFOOTER_INSERT (RID_STRING_START + 91)
+#define RID_STR_PAGEHEADERFOOTER_DELETE (RID_STRING_START + 92)
+#define RID_STR_BACKCOLOR (RID_STRING_START + 93)
+#define RID_STR_PRINTREPEATEDVALUES (RID_STRING_START + 94)
+#define RID_STR_CONDITIONALPRINTEXPRESSION (RID_STRING_START + 95)
+#define RID_STR_COLUMNHEADERFOOTER_INSERT (RID_STRING_START + 96)
+#define RID_STR_STARTNEWCOLUMN (RID_STRING_START + 97)
+#define RID_STR_STARTNEWPAGE (RID_STRING_START + 98)
+#define RID_STR_RESETPAGENUMBER (RID_STRING_START + 99)
+#define RID_STR_COLUMNHEADERFOOTER_DELETE (RID_STRING_START + 100)
+#define RID_STR_MINHEIGHTNEWPAGE (RID_STRING_START + 101)
+#define RID_STR_PRINTWHENGROUPCHANGE (RID_STRING_START + 102)
+#define RID_STR_REPORTHEADERFOOTER_INSERT (RID_STRING_START + 103)
+#define RID_STR_REPORTHEADERFOOTER_DELETE (RID_STRING_START + 104)
+#define RID_STR_VISIBLE (RID_STRING_START + 105)
+
+#define RID_STR_FORCENEWPAGE_CONST (RID_STRING_START + 106)
+#define RID_STR_KEEPTOGETHER_CONST (RID_STRING_START + 107)
+#define RID_STR_GROUPKEEPTOGETHER (RID_STRING_START + 108)
+#define RID_STR_GROUPKEEPTOGETHER_CONST (RID_STRING_START + 109)
+#define RID_STR_PAGEHEADEROPTION (RID_STRING_START + 110)
+#define RID_STR_PAGEFOOTEROPTION (RID_STRING_START + 111)
+#define RID_STR_REPORTPRINTOPTION_CONST (RID_STRING_START + 112)
+#define RID_STR_SECTIONPAGEBREAK_CONST (RID_STRING_START + 113)
+// free
+#define RID_APP_TITLE (RID_STRING_START + 115)
+#define RID_APP_NEW_DOC (RID_STRING_START + 116)
+#define RID_STR_UNDO_ALIGNMENT (RID_STRING_START + 117)
+#define RID_STR_HEADER (RID_STRING_START + 118)
+#define RID_STR_FOOTER (RID_STRING_START + 119)
+#define RID_STR_DATAFIELD (RID_STRING_START + 120)
+#define RID_STR_FONT (RID_STRING_START + 121)
+#define RID_STR_COULD_NOT_CREATE_REPORT (RID_STRING_START + 122)
+#define RID_STR_PRESERVEIRI (RID_STRING_START + 123)
+#define RID_STR_IMPORT_GRAPHIC (RID_STRING_START + 124)
+#define RID_STR_POSITIONX (RID_STRING_START + 125)
+#define RID_STR_POSITIONY (RID_STRING_START + 126)
+#define RID_STR_WIDTH (RID_STRING_START + 127)
+#define RID_STR_HEIGHT (RID_STRING_START + 128)
+#define RID_STR_DELETE (RID_STRING_START + 129)
+#define RID_STR_DEEPTRAVERSING (RID_STRING_START + 130)
+#define RID_STR_PREEVALUATED (RID_STRING_START + 131)
+#define RID_STR_FUNCTIONS (RID_STRING_START + 132)
+#define RID_STR_GROUPS (RID_STRING_START + 133)
+#define RID_STR_FUNCTION (RID_STRING_START + 134)
+#define RID_STR_FORMULA (RID_STRING_START + 135)
+#define RID_STR_INITIALFORMULA (RID_STRING_START + 136)
+#define RID_STR_UNDO_CHANGEFONT (RID_STRING_START + 137)
+#define RID_STR_UNDO_CHANGEPAGE (RID_STRING_START + 138)
+#define RID_STR_CAUGHT_FOREIGN_EXCEPTION (RID_STRING_START + 139)
+
+// #define RID_STR_ (RID_STRING_START + 130)
+// -----------------------------------------------------------------------
+#define RID_PAGEDIALOG_PAGE ( RID_PAGE_START + 1 )
+#define RID_PAGEDIALOG_BACKGROUND ( RID_PAGE_START + 2 )
+#define RID_PAGEDIALOG_CHAR ( RID_PAGE_START + 3 )
+#define RID_PAGE_CHAR ( RID_PAGE_START + 4 )
+#define RID_PAGE_EFFECTS ( RID_PAGE_START + 5 )
+#define RID_PAGE_POSITION ( RID_PAGE_START + 6 )
+#define RID_PAGE_BACKGROUND ( RID_PAGE_START + 7 )
+#define RID_PAGE_TWOLN ( RID_PAGE_START + 8 )
+#define RID_PAGEDIALOG_LINE ( RID_PAGE_START + 9 )
+#define RID_PAGE_LINE ( RID_PAGE_START + 10 )
+#define RID_PAGE_ALIGNMENT ( RID_PAGE_START + 11 )
+
+// -----------------------------------------------------------------------
+#define RID_IMG_TREENODE_COLLAPSED ( RID_IMAGE_START + 1 )
+#define RID_IMG_TREENODE_EXPANDED ( RID_IMAGE_START + 2 )
+#define RID_IMG_TREENODE_COLLAPSED_HC ( RID_IMAGE_START + 3 )
+#define RID_IMG_TREENODE_EXPANDED_HC ( RID_IMAGE_START + 4 )
+#define REPORT_TREE_ICON ( RID_IMAGE_START + 5 )
+// menu -----------------------------------------------------------------------
+#define RID_MENU_REPORT ( RID_MENU_START + 0 )
+#define RID_GROUPSROWPOPUPMENU ( RID_MENU_START + 1 )
+#define RID_MENU_NAVIGATOR ( RID_MENU_START + 2 )
+
+// image lists -----------------------------------------------------------------------
+#define IMG_CONDFORMAT_DLG_SC (RID_IMAGELIST_START + 0)
+#define IMG_CONDFORMAT_DLG_SCH (RID_IMAGELIST_START + 1)
+#define IMG_CONDFORMAT_DLG_LC (RID_IMAGELIST_START + 2)
+#define IMG_CONDFORMAT_DLG_LCH (RID_IMAGELIST_START + 3)
+#define RID_SVXIMGLIST_RPTEXPL (RID_IMAGELIST_START + 4)
+#define RID_SVXIMGLIST_RPTEXPL_HC (RID_IMAGELIST_START + 5)
+
+#endif // _RPTUI_DLGRESID_HRC
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
new file mode 100644
index 000000000000..5be376f91506
--- /dev/null
+++ b/reportdesign/inc/UndoActions.hxx
@@ -0,0 +1,323 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UndoActions.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_UNDOACTIONS_HXX
+#define RPTUI_UNDOACTIONS_HXX
+
+#ifndef _SVDUNDO_HXX
+#include <svx/svdundo.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_UTIL_XMODIFYLISTENER_HPP_
+#include <com/sun/star/util/XModifyListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_SCRIPTEVENT_HPP_
+#include <com/sun/star/script/ScriptEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XSCRIPTLISTENER_HPP_
+#include <com/sun/star/script/XScriptListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_SCRIPTEVENTDESCRIPTOR_HPP_
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_CONTAINEREVENT_HPP_
+#include <com/sun/star/container/ContainerEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XGROUP_HPP_
+#include <com/sun/star/report/XGroup.hpp>
+#endif
+/** === end UNO includes === **/
+
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#include <comphelper/sequence.hxx>
+#ifndef _SFXLSTNER_HXX //autogen
+#include <svtools/lstner.hxx>
+#endif
+#ifndef _SVDOUNO_HXX
+#include <svx/svdouno.hxx>
+#endif
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#include "dllapi.h"
+#include <functional>
+#include <memory>
+#include <boost/shared_ptr.hpp>
+
+FORWARD_DECLARE_INTERFACE(awt,XControl)
+FORWARD_DECLARE_INTERFACE(awt,XControlContainer)
+namespace dbaui
+{
+ class IController;
+}
+namespace rptui
+{
+ class OObjectBase;
+
+ enum Action
+ {
+ Inserted = 1,
+ Removed = 2
+ };
+
+ /** Helper class to allow std::mem_fun for SAL_CALL
+ */
+ class REPORTDESIGN_DLLPUBLIC OGroupHelper
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > m_xGroup;
+ OGroupHelper(const OGroupHelper&);
+ OGroupHelper& operator=(const OGroupHelper&);
+ public:
+ OGroupHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup)
+ :m_xGroup(_xGroup)
+ {
+ }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getHeader() { return m_xGroup->getHeader(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getFooter() { return m_xGroup->getFooter(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > getGroup() { return m_xGroup; }
+
+ inline ::sal_Bool getHeaderOn() { return m_xGroup->getHeaderOn(); }
+ inline ::sal_Bool getFooterOn() { return m_xGroup->getFooterOn(); }
+
+ static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+
+ };
+ typedef com::sun::star::uno::Reference< ::com::sun::star::report::XSection > TSection;
+
+ /** Helper class to allow std::mem_fun for SAL_CALL
+ */
+ class REPORTDESIGN_DLLPUBLIC OReportHelper
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReport;
+ public:
+ OReportHelper(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport)
+ :m_xReport(_xReport)
+ {
+ }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getReportHeader() { return m_xReport->getReportHeader(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getReportFooter() { return m_xReport->getReportFooter(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getPageHeader() { return m_xReport->getPageHeader(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getPageFooter() { return m_xReport->getPageFooter(); }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getDetail() { return m_xReport->getDetail(); }
+
+ static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ };
+
+ class REPORTDESIGN_DLLPUBLIC OCommentUndoAction : public SdrUndoAction
+ {
+ protected:
+ String m_strComment; // undo, redo comment
+ ::dbaui::IController* m_pController;
+
+ public:
+ TYPEINFO();
+ OCommentUndoAction( SdrModel& rMod
+ ,USHORT nCommentID);
+
+ virtual UniString GetComment() const { return m_strComment; }
+ virtual void Undo();
+ virtual void Redo();
+ };
+ //==================================================================
+ // OUndoContainerAction
+ //==================================================================
+ class REPORTDESIGN_DLLPUBLIC OUndoContainerAction: public OCommentUndoAction
+ {
+ OUndoContainerAction(OUndoContainerAction&);
+ void operator =(OUndoContainerAction&);
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ m_xElement; // object not owned by the action
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ m_xOwnElement; // object owned by the action
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
+ m_xContainer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ m_xSection;
+ Action m_eAction;
+
+ public:
+ OUndoContainerAction(SdrModel& rMod
+ ,Action _eAction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > _xContainer
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
+ ,USHORT _nCommentId);
+ virtual ~OUndoContainerAction();
+
+ virtual void Undo();
+ virtual void Redo();
+
+ protected:
+ virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ };
+
+ //==================================================================
+ // OUndoReportSectionAction
+ //==================================================================
+ class REPORTDESIGN_DLLPUBLIC OUndoReportSectionAction : public OUndoContainerAction
+ {
+ OReportHelper m_aReportHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> m_pMemberFunction;
+ public:
+ OUndoReportSectionAction(SdrModel& rMod
+ ,Action _eAction
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
+ ,USHORT _nCommentId);
+
+ protected:
+ virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ };
+
+ //==================================================================
+ // OUndoGroupSectionAction
+ //==================================================================
+ class REPORTDESIGN_DLLPUBLIC OUndoGroupSectionAction : public OUndoContainerAction
+ {
+ OGroupHelper m_aGroupHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> m_pMemberFunction;
+ public:
+ OUndoGroupSectionAction(SdrModel& rMod
+ ,Action _eAction
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem
+ ,USHORT _nCommentId);
+
+ protected:
+ virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ virtual void implReRemove( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) );
+ };
+
+ ///==================================================================
+ /// ORptUndoPropertyAction
+ ///==================================================================
+ class REPORTDESIGN_DLLPUBLIC ORptUndoPropertyAction: public OCommentUndoAction
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xObj;
+ ::rtl::OUString m_aPropertyName;
+ ::com::sun::star::uno::Any m_aNewValue;
+ ::com::sun::star::uno::Any m_aOldValue;
+
+ /** sets either the old value or the new value again at the property set.
+ *
+ * \param _bOld If set to <TRUE/> than the old value will be set otherwise the new value will be set.
+ */
+ void setProperty(sal_Bool _bOld);
+ protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
+
+ public:
+ ORptUndoPropertyAction(SdrModel& rMod, const ::com::sun::star::beans::PropertyChangeEvent& evt);
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual String GetComment() const;
+ };
+
+ //==================================================================
+ // OUndoPropertyReportSectionAction
+ //==================================================================
+ class REPORTDESIGN_DLLPUBLIC OUndoPropertyReportSectionAction : public ORptUndoPropertyAction
+ {
+ OReportHelper m_aReportHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> m_pMemberFunction;
+ protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
+ public:
+ OUndoPropertyReportSectionAction(SdrModel& rMod
+ ,const ::com::sun::star::beans::PropertyChangeEvent& evt
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
+ );
+ };
+
+ //==================================================================
+ // OUndoPropertyGroupSectionAction
+ //==================================================================
+ class REPORTDESIGN_DLLPUBLIC OUndoPropertyGroupSectionAction : public ORptUndoPropertyAction
+ {
+ OGroupHelper m_aGroupHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> m_pMemberFunction;
+ protected:
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getObject();
+ public:
+ OUndoPropertyGroupSectionAction(SdrModel& rMod
+ ,const ::com::sun::star::beans::PropertyChangeEvent& evt
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
+ );
+ };
+
+}
+#endif //RPTUI_UNDOACTIONS_HXX
+
diff --git a/reportdesign/inc/UndoEnv.hxx b/reportdesign/inc/UndoEnv.hxx
new file mode 100644
index 000000000000..ac19c70d0ff7
--- /dev/null
+++ b/reportdesign/inc/UndoEnv.hxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UndoEnv.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_UNDOENV_HXX
+#define INCLUDED_UNDOENV_HXX
+
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <memory>
+namespace rptui
+{
+ class OXUndoEnvironmentImpl;
+
+ //========================================================================
+ class REPORTDESIGN_DLLPUBLIC OXUndoEnvironment
+ : public ::cppu::WeakImplHelper3< ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XModifyListener
+ >
+ , public SfxListener
+ {
+ const ::std::auto_ptr<OXUndoEnvironmentImpl> m_pImpl;
+
+ OXUndoEnvironment(const OXUndoEnvironment&);
+ OXUndoEnvironment& operator=(const OXUndoEnvironment&);
+
+ protected:
+ virtual ~OXUndoEnvironment();
+
+ public:
+ OXUndoEnvironment(OReportModel& _rModel);
+
+ class OUndoEnvLock
+ {
+ OXUndoEnvironment& m_rUndoEnv;
+ public:
+ OUndoEnvLock(OXUndoEnvironment& _rUndoEnv): m_rUndoEnv(_rUndoEnv){m_rUndoEnv.Lock();}
+ ~OUndoEnvLock(){ m_rUndoEnv.UnLock(); }
+ };
+
+ void Lock();
+ void UnLock();
+ sal_Bool IsLocked() const;
+
+ // access control
+ struct Accessor { friend class OReportModel; private: Accessor() { } };
+ void Clear(const Accessor& _r);
+
+ void AddElement(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
+ void RemoveElement(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
+
+ void AddSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection);
+ void RemoveSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection );
+ /** removes the section from the page out of the undo env
+ *
+ * \param _pPage
+ */
+ void RemoveSection(OReportPage* _pPage);
+
+ // readonly-ness
+ void SetReadOnly( sal_Bool bRead, const Accessor& );
+ sal_Bool IsReadOnly() const;
+
+ protected:
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
+
+ // XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+ void ModeChanged();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ private:
+ void TogglePropertyListening(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
+
+ void implSetModified();
+
+ void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer, bool _bStartListening ) SAL_THROW(());
+ void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxObject, bool _bStartListening ) SAL_THROW(());
+
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild> >::const_iterator
+ getSection(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild>& _xContainer) const;
+ };
+
+}
+#endif //
+
diff --git a/reportdesign/inc/dllapi.h b/reportdesign/inc/dllapi.h
new file mode 100644
index 000000000000..cb4a5bab1dcd
--- /dev/null
+++ b/reportdesign/inc/dllapi.h
@@ -0,0 +1,51 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dllapi.h,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_DLLAPI_H
+#define INCLUDED_DLLAPI_H
+
+#ifndef _SAL_TYPES_H_
+#include "sal/types.h"
+#endif
+
+#if defined(REPORTDESIGN_DLLIMPLEMENTATION)
+#define REPORTDESIGN_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define REPORTDESIGN_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define REPORTDESIGN_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_DLLAPI_H */
+
diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc
new file mode 100644
index 000000000000..f127a4eacd0a
--- /dev/null
+++ b/reportdesign/inc/helpids.hrc
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: helpids.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#define RTPUI_REPORTDESIGN_HELPID_HRC
+
+#ifndef _SOLAR_HRC
+#include <svtools/solar.hrc> // HID_DBACCESS_START
+#endif
+
+#define UID_RPT_APP_VIEW (HID_RPT_START + 0)
+#define UID_SCROLLWINDOW (HID_RPT_START + 1)
+#define UID_REPORTWINDOW (HID_RPT_START + 2)
+#define HID_HORZ_RULER (HID_RPT_START + 3)
+#define UID_SECTIONSWINDOW (HID_RPT_START + 4)
+#define UID_VIEWSWINDOW (HID_RPT_START + 5)
+#define HID_ENDMARKER (HID_RPT_START + 6)
+#define HID_SPLITTER (HID_RPT_START + 7)
+#define HID_REPORTSECTION (HID_RPT_START + 8)
+#define HID_HORZ_SCROLLBAR (HID_RPT_START + 9)
+#define HID_VERT_SCROLLBAR (HID_RPT_START + 10)
+#define HID_STARTMARKER (HID_RPT_START + 11)
+#define HID_FIELDEXPRESSION (HID_RPT_START + 12)
+#define HID_SORTORDER (HID_RPT_START + 13)
+#define HID_GROUPSBRW (HID_RPT_START + 14)
+#define HID_GROUPSSORTING_DLG (HID_RPT_START + 15)
+#define HID_PAGENUMBERS_DLG (HID_RPT_START + 16)
+#define HID_DATETIME_DLG (HID_RPT_START + 17)
+#define HID_CONDFORMAT_DLG (HID_RPT_START + 18)
+#define HID_CONDFORMAT_TB (HID_RPT_START + 19)
+#define HID_CRTL_FORMAT_PREVIEW (HID_RPT_START + 20)
+#define HID_COND_DLG (HID_RPT_START + 21)
+#define HID_RPT_POPUP_COLOR_CTRL (HID_RPT_START + 22)
+#define HID_RPT_POPUP_COLOR (HID_RPT_START + 23)
+#define HID_FIELD_SEL (HID_RPT_START + 24)
+#define HID_FIELD_SEL_WIN (HID_RPT_START + 25)
+#define HID_PROPDLG_TAB_GENERAL (HID_RPT_START + 26)
+#define HID_PROPDLG_TAB_DATA (HID_RPT_START + 27)
+
+#define HID_PROP_FORCENEWPAGE (HID_RPT_START + 28)
+#define HID_PROP_NEWROWORCOL (HID_RPT_START + 29)
+#define HID_PROP_KEEPTOGETHER (HID_RPT_START + 30)
+#define HID_PROP_CANGROW (HID_RPT_START + 31)
+#define HID_PROP_CANSHRINK (HID_RPT_START + 32)
+#define HID_PROP_REPEATSECTION (HID_RPT_START + 33)
+// free
+// free
+// free
+// free
+// free
+// free
+// free
+// free
+// free
+// free
+#define HID_PROP_PRINTREPEATEDVALUES (HID_RPT_START + 44)
+#define HID_PROP_CONDITIONALPRINTEXPRESSION (HID_RPT_START + 45)
+// free
+#define HID_PROP_STARTNEWCOLUMN (HID_RPT_START + 47)
+#define HID_PROP_STARTNEWPAGE (HID_RPT_START + 48)
+#define HID_PROP_RESETPAGENUMBER (HID_RPT_START + 49)
+// free
+#define HID_PROP_MINHEIGHTNEWPAGE (HID_RPT_START + 51)
+#define HID_PROP_PRINTWHENGROUPCHANGE (HID_RPT_START + 52)
+// free
+// free
+#define HID_PROP_VISIBLE (HID_RPT_START + 55)
+#define HID_PROP_GROUPKEEPTOGETHER (HID_RPT_START + 56)
+#define HID_PROP_PAGEHEADEROPTION (HID_RPT_START + 57)
+#define HID_PROP_PAGEFOOTEROPTION (HID_RPT_START + 58)
+#define UID_PROP_DLG_LINE_STYLE (HID_RPT_START + 59)
+// free
+#define HID_PROP_DATAFIELD (HID_RPT_START + 61)
+#define HID_PROP_BACKCOLOR (HID_RPT_START + 62)
+#define HID_PROP_RPT_POSITIONX (HID_RPT_START + 63)
+#define HID_PROP_RPT_POSITIONY (HID_RPT_START + 64)
+#define HID_PROP_RPT_WIDTH (HID_RPT_START + 65)
+#define HID_PROP_RPT_HEIGHT (HID_RPT_START + 66)
+#define HID_START_TITLE (HID_RPT_START + 67)
+#define HID_START_IMAGE (HID_RPT_START + 68)
+#define HID_PROP_DEEPTRAVERSING (HID_RPT_START + 69)
+#define HID_PROP_PREEVALUATED (HID_RPT_START + 70)
+#define HID_NAVIGATOR_DLG (HID_RPT_START + 71)
+#define HID_REPORT_NAVIGATOR_TREE (HID_RPT_START + 72)
+#define HID_PROP_FORMULA (HID_RPT_START + 73)
+#define HID_PROP_INITIALFORMULA (HID_RPT_START + 74)
+#define HID_PROP_RPT_FONT (HID_RPT_START + 75)
+#define UID_RPT_PROP_DLG_FONT_TYPE (HID_RPT_START + 76)
+#define HID_PROP_PRESERVEIRI (HID_RPT_START + 77)
+#define HID_PROP_BACKTRANSPARENT (HID_RPT_START + 78)
+#define HID_PROP_CONTROLBACKGROUNDTRANSPARENT (HID_RPT_START + 79)
+
+
+#if HID_PROP_CONTROLBACKGROUNDTRANSPARENT > HID_RPT_END
+#error Help-Id Ueberlauf in #file, #line
+#endif
+// don't forget to update the file util/hidother.src
+
+#endif //RTPUI_REPORTDESIGN_HELPID_HRC
+
diff --git a/reportdesign/inc/makefile.mk b/reportdesign/inc/makefile.mk
new file mode 100644
index 000000000000..bbf03b214c37
--- /dev/null
+++ b/reportdesign/inc/makefile.mk
@@ -0,0 +1,55 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+PRJ=..
+
+PRJNAME=reportdesign
+TARGET=inc
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+.IF "$(ENABLE_PCH)"!=""
+ALLTAR : \
+ $(SLO)$/precompiled.pch \
+ $(SLO)$/precompiled_ex.pch
+
+.ENDIF # "$(ENABLE_PCH)"!=""
+
diff --git a/reportdesign/inc/pch/precompiled_reportdesign.cxx b/reportdesign/inc/pch/precompiled_reportdesign.cxx
new file mode 100644
index 000000000000..c52e718941b1
--- /dev/null
+++ b/reportdesign/inc/pch/precompiled_reportdesign.cxx
@@ -0,0 +1,37 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: precompiled_reportdesign.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "precompiled_reportdesign.hxx"
+
diff --git a/reportdesign/inc/pch/precompiled_reportdesign.hxx b/reportdesign/inc/pch/precompiled_reportdesign.hxx
new file mode 100644
index 000000000000..e1fbaa98f84d
--- /dev/null
+++ b/reportdesign/inc/pch/precompiled_reportdesign.hxx
@@ -0,0 +1,40 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: precompiled_reportdesign.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:38.561560
+
+#ifdef PRECOMPILED_HEADERS
+#endif
+
diff --git a/reportdesign/inc/rptui_slotid.hrc b/reportdesign/inc/rptui_slotid.hrc
new file mode 100644
index 000000000000..c84a90035dcf
--- /dev/null
+++ b/reportdesign/inc/rptui_slotid.hrc
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: rptui_slotid.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:02 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _RPTUI_SLOTID_HRC_
+#define _RPTUI_SLOTID_HRC_
+
+#include <svx/svxids.hrc>
+
+#define SID_PAGEHEADERFOOTER ( SID_RPTUI_START + 0 )
+#define SID_REPORTHEADERFOOTER ( SID_RPTUI_START + 1 )
+#define SID_SORTINGANDGROUPING ( SID_RPTUI_START + 2 )
+#define SID_INSERT_FLD_PGNUMBER ( SID_RPTUI_START + 3 )
+#define SID_CONDITIONALFORMATTING ( SID_RPTUI_START + 4 )
+#define SID_PAGEDIALOG ( SID_RPTUI_START + 5 )
+#define SID_SETCONTROLDEFAULTS ( SID_RPTUI_START + 6 )
+#define SID_INSERTBREAK ( SID_RPTUI_START + 7 )
+#define SID_PAGEHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 8 )
+#define SID_PAGEFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 9 )
+#define SID_REPORTHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 10 )
+#define SID_REPORTFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 11 )
+#define SID_SELECT_REPORT ( SID_RPTUI_START + 12 )
+#define SID_GROUPHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 13 )
+#define SID_GROUPHEADER ( SID_RPTUI_START + 14 )
+#define SID_GROUPFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 15 )
+#define SID_GROUPFOOTER ( SID_RPTUI_START + 16 )
+#define SID_GROUP_REMOVE ( SID_RPTUI_START + 17 )
+#define SID_GROUP_APPEND ( SID_RPTUI_START + 18 )
+#define SID_EXECUTE_REPORT ( SID_RPTUI_START + 19 )
+#define SID_DATETIME ( SID_RPTUI_START + 20 )
+#define SID_ESCAPE ( SID_RPTUI_START + 21 )
+#define SID_ADD_CONTROL_PAIR ( SID_RPTUI_START + 22 )
+#define SID_SPLIT_POSITION ( SID_RPTUI_START + 23 )
+#define SID_PROPERTYBROWSER_LAST_PAGE ( SID_RPTUI_START + 24 )
+// free
+
+#define SID_DRAWTBX_CS_BASIC1 ( SID_RPTUI_START + 26 )
+#define SID_DRAWTBX_CS_BASIC2 ( SID_RPTUI_START + 27 )
+#define SID_DRAWTBX_CS_BASIC3 ( SID_RPTUI_START + 28 )
+#define SID_DRAWTBX_CS_BASIC4 ( SID_RPTUI_START + 29 )
+#define SID_DRAWTBX_CS_BASIC5 ( SID_RPTUI_START + 30 )
+#define SID_DRAWTBX_CS_BASIC6 ( SID_RPTUI_START + 31 )
+#define SID_DRAWTBX_CS_BASIC7 ( SID_RPTUI_START + 32 )
+#define SID_DRAWTBX_CS_BASIC8 ( SID_RPTUI_START + 33 )
+#define SID_DRAWTBX_CS_BASIC9 ( SID_RPTUI_START + 34 )
+#define SID_DRAWTBX_CS_BASIC10 ( SID_RPTUI_START + 35 )
+#define SID_DRAWTBX_CS_BASIC11 ( SID_RPTUI_START + 36 )
+#define SID_DRAWTBX_CS_BASIC12 ( SID_RPTUI_START + 37 )
+#define SID_DRAWTBX_CS_BASIC13 ( SID_RPTUI_START + 38 )
+#define SID_DRAWTBX_CS_BASIC14 ( SID_RPTUI_START + 39 )
+#define SID_DRAWTBX_CS_BASIC15 ( SID_RPTUI_START + 40 )
+#define SID_DRAWTBX_CS_BASIC16 ( SID_RPTUI_START + 41 )
+#define SID_DRAWTBX_CS_BASIC17 ( SID_RPTUI_START + 42 )
+#define SID_DRAWTBX_CS_BASIC18 ( SID_RPTUI_START + 43 )
+#define SID_DRAWTBX_CS_BASIC19 ( SID_RPTUI_START + 44 )
+#define SID_DRAWTBX_CS_BASIC20 ( SID_RPTUI_START + 45 )
+#define SID_DRAWTBX_CS_BASIC21 ( SID_RPTUI_START + 46 )
+#define SID_DRAWTBX_CS_BASIC22 ( SID_RPTUI_START + 47 )
+#define SID_DRAWTBX_CS_SYMBOL1 ( SID_RPTUI_START + 48 )
+#define SID_DRAWTBX_CS_SYMBOL2 ( SID_RPTUI_START + 49 )
+#define SID_DRAWTBX_CS_SYMBOL3 ( SID_RPTUI_START + 50 )
+#define SID_DRAWTBX_CS_SYMBOL4 ( SID_RPTUI_START + 51 )
+#define SID_DRAWTBX_CS_SYMBOL5 ( SID_RPTUI_START + 52 )
+#define SID_DRAWTBX_CS_SYMBOL6 ( SID_RPTUI_START + 53 )
+#define SID_DRAWTBX_CS_SYMBOL7 ( SID_RPTUI_START + 54 )
+#define SID_DRAWTBX_CS_SYMBOL8 ( SID_RPTUI_START + 55 )
+#define SID_DRAWTBX_CS_SYMBOL9 ( SID_RPTUI_START + 56 )
+#define SID_DRAWTBX_CS_SYMBOL10 ( SID_RPTUI_START + 57 )
+#define SID_DRAWTBX_CS_SYMBOL11 ( SID_RPTUI_START + 58 )
+#define SID_DRAWTBX_CS_SYMBOL12 ( SID_RPTUI_START + 59 )
+#define SID_DRAWTBX_CS_SYMBOL13 ( SID_RPTUI_START + 60 )
+#define SID_DRAWTBX_CS_SYMBOL14 ( SID_RPTUI_START + 61 )
+#define SID_DRAWTBX_CS_SYMBOL15 ( SID_RPTUI_START + 62 )
+#define SID_DRAWTBX_CS_SYMBOL16 ( SID_RPTUI_START + 63 )
+#define SID_DRAWTBX_CS_SYMBOL17 ( SID_RPTUI_START + 64 )
+#define SID_DRAWTBX_CS_SYMBOL18 ( SID_RPTUI_START + 65 )
+#define SID_DRAWTBX_CS_ARROW1 ( SID_RPTUI_START + 66 )
+#define SID_DRAWTBX_CS_ARROW2 ( SID_RPTUI_START + 67 )
+#define SID_DRAWTBX_CS_ARROW3 ( SID_RPTUI_START + 68 )
+#define SID_DRAWTBX_CS_ARROW4 ( SID_RPTUI_START + 69 )
+#define SID_DRAWTBX_CS_ARROW5 ( SID_RPTUI_START + 70 )
+#define SID_DRAWTBX_CS_ARROW6 ( SID_RPTUI_START + 71 )
+#define SID_DRAWTBX_CS_ARROW7 ( SID_RPTUI_START + 72 )
+#define SID_DRAWTBX_CS_ARROW8 ( SID_RPTUI_START + 73 )
+#define SID_DRAWTBX_CS_ARROW9 ( SID_RPTUI_START + 74 )
+#define SID_DRAWTBX_CS_ARROW10 ( SID_RPTUI_START + 75 )
+#define SID_DRAWTBX_CS_ARROW11 ( SID_RPTUI_START + 76 )
+#define SID_DRAWTBX_CS_ARROW12 ( SID_RPTUI_START + 77 )
+#define SID_DRAWTBX_CS_ARROW13 ( SID_RPTUI_START + 78 )
+#define SID_DRAWTBX_CS_ARROW14 ( SID_RPTUI_START + 79 )
+#define SID_DRAWTBX_CS_ARROW15 ( SID_RPTUI_START + 80 )
+#define SID_DRAWTBX_CS_ARROW16 ( SID_RPTUI_START + 81 )
+#define SID_DRAWTBX_CS_ARROW17 ( SID_RPTUI_START + 82 )
+#define SID_DRAWTBX_CS_ARROW18 ( SID_RPTUI_START + 83 )
+#define SID_DRAWTBX_CS_ARROW19 ( SID_RPTUI_START + 84 )
+#define SID_DRAWTBX_CS_ARROW20 ( SID_RPTUI_START + 85 )
+#define SID_DRAWTBX_CS_ARROW21 ( SID_RPTUI_START + 86 )
+#define SID_DRAWTBX_CS_ARROW22 ( SID_RPTUI_START + 87 )
+#define SID_DRAWTBX_CS_ARROW23 ( SID_RPTUI_START + 88 )
+#define SID_DRAWTBX_CS_ARROW24 ( SID_RPTUI_START + 89 )
+#define SID_DRAWTBX_CS_ARROW25 ( SID_RPTUI_START + 90 )
+#define SID_DRAWTBX_CS_ARROW26 ( SID_RPTUI_START + 91 )
+#define SID_DRAWTBX_CS_STAR1 ( SID_RPTUI_START + 92 )
+#define SID_DRAWTBX_CS_STAR2 ( SID_RPTUI_START + 93 )
+#define SID_DRAWTBX_CS_STAR3 ( SID_RPTUI_START + 94 )
+#define SID_DRAWTBX_CS_STAR4 ( SID_RPTUI_START + 95 )
+#define SID_DRAWTBX_CS_STAR5 ( SID_RPTUI_START + 96 )
+#define SID_DRAWTBX_CS_STAR6 ( SID_RPTUI_START + 97 )
+#define SID_DRAWTBX_CS_STAR7 ( SID_RPTUI_START + 98 )
+#define SID_DRAWTBX_CS_STAR8 ( SID_RPTUI_START + 99 )
+#define SID_DRAWTBX_CS_STAR9 ( SID_RPTUI_START + 100 )
+#define SID_DRAWTBX_CS_STAR10 ( SID_RPTUI_START + 101 )
+#define SID_DRAWTBX_CS_STAR11 ( SID_RPTUI_START + 102 )
+#define SID_DRAWTBX_CS_STAR12 ( SID_RPTUI_START + 103 )
+#define SID_DRAWTBX_CS_FLOWCHART1 ( SID_RPTUI_START + 104 )
+#define SID_DRAWTBX_CS_FLOWCHART2 ( SID_RPTUI_START + 105 )
+#define SID_DRAWTBX_CS_FLOWCHART3 ( SID_RPTUI_START + 106 )
+#define SID_DRAWTBX_CS_FLOWCHART4 ( SID_RPTUI_START + 107 )
+#define SID_DRAWTBX_CS_FLOWCHART5 ( SID_RPTUI_START + 108 )
+#define SID_DRAWTBX_CS_FLOWCHART6 ( SID_RPTUI_START + 109 )
+#define SID_DRAWTBX_CS_FLOWCHART7 ( SID_RPTUI_START + 110 )
+#define SID_DRAWTBX_CS_FLOWCHART8 ( SID_RPTUI_START + 111 )
+#define SID_DRAWTBX_CS_FLOWCHART9 ( SID_RPTUI_START + 112 )
+#define SID_DRAWTBX_CS_FLOWCHART10 ( SID_RPTUI_START + 113 )
+#define SID_DRAWTBX_CS_FLOWCHART11 ( SID_RPTUI_START + 114 )
+#define SID_DRAWTBX_CS_FLOWCHART12 ( SID_RPTUI_START + 115 )
+#define SID_DRAWTBX_CS_FLOWCHART13 ( SID_RPTUI_START + 116 )
+#define SID_DRAWTBX_CS_FLOWCHART14 ( SID_RPTUI_START + 117 )
+#define SID_DRAWTBX_CS_FLOWCHART15 ( SID_RPTUI_START + 118 )
+#define SID_DRAWTBX_CS_FLOWCHART16 ( SID_RPTUI_START + 119 )
+#define SID_DRAWTBX_CS_FLOWCHART17 ( SID_RPTUI_START + 120 )
+#define SID_DRAWTBX_CS_FLOWCHART18 ( SID_RPTUI_START + 121 )
+#define SID_DRAWTBX_CS_FLOWCHART19 ( SID_RPTUI_START + 122 )
+#define SID_DRAWTBX_CS_FLOWCHART20 ( SID_RPTUI_START + 123 )
+#define SID_DRAWTBX_CS_FLOWCHART21 ( SID_RPTUI_START + 124 )
+#define SID_DRAWTBX_CS_FLOWCHART22 ( SID_RPTUI_START + 125 )
+#define SID_DRAWTBX_CS_FLOWCHART23 ( SID_RPTUI_START + 126 )
+#define SID_DRAWTBX_CS_FLOWCHART24 ( SID_RPTUI_START + 127 )
+#define SID_DRAWTBX_CS_FLOWCHART25 ( SID_RPTUI_START + 128 )
+#define SID_DRAWTBX_CS_FLOWCHART26 ( SID_RPTUI_START + 129 )
+#define SID_DRAWTBX_CS_FLOWCHART27 ( SID_RPTUI_START + 130 )
+#define SID_DRAWTBX_CS_FLOWCHART28 ( SID_RPTUI_START + 131 )
+#define SID_DRAWTBX_CS_CALLOUT1 ( SID_RPTUI_START + 132 )
+#define SID_DRAWTBX_CS_CALLOUT2 ( SID_RPTUI_START + 133 )
+#define SID_DRAWTBX_CS_CALLOUT3 ( SID_RPTUI_START + 134 )
+#define SID_DRAWTBX_CS_CALLOUT4 ( SID_RPTUI_START + 135 )
+#define SID_DRAWTBX_CS_CALLOUT5 ( SID_RPTUI_START + 136 )
+#define SID_DRAWTBX_CS_CALLOUT6 ( SID_RPTUI_START + 137 )
+#define SID_DRAWTBX_CS_CALLOUT7 ( SID_RPTUI_START + 138 )
+
+#define SID_RPT_TEXTDOCUMENT ( SID_RPTUI_START + 139 )
+#define SID_RPT_SPREADSHEET ( SID_RPTUI_START + 140 )
+#define SID_RPT_SHOWREPORTEXPLORER ( SID_RPTUI_START + 141 )
+#define SID_RPT_NEW_FUNCTION ( SID_RPTUI_START + 142 )
+
+#define SID_OBJECT_SMALLESTWIDTH ( SID_RPTUI_START + 143 )
+#define SID_OBJECT_SMALLESTHEIGHT ( SID_RPTUI_START + 144 )
+#define SID_OBJECT_GREATESTWIDTH ( SID_RPTUI_START + 145 )
+#define SID_OBJECT_GREATESTHEIGHT ( SID_RPTUI_START + 146 )
+#define SID_OBJECT_RESIZING ( SID_RPTUI_START + 147 )
+#define SID_ARRANGEMENU ( SID_RPTUI_START + 148 )
+#define SID_SELECTALL_IN_SECTION ( SID_RPTUI_START + 149 )
+
+#define SID_ICON_GROUP ( SID_RPTUI_START + 150 )
+#define SID_ICON_DETAIL ( SID_RPTUI_START + 151 )
+
+#define SID_SECTION_ALIGN ( SID_RPTUI_START + 152 )
+#define SID_SECTION_ALIGN_LEFT ( SID_RPTUI_START + 153 )
+#define SID_SECTION_ALIGN_CENTER ( SID_RPTUI_START + 154 )
+#define SID_SECTION_ALIGN_RIGHT ( SID_RPTUI_START + 155 )
+#define SID_SECTION_ALIGN_UP ( SID_RPTUI_START + 156 )
+#define SID_SECTION_ALIGN_MIDDLE ( SID_RPTUI_START + 157 )
+#define SID_SECTION_ALIGN_DOWN ( SID_RPTUI_START + 158 )
+
+#define SID_NEXT_MARK ( SID_RPTUI_START + 159 )
+#define SID_PREV_MARK ( SID_RPTUI_START + 160 )
+
+
+#endif // _RPTUI_SLOTID_HRC_
diff --git a/reportdesign/java/com/sun/star/report/DataRow.java b/reportdesign/java/com/sun/star/report/DataRow.java
new file mode 100644
index 000000000000..ad73575610f6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/DataRow.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataRow.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+/**
+ * This feeds data into the reporting engine, in case the data has been provided
+ * by the caller. The methods are a mix of TableModel methods and methods borrowed
+ * from the java.sql.ResultSet interface.
+ *
+ * The column and row index starts at 1 (as it is done in JDBC).
+ *
+ * @author Thomas Morgner
+ */
+public interface DataRow
+{
+ public int getColumnCount() throws DataSourceException;
+ public String getColumnName(int column) throws DataSourceException;
+ public Object getObject (int column) throws DataSourceException;
+}
diff --git a/reportdesign/java/com/sun/star/report/DataSource.java b/reportdesign/java/com/sun/star/report/DataSource.java
new file mode 100644
index 000000000000..53e2dc0cdffb
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/DataSource.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataSource.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+/**
+ * This feeds data into the reporting engine, in case the data has been provided
+ * by the caller. The methods are a mix of TableModel methods and methods borrowed
+ * from the java.sql.ResultSet interface.
+ *
+ * The column and row index starts at 1 (as it is done in JDBC).
+ *
+ * @author Thomas Morgner
+ */
+public interface DataSource extends DataRow
+{
+ public int getRowCount() throws DataSourceException;
+ public boolean absolute (int row) throws DataSourceException;
+ public boolean next() throws DataSourceException;
+ public void close() throws DataSourceException;
+}
diff --git a/reportdesign/java/com/sun/star/report/DataSourceException.java b/reportdesign/java/com/sun/star/report/DataSourceException.java
new file mode 100644
index 000000000000..b54b7a073a87
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/DataSourceException.java
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataSourceException.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.security.PrivilegedActionException;
+
+/**
+ * A general exception to indicate that there was an error while accessing the
+ * datasource.
+ *
+ * @author Thomas Morgner
+ */
+public class DataSourceException extends Exception
+{
+ /**
+ * Constructs a new exception with <code>null</code> as its detail message.
+ * The cause is not initialized, and may subsequently be initialized by a call
+ * to {@link #initCause}.
+ */
+ public DataSourceException()
+ {
+ super();
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message. The cause is
+ * not initialized, and may subsequently be initialized by a call to {@link
+ * #initCause}.
+ *
+ * @param message the detail message. The detail message is saved for later
+ * retrieval by the {@link #getMessage()} method.
+ */
+ public DataSourceException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ * <p>Note that the detail message associated with <code>cause</code> is
+ * <i>not</i> automatically incorporated in this exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval by
+ * the {@link #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the {@link
+ * #getCause()} method). (A <tt>null</tt> value is permitted,
+ * and indicates that the cause is nonexistent or unknown.)
+ * @since 1.4
+ */
+ public DataSourceException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail message of
+ * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains
+ * the class and detail message of <tt>cause</tt>). This constructor is useful
+ * for exceptions that are little more than wrappers for other throwables (for
+ * example, {@link PrivilegedActionException}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the {@link
+ * #getCause()} method). (A <tt>null</tt> value is permitted,
+ * and indicates that the cause is nonexistent or unknown.)
+ * @since 1.4
+ */
+ public DataSourceException(Throwable cause)
+ {
+ super(cause);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/DataSourceFactory.java b/reportdesign/java/com/sun/star/report/DataSourceFactory.java
new file mode 100644
index 000000000000..6ac0516ce407
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/DataSourceFactory.java
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataSourceFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.util.Map;
+
+/**
+ * Allows to query the data repository and returns a datasource for the
+ * specified name and parameters. The parameters-map can be null, if there
+ * are no parameters required.
+ *
+ * @author Thomas Morgner
+ */
+public interface DataSourceFactory
+{
+ public DataSource queryData(String name, Map parameter)
+ throws DataSourceException;
+}
diff --git a/reportdesign/java/com/sun/star/report/ImageService.java b/reportdesign/java/com/sun/star/report/ImageService.java
new file mode 100644
index 000000000000..28e84d5bff2e
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ImageService.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageService.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.io.InputStream;
+import java.awt.Dimension;
+
+/**
+ *
+ * @author oj93728
+ */
+public interface ImageService {
+
+ /**
+ * @return the mime-type of the image as string.
+ */
+ public String getMimeType(final InputStream image) throws ReportExecutionException;
+
+ /**
+ * @return the mime-type of the image as string.
+ */
+ public String getMimeType(final byte[] image) throws ReportExecutionException;
+
+ /**
+ * @returns the dimension in 100th mm.
+ **/
+ public Dimension getImageSize(final InputStream image) throws ReportExecutionException;
+
+ /**
+ * @returns the dimension in 100th mm.
+ **/
+ public Dimension getImageSize(final byte[] image) throws ReportExecutionException;
+}
+
diff --git a/reportdesign/java/com/sun/star/report/InputRepository.java b/reportdesign/java/com/sun/star/report/InputRepository.java
new file mode 100644
index 000000000000..c799d17c6b37
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/InputRepository.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: InputRepository.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * This allows the job processor to load data from a repository. It is assumed,
+ * that all resource names are given as strings and furthermore, that the names
+ * identify a resource uniquely within the input repository.
+ *
+ * An input repository connects the report processing to the xml definitions.
+ * Unless defined otherwise, it is assumed, that the input-name is 'content.xml';
+ * possible other files are 'settings.xml' and 'styles.xml' (see the Oasis standard
+ * for details on these files and their contents).
+ *
+ * @author Thomas Morgner
+ */
+public interface InputRepository
+{
+ /**
+ * Returns a unique identifier for this repository. Two repositories accessing
+ * the same location should return the same id. The identifier must never
+ * be null.
+ *
+ * @return the repository id
+ */
+ public Object getId();
+
+ public InputStream createInputStream(String name) throws IOException;
+
+ /**
+ * This returns an version number for the given resource. Return zero, if
+ * the resource is not versionable, else return a unique number for each version.
+ * As rule of thumb: Increase the version number by at least one for each change
+ * made to the resource.
+ *
+ * @param name the name of the resource
+ * @return the version number
+ */
+ public long getVersion (String name);
+
+ public boolean exists (String name);
+
+ public boolean isReadable (String name);
+}
diff --git a/reportdesign/java/com/sun/star/report/JobDefinitionException.java b/reportdesign/java/com/sun/star/report/JobDefinitionException.java
new file mode 100644
index 000000000000..a2d64262bc57
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/JobDefinitionException.java
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: JobDefinitionException.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+/**
+ * Creation-Date: 05.02.2006, 17:36:33
+ *
+ * @author Thomas Morgner
+ */
+public class JobDefinitionException extends RuntimeException
+{
+ /**
+ * Creates a StackableRuntimeException with no message and no parent.
+ */
+ public JobDefinitionException ()
+ {
+ }
+
+ /**
+ * Creates an exception.
+ *
+ * @param message the exception message.
+ */
+ public JobDefinitionException (final String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Creates an exception.
+ *
+ * @param message the exception message.
+ * @param ex the parent exception.
+ */
+ public JobDefinitionException (final String message, final Exception ex)
+ {
+ super(message, ex);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/JobProgressIndicator.java b/reportdesign/java/com/sun/star/report/JobProgressIndicator.java
new file mode 100644
index 000000000000..c52a86f683df
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/JobProgressIndicator.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: JobProgressIndicator.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+/**
+ * Based on
+ * http://api.openoffice.org/docs/common/ref/com/sun/star/task/XStatusIndicator.html
+ *
+ * @author Thomas Morgner
+ */
+public interface JobProgressIndicator
+{
+ /**
+ * Updates the progress description.
+ *
+ * @param string the new description
+ */
+ public void setText(String string);
+
+ /**
+ * Initializes the progress indicator and sets the progress description to
+ * the text given in the parameter <code>text</code>. The progress values
+ * passed to this indicator will not exceed the given <code>maxValue</code>.
+ * The value range of this indicator is set to 0 to <code>maxValue</code>
+ * Stopped indicators must ignore that call.
+ *
+ * @param string the progress description
+ * @param maxValue the maximum value
+ * @see JobProgressIndicator#setText(String)
+ */
+ public void start(String text, int maxValue);
+
+ /**
+ * Updates the value to the specified value. Invalid values must be ignored.
+ * Stopped indicators must ignore that call.
+ *
+ * @param value the new value that should be shown now. This must fit the
+ * range [0..maxValue] as defined in {@link JobProgressIndicator#start(String, int)}.
+ */
+ public void setValue(int value);
+
+ /**
+ * Stop the progress. A progress indicator cannot be destructed before end()
+ * has been called.
+ */
+ public void end();
+
+ /**
+ * Clear progress value and description. Calling of setValue(0) and
+ * setText("") should do the same. Stopped indicators must ignore this call.
+ */
+ public void reset();
+}
diff --git a/reportdesign/java/com/sun/star/report/JobProperties.java b/reportdesign/java/com/sun/star/report/JobProperties.java
new file mode 100644
index 000000000000..ae6f15dd8615
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/JobProperties.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: JobProperties.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+public interface JobProperties
+{
+ public void setProperty (String key, Object value)
+ throws JobDefinitionException;
+ public Object getProperty (String key);
+
+ /**
+ * A type safe clone operation. We derive a copy of all properties,
+ * so that changes to the original job properties collection does not
+ * affect the copy.
+ *
+ * @return a copy.
+ */
+ public JobProperties copy();
+}
diff --git a/reportdesign/java/com/sun/star/report/OutputRepository.java b/reportdesign/java/com/sun/star/report/OutputRepository.java
new file mode 100644
index 000000000000..ad72844c276e
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/OutputRepository.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OutputRepository.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * A repository for writing. Providing a repository always assumes,
+ * that more than one stream can be written.
+ *
+ * @author Thomas Morgner
+ */
+public interface OutputRepository
+{
+ /**
+ * Creates an output stream for writing the data. If there is an entry with
+ * that name already contained in the repository, try to overwrite it.
+ *
+ * @param name
+ * the name of the output stream
+ * @param mimeType
+ * the mime type of the to-be-created output stream. Repository implementations which do not support
+ * associating a mime time with a stream might ignore this parameter.
+ * @return the outputstream
+ * @throws IOException if opening the stream fails
+ */
+ public OutputStream createOutputStream (String name, String mimeType) throws IOException;
+
+ public boolean exists (String name);
+ public boolean isWritable (String name);
+
+}
diff --git a/reportdesign/java/com/sun/star/report/ParameterMap.java b/reportdesign/java/com/sun/star/report/ParameterMap.java
new file mode 100644
index 000000000000..ec8f12cbedc7
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ParameterMap.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ParameterMap.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+public interface ParameterMap
+{
+
+ /**
+ * Adds a property to this properties collection. If a property with the given name
+ * exist, the property will be replaced with the new value. If the value is null, the
+ * property will be removed.
+ *
+ * @param key the property key.
+ * @param value the property value.
+ */
+ public void put (final String key, final Object value);
+
+ /**
+ * Retrieves the value stored for a key in this properties collection.
+ *
+ * @param key the property key.
+ * @return The stored value, or <code>null</code> if the key does not exist in this
+ * collection.
+ */
+ public Object get (final String key);
+
+ /**
+ * Retrieves the value stored for a key in this properties collection, and returning the
+ * default value if the key was not stored in this properties collection.
+ *
+ * @param key the property key.
+ * @param defaultValue the default value to be returned when the key is not stored in
+ * this properties collection.
+ * @return The stored value, or the default value if the key does not exist in this
+ * collection.
+ */
+ public Object get (final String key, final Object defaultValue);
+
+ public String[] keys ();
+
+ public void clear ();
+
+ public int size();
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportAddIn.java b/reportdesign/java/com/sun/star/report/ReportAddIn.java
new file mode 100644
index 000000000000..1604927d67f4
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportAddIn.java
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportAddIn.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+/**
+ * A report add-in defines a set of expressions, which can
+ * be used in the reporting.
+ *
+ * Each expression must provide meta-data to support GUI implementors.
+ * Expressions are assumed to be statefull, if they are not, they are
+ * free to be implemented as stateless expression.
+ */
+public interface ReportAddIn
+{
+ public int getExpressionCount();
+ public ReportExpression createExpression(int expression);
+ public ReportExpressionMetaData getMetaData (int expression);
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportEngine.java b/reportdesign/java/com/sun/star/report/ReportEngine.java
new file mode 100644
index 000000000000..b90b8c7334a0
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportEngine.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportEngine.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+/**
+ * The job factory collects all required properties to build a reportJob
+ * object. Implementors should define a suitable set of properties to allow
+ * the configuration of the created report jobs.
+ *
+ * How these properties are collected is beyond the scope of this interface.
+ * For each type of Job, there should be separate job-factory (remote jobs
+ * vs. local jobs etc).
+ *
+ * @author Thomas Morgner
+ */
+public interface ReportEngine
+{
+ public ReportJobDefinition createJobDefinition();
+
+ public ReportEngineMetaData getMetaData();
+
+ /**
+ * Open points: How to define scheduling?
+ *
+ * @return the report job definition for the job description.
+ * @throws JobDefinitionException
+ */
+ public ReportJob createJob(ReportJobDefinition definition)
+ throws JobDefinitionException;
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java b/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java
new file mode 100644
index 000000000000..7886ba56aadb
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportEngineMetaData.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportEngineMetaData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+public interface ReportEngineMetaData
+{
+ /**
+ * Checks, whether a certain output type is available.
+ * Feed the mime-type of the output type in and you'll get
+ * a true or false back.
+ *
+ * @param mimeType
+ * @return true, if the output type is supported; false otherwise.
+ */
+ public boolean isOutputSupported(String mimeType);
+
+ /**
+ * Lists all supported output parameters for the given mime-type.
+ * This listing can be used to build a generic user interface for
+ * configuring a certain output.
+ *
+ * @param mimeType
+ * @return
+ */
+ public String[] getOutputParameters (String mimeType);
+
+ public Class getParameterType (String parameter);
+
+ public boolean isMandatory(String parameter);
+ public boolean isEnumeration(String parameter);
+ public Object[] getEnumerationValues (String parameter);
+
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java b/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java
new file mode 100644
index 000000000000..3c12ebd3e25b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportEngineParameterNames.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportEngineParameterNames.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+/**
+ * Making this enumeration typesafe and fully defined here would
+ * be nice, wouldn't it?
+ */
+public class ReportEngineParameterNames
+{
+ public static final String CONTENT_TYPE = "content-type";
+ public static final String INPUT_NAME= "input.name";
+ public static final String INPUT_REPOSITORY = "input.repository";
+ public static final String OUTPUT_NAME= "output.name";
+ public static final String OUTPUT_REPOSITORY = "output.repository";
+ public static final String INPUT_DATASOURCE_FACTORY = "input.datasource-factory";
+ public static final String IMAGE_SERVICE = "ImageService";
+ public static final String MIMETYPE = "output.mimetype";
+
+ private ReportEngineParameterNames ()
+ {
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportExecutionException.java b/reportdesign/java/com/sun/star/report/ReportExecutionException.java
new file mode 100644
index 000000000000..a7b40717a2d0
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportExecutionException.java
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportExecutionException.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+public class ReportExecutionException extends Exception
+{
+ /**
+ * Constructs a new exception with <code>null</code> as its detail message. The cause is
+ * not initialized, and may subsequently be initialized by a call to {@link
+ * #initCause}.
+ */
+ public ReportExecutionException ()
+ {
+ }
+
+ /**
+ * Constructs a new exception with the specified cause and a detail message of
+ * <tt>(cause==null ? null : cause.toString())</tt> (which typically contains the class
+ * and detail message of <tt>cause</tt>). This constructor is useful for exceptions that
+ * are little more than wrappers for other throwables (for example, {@link
+ * java.security.PrivilegedActionException}).
+ *
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()}
+ * method). (A <tt>null</tt> value is permitted, and indicates that the
+ * cause is nonexistent or unknown.)
+ * @since 1.4
+ */
+ public ReportExecutionException (Throwable cause)
+ {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message. The cause is not
+ * initialized, and may subsequently be initialized by a call to {@link #initCause}.
+ *
+ * @param message the detail message. The detail message is saved for later retrieval by
+ * the {@link #getMessage()} method.
+ */
+ public ReportExecutionException (String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause. <p>Note that
+ * the detail message associated with <code>cause</code> is <i>not</i> automatically
+ * incorporated in this exception's detail message.
+ *
+ * @param message the detail message (which is saved for later retrieval by the {@link
+ * #getMessage()} method).
+ * @param cause the cause (which is saved for later retrieval by the {@link
+ * #getCause()} method). (A <tt>null</tt> value is permitted, and
+ * indicates that the cause is nonexistent or unknown.)
+ * @since 1.4
+ */
+ public ReportExecutionException (String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportExpression.java b/reportdesign/java/com/sun/star/report/ReportExpression.java
new file mode 100644
index 000000000000..5b28ad035b38
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportExpression.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportExpression.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+/**
+ * Expressions are simple computation components.
+ *
+ * Expressions are always assumed to be immutable. They are not allowed to
+ * change their state and it is not guaranteed, in which order they get called.
+ * If the expression has been called before, the last computed value will be
+ * available from the datarow.
+ *
+ * This construct allows us to write expressions in the form
+ * "Sum := Sum + Column".
+ *
+ * Multiple calls to getValue on the same expression instance must return the
+ * same value (assuming that the datarow passed in is the same).
+ */
+public interface ReportExpression
+{
+ public void setParameters (Object[] parameters);
+ public Object getParameters ();
+
+ public Object getValue(DataRow row);
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java b/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java
new file mode 100644
index 000000000000..2c28e4c1b4d1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportExpressionMetaData.java
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportExpressionMetaData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+import java.util.Locale;
+
+public interface ReportExpressionMetaData
+{
+ public int getParameterCount();
+
+ public String getParameterName(int param);
+ public String getParameterDisplayName(int param, Locale locale);
+ public String getParameterDescription(int param, Locale locale);
+
+ public String getName();
+ public String getDisplayName(Locale l);
+ public String getDescription(Locale l);
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportFunction.java b/reportdesign/java/com/sun/star/report/ReportFunction.java
new file mode 100644
index 000000000000..0d885e96775f
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportFunction.java
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportFunction.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report;
+
+import java.util.Map;
+
+/**
+ * Functions are statefull computation components.
+ *
+ * Functions are allowed to have a state, but are considered
+ * immutable (the same is true for expressions). Functions are
+ * allowed to update their state on every call to 'advance', which
+ * signals, that the cursor has been moved.
+ *
+ * Functions have no way to 'reset' their state, if a reset is needed,
+ * the report engine is urged to query a new instance from the ReportAddin.
+ */
+public interface ReportFunction extends ReportExpression
+{
+ public ReportFunction advance(DataRow row);
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportJob.java b/reportdesign/java/com/sun/star/report/ReportJob.java
new file mode 100644
index 000000000000..d6aa621a290c
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportJob.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportJob.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.io.IOException;
+
+/**
+ * This allows some simple job control. A job can be interrupted (or if it has
+ * not yet been started, canceled), and the job status can be queried (scheduled,
+ * running, finished).
+ *
+ * <table border="1">
+ * <tr>
+ * <th>JobStatus</th><th>running</th><th>finished</th>
+ * </tr>
+ * <tr>
+ * <td>Scheduled</td><td>false</td><td>false</td>
+ * </tr>
+ * <tr>
+ * <td>Running</td><td>true</td><td>false</td>
+ * </tr>
+ * <tr>
+ * <td>Finished</td><td>false</td><td>true</td>
+ * </tr>
+ * </table>
+ *
+ * @author Thomas Morgner
+ */
+public interface ReportJob
+{
+ /**
+ * Although we might want to run the job as soon as it has been
+ * created, sometimes it is wiser to let the user add some listeners
+ * first. If we execute at once, the user either has to deal with
+ * threading code or wont receive any progress information in single
+ * threaded environments.
+ */
+ public void execute()
+ throws ReportExecutionException, IOException;
+
+ /**
+ * Interrupt the job.
+ */
+ public void interrupt();
+
+ /**
+ * Queries the jobs execution status.
+ *
+ * @return true, if the job is currently running, false otherwise.
+ */
+ public boolean isRunning();
+
+ /**
+ * Queries the jobs result status.
+ *
+ * @return true, if the job is finished (or has been interrupted), false
+ * if the job waits for activation.
+ */
+ public boolean isFinished();
+
+ public void addProgressIndicator(JobProgressIndicator indicator);
+ public void removeProgressIndicator(JobProgressIndicator indicator);
+}
diff --git a/reportdesign/java/com/sun/star/report/ReportJobDefinition.java b/reportdesign/java/com/sun/star/report/ReportJobDefinition.java
new file mode 100644
index 000000000000..ff5a0f078533
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/ReportJobDefinition.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportJobDefinition.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+/**
+ * The report job is created by the report job factory and holds all properties
+ * required to complete the reporting task.
+ *
+ * @author Thomas Morgner
+ */
+public interface ReportJobDefinition
+{
+ /**
+ * The parameters of the root report definition. The report parameters are using
+ * by the query factory to parametrize the query statement.
+ *
+ * The query parameters for the subreports are defined using mappings, it would not
+ * make sense to define them here.
+ *
+ * @return a map containing the report parameters
+ */
+ public ParameterMap getQueryParameters ();
+
+ /**
+ * The report processing parameters control the behaviour of the report. There are
+ * several mandatory parameters, some optional and possibly some not-yet-understood
+ * parameters. Use the engine meta data to find out, which parameters are supported.
+ *
+ * @return the processing parameters
+ */
+ public JobProperties getProcessingParameters ();
+}
diff --git a/reportdesign/java/com/sun/star/report/SDBCReportData.java b/reportdesign/java/com/sun/star/report/SDBCReportData.java
new file mode 100644
index 000000000000..7a3858176580
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/SDBCReportData.java
@@ -0,0 +1,327 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SDBCReportData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
+import com.sun.star.sdb.XParametersSupplier;
+import java.sql.Timestamp;
+
+import com.sun.star.sdbc.DataType;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XResultSetMetaData;
+import com.sun.star.sdbc.XResultSetMetaDataSupplier;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.uno.Any;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+
+public class SDBCReportData implements DataSource
+{
+ private XRowSet rowSet;
+ private XRow row;
+ private int rowCount;
+ private XIndexAccess parameters;
+ private int firstParameterIndex = -1;
+ private int columnCount;
+ private final String[] columnNames;
+ private final int[] columnTypes;
+
+ public SDBCReportData(final XRowSet rowSet) throws SQLException
+ {
+ row = (XRow) UnoRuntime.queryInterface(XRow.class, rowSet);
+ this.rowSet = rowSet;
+
+ XParametersSupplier xSuppParams = (XParametersSupplier)UnoRuntime.queryInterface(
+ XParametersSupplier.class, rowSet );
+ if ( xSuppParams != null )
+ parameters = xSuppParams.getParameters();
+
+ final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet);
+ final XResultSetMetaData resultSetMetaData = sup.getMetaData();
+
+ columnCount = resultSetMetaData.getColumnCount();
+ if ( parameters != null )
+ {
+ firstParameterIndex = columnCount + 1;
+ columnCount += parameters.getCount();
+ }
+
+ columnTypes = new int[columnCount];
+ columnNames = new String[columnCount];
+
+ for (int i = 1;i <= columnCount;++i)
+ {
+ if ( i < firstParameterIndex )
+ {
+ columnNames[i-1] = resultSetMetaData.getColumnName(i);
+ columnTypes[i-1] = resultSetMetaData.getColumnType(i);
+ }
+ else
+ {
+ try
+ {
+ XPropertySet paramColumn = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, parameters.getByIndex(i-firstParameterIndex) );
+ columnNames[i-1] = (String)paramColumn.getPropertyValue( "Name" );
+ columnTypes[i-1] = ((Integer)paramColumn.getPropertyValue( "Type" )).intValue();
+ }
+ catch( Exception e )
+ {
+ columnNames[i-1] = "Error";
+ columnTypes[i-1] = DataType.CHAR;
+ }
+ }
+ }
+
+ if (rowSet.last())
+ {
+ rowCount = rowSet.getRow();
+ rowSet.beforeFirst();
+ }
+ else
+ {
+ rowCount = 0;
+ }
+ }
+
+ public int getColumnCount() throws DataSourceException
+ {
+ return columnCount;
+ }
+
+ public int getRowCount()
+ {
+ return rowCount;
+ }
+
+ public String getColumnName(final int column) throws DataSourceException
+ {
+ return columnNames[column - 1];
+ }
+
+ public boolean absolute(final int row) throws DataSourceException
+ {
+ try
+ {
+ if (row == 0)
+ {
+ rowSet.beforeFirst();
+ return true;
+ }
+ return rowSet.absolute(row);
+ }
+ catch (SQLException e)
+ {
+ throw new DataSourceException(e.getMessage(), e);
+ }
+ }
+
+ public boolean next() throws DataSourceException
+ {
+ try
+ {
+ return rowSet.next();
+ }
+ catch (SQLException e)
+ {
+ throw new DataSourceException(e.getMessage(), e);
+ }
+ }
+
+ public void close() throws DataSourceException
+ {
+ }
+
+// public int getCurrentRow() throws DataSourceException
+// {
+// try
+// {
+// return rowSet.getRow();
+// }
+// catch (SQLException e)
+// {
+// throw new DataSourceException(e.getMessage(), e);
+// }
+// }
+
+ static private java.sql.Date getDate(final Object obj)
+ {
+ java.sql.Date date = null;
+ if (obj != null && obj instanceof com.sun.star.util.Date)
+ {
+ final com.sun.star.util.Date unodate = (com.sun.star.util.Date) obj;
+ date = java.sql.Date.valueOf(getDateString(unodate.Year, unodate.Month, unodate.Day).toString());
+ }
+ return date;
+ }
+
+ private static StringBuffer getTimeString(final int hours, final int minutes, final int seconds)
+ {
+ final StringBuffer timeString = new StringBuffer();
+ if (hours < 10)
+ {
+ timeString.append("0");
+ }
+ timeString.append(hours);
+ timeString.append(":");
+ if (minutes < 10)
+ {
+ timeString.append("0");
+ }
+ timeString.append(minutes);
+ timeString.append(":");
+ if (seconds < 10)
+ {
+ timeString.append("0");
+ }
+ timeString.append(seconds);
+ return timeString;
+ }
+
+ static private StringBuffer getDateString(final int years, final int months, final int days)
+ {
+ final StringBuffer str = new StringBuffer();
+ str.append(years);
+ StringBuffer str2 = new StringBuffer("0000");
+ str2 = str2.delete(0, str.length());
+ str.insert(0, str2);
+ str.append("-");
+ if (months < 10)
+ {
+ str.append("0");
+ }
+ str.append(months);
+ str.append("-");
+ if (days < 10)
+ {
+ str.append("0");
+ }
+ str.append(days);
+ return str;
+ }
+
+ static private java.sql.Time getTime(final Object obj)
+ {
+ java.sql.Time time = null;
+ if (obj != null && obj instanceof Time)
+ {
+ final Time unoTime = (Time) obj;
+ time = java.sql.Time.valueOf
+ (getTimeString(unoTime.Hours, unoTime.Minutes, unoTime.Seconds).toString());
+ }
+ return time;
+ }
+
+ static private Timestamp getTimestamp(final Object obj)
+ {
+ Timestamp ts = null;
+ if (obj != null && obj instanceof DateTime)
+ {
+ final DateTime unoTs = (DateTime) obj;
+ final StringBuffer str = getDateString(unoTs.Year, unoTs.Month, unoTs.Day);
+ str.append(" ");
+ str.append(getTimeString(unoTs.Hours, unoTs.Minutes, unoTs.Seconds));
+ str.append(".");
+ str.append(unoTs.HundredthSeconds);
+ ts = java.sql.Timestamp.valueOf(str.toString());
+ }
+ return ts;
+ }
+
+ public Object getObject(final int column) throws DataSourceException
+ {
+ try
+ {
+ boolean isParameterValue = ( parameters != null ) && ( column >= firstParameterIndex );
+ Object obj = null;
+ boolean wasNull = true;
+ if ( isParameterValue )
+ {
+ try
+ {
+ XPropertySet paramCol = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet.class, parameters.getByIndex( column - firstParameterIndex ) );
+ obj = paramCol.getPropertyValue( "Value" );
+ wasNull = false;
+ }
+ catch( Exception e )
+ {
+ wasNull = true;
+ }
+ }
+ else
+ {
+ obj = row.getObject( column, null );
+ wasNull = row.wasNull();
+ }
+
+ if ( wasNull )
+ {
+ return null;
+ }
+
+ switch (columnTypes[column - 1])
+ {
+ case DataType.DATE:
+ obj = getDate(obj);
+ break;
+ case DataType.TIME:
+ obj = getTime(obj);
+ break;
+ case DataType.TIMESTAMP:
+ obj = getTimestamp(obj);
+ break;
+ case DataType.DECIMAL:
+ case DataType.NUMERIC:
+ if (obj != null && !(obj instanceof Any))
+ {
+ obj = new java.math.BigDecimal((String) obj);
+ }
+ break;
+ default:
+ break;
+ }
+ return obj;
+ }
+ catch (SQLException e)
+ {
+ throw new DataSourceException(e.getMessage(), e);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java b/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java
new file mode 100644
index 000000000000..2de56cb9c281
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/SDBCReportDataFactory.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SDBCReportDataFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+package com.sun.star.report;
+
+
+import java.util.Map;
+
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XRowSet;
+
+/**
+ * Very primitive implementation, just to show how this could be used ...
+ *
+ */
+public class SDBCReportDataFactory implements DataSourceFactory
+{
+ private XRowSet rowSet;
+
+ public SDBCReportDataFactory(final XRowSet rowSet)
+ {
+ this.rowSet = rowSet;
+ }
+
+ public DataSource queryData(final String query, final Map parameters) throws DataSourceException {
+ try
+ {
+ return new SDBCReportData(rowSet);
+ }
+ catch (SQLException e)
+ {
+ throw new DataSourceException(e.getMessage(),e);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/SOImageService.java b/reportdesign/java/com/sun/star/report/SOImageService.java
new file mode 100644
index 000000000000..8702cf5bfd18
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/SOImageService.java
@@ -0,0 +1,200 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SOImageService.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import java.awt.Dimension;
+import java.io.InputStream;
+
+import com.sun.star.awt.Size;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.XPropertySetInfo;
+import com.sun.star.graphic.XGraphicProvider;
+import com.sun.star.io.IOException;
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter;
+import com.sun.star.lib.uno.adapter.InputStreamToXInputStreamAdapter;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+
+/**
+ * @author oj93728
+ */
+public class SOImageService implements ImageService
+{
+ private XGraphicProvider m_xGraphicProvider;
+
+ /**
+ * Creates a new instance of SOImageService
+ */
+ public SOImageService(final XComponentContext xCompContext)
+ throws ReportExecutionException, com.sun.star.uno.Exception
+ {
+ if (xCompContext == null)
+ {
+ throw new ReportExecutionException();
+ }
+
+
+ final XMultiComponentFactory m_xMCF = xCompContext.getServiceManager();
+ m_xGraphicProvider = (XGraphicProvider) UnoRuntime.queryInterface(XGraphicProvider.class,
+ m_xMCF.createInstanceWithContext("com.sun.star.graphic.GraphicProvider", xCompContext));
+
+ if (m_xGraphicProvider == null)
+ {
+ throw new ReportExecutionException("There is no graphic-provider available.");
+ }
+ }
+
+ public Dimension getImageSize(final InputStream image) throws ReportExecutionException
+ {
+ return getImageSize(new InputStreamToXInputStreamAdapter(image));
+ }
+
+ private Dimension getImageSize(final XInputStream image) throws ReportExecutionException
+ {
+ final Dimension dim = new Dimension();
+ try
+ {
+ final PropertyValue[] value = new PropertyValue[1];
+ value[0] = new PropertyValue();
+ value[0].Name = "InputStream";
+ value[0].Value = image;
+
+ final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class,
+ m_xGraphicProvider.queryGraphic( value ) );
+
+ if (xImage != null)
+ {
+ final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
+ if (xInfo.hasPropertyByName("Size100thMM"))
+ {
+ Size imageSize = (Size) xImage.getPropertyValue("Size100thMM");
+ dim.setSize(imageSize.Width, imageSize.Height);
+ if (dim.height == 0 && dim.width == 0)
+ {
+ imageSize = (Size) xImage.getPropertyValue("SizePixel");
+ final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
+ final double fac = 25400 / dpi;
+ dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
+ }
+ }
+ else if (xInfo.hasPropertyByName("SizePixel"))
+ {
+ final Size imageSize = (Size) xImage.getPropertyValue("SizePixel");
+ final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
+ final double fac = 25400 / dpi;
+ dim.setSize(imageSize.Width * fac, imageSize.Height * fac);
+ }
+ }
+ }
+ catch (UnknownPropertyException ex)
+ {
+ throw new ReportExecutionException("Failed to query Image-Size", ex);
+ }
+ catch (WrappedTargetException ex)
+ {
+ throw new ReportExecutionException("Failed to query Image-Size", ex);
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex)
+ {
+ throw new ReportExecutionException("Failed to query Image-Size", ex);
+ }
+ catch (IOException ex)
+ {
+ throw new ReportExecutionException("Failed to query Image-Size", ex);
+ }
+ return dim;
+ }
+
+ public Dimension getImageSize(final byte[] image) throws ReportExecutionException
+ {
+ return getImageSize(new ByteArrayToXInputStreamAdapter(image));
+ }
+
+ private String getMimeType(final XInputStream image) throws ReportExecutionException
+ {
+ String mimeType = null;
+ try
+ {
+ final PropertyValue[] value = new PropertyValue[] { new PropertyValue() };
+ value[0].Name = "InputStream";
+ value[0].Value = image;
+
+ final XPropertySet xImage = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,
+ m_xGraphicProvider.queryGraphic(value));
+
+ if (xImage != null)
+ {
+ final XPropertySetInfo xInfo = xImage.getPropertySetInfo();
+ if (xInfo.hasPropertyByName("MimeType"))
+ {
+ mimeType = (String) xImage.getPropertyValue("MimeType");
+ }
+ }
+ }
+ catch (UnknownPropertyException ex)
+ {
+ throw new ReportExecutionException();
+ }
+ catch (WrappedTargetException ex)
+ {
+ throw new ReportExecutionException();
+ }
+ catch (com.sun.star.lang.IllegalArgumentException ex)
+ {
+ throw new ReportExecutionException();
+ }
+ catch (IOException ex)
+ {
+ throw new ReportExecutionException();
+ }
+ return mimeType;
+ }
+
+ public String getMimeType(final InputStream image) throws ReportExecutionException
+ {
+ return getMimeType(new InputStreamToXInputStreamAdapter(image));
+ }
+
+ public String getMimeType(final byte[] image) throws ReportExecutionException
+ {
+ return getMimeType(new ByteArrayToXInputStreamAdapter(image));
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/StorageRepository.java b/reportdesign/java/com/sun/star/report/StorageRepository.java
new file mode 100644
index 000000000000..9764a9f37fa1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/StorageRepository.java
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StorageRepository.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.NoSuchElementException;
+import com.sun.star.embed.ElementModes;
+import com.sun.star.embed.InvalidStorageException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.*;
+import com.sun.star.embed.XStorage;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.io.XStream;
+import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter;
+import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter;
+
+/**
+ * A directory holds all the contents here.
+ *
+ *
+ * @author Ocke Janssen
+ */
+public class StorageRepository implements InputRepository, OutputRepository {
+ private XStorage input;
+ private XStorage output;
+
+ /**
+ *
+ * @param input
+ * @param output
+ * @throws java.io.IOException
+ */
+ public StorageRepository(final XStorage input,final XStorage output) throws IOException {
+ this.input = input;
+ this.output = output;
+ if ( output == null || input == null )
+ throw new IOException("Need a valid storage not NULL.");
+ }
+
+ public InputStream createInputStream(String name) throws IOException {
+ try{
+ final XStream xStream = (XStream) UnoRuntime.queryInterface(XStream.class,input.openStreamElement(name,ElementModes.READ));
+ return new BufferedInputStream(new XInputStreamToInputStreamAdapter(xStream.getInputStream()),102400);
+ }catch(com.sun.star.uno.Exception e){
+ throw new IOException("createInputStream");
+ }
+ }
+
+ /**
+ * Creates an output stream for writing the data. If there is an entry with
+ * that name already contained in the repository, try to overwrite it.
+ *
+ * @param name
+ * @param mimeType
+ * @return the outputstream
+ * @throws IOException if opening the stream fails
+ */
+ public OutputStream createOutputStream(String name, String mimeType) throws IOException {
+ try{
+ final XStream stream = (XStream) UnoRuntime.queryInterface(XStream.class,output.openStreamElement(name,ElementModes.WRITE|ElementModes.TRUNCATE));
+ stream.getInputStream().closeInput();
+ if (mimeType != null)
+ {
+ final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,stream);
+ prop.setPropertyValue("MediaType",mimeType);
+ }
+ return new BufferedOutputStream(new XOutputStreamToOutputStreamAdapter(stream.getOutputStream()),204800);
+ }catch(com.sun.star.uno.Exception e){
+ throw new IOException("createOutputStream");
+ }
+ }
+
+ public boolean exists(String name) {
+ try {
+ return output.isStreamElement(name);
+ } catch (InvalidStorageException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ } catch (NoSuchElementException ex) {
+ ex.printStackTrace();
+ }
+ return false;
+ }
+
+ public boolean isWritable(String name) {
+ return true;
+ }
+
+ public Object getId() {
+ return "1";
+ }
+
+ public long getVersion(String name) {
+ return 1;
+ }
+
+ public boolean isReadable(String name)
+ {
+ try {
+ if ( input != null )
+ return input.isStreamElement(name);
+ } catch (InvalidStorageException ex) {
+ ex.printStackTrace();
+ } catch (com.sun.star.lang.IllegalArgumentException ex) {
+ ex.printStackTrace();
+ } catch (NoSuchElementException ex) {
+ ex.printStackTrace();
+ }
+ return false;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/makefile.mk b/reportdesign/java/com/sun/star/report/makefile.mk
new file mode 100644
index 000000000000..d39a3bf829f7
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/makefile.mk
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..
+PRJNAME = reportdesign
+TARGET = $(PRJNAME)
+PACKAGE = com$/sun$/star$/report
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar jcommon-1.0.8.jar
+JAVAFILES := DataRow.java\
+ DataSource.java\
+ DataSourceException.java\
+ DataSourceFactory.java\
+ InputRepository.java\
+ JobDefinitionException.java\
+ JobProgressIndicator.java\
+ JobProperties.java\
+ OutputRepository.java\
+ ParameterMap.java\
+ ReportAddIn.java\
+ ReportEngine.java\
+ ReportEngineMetaData.java\
+ ReportEngineParameterNames.java\
+ ReportExecutionException.java\
+ ReportExpression.java\
+ ReportExpressionMetaData.java\
+ ReportFunction.java\
+ ReportJob.java\
+ ReportJobDefinition.java\
+ ImageService.java\
+ SOImageService.java\
+ StorageRepository.java\
+ SDBCReportData.java\
+ SDBCReportDataFactory.java
+
+
+# --- Targets ------------------------------------------------------
+.INCLUDE : target.mk
diff --git a/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java b/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java
new file mode 100644
index 000000000000..49b558ade219
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/DefaultNameGenerator.java
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultNameGenerator.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import java.io.IOException;
+
+import com.sun.star.report.OutputRepository;
+
+public class DefaultNameGenerator
+{
+ private OutputRepository outputRepository;
+
+ public DefaultNameGenerator(final OutputRepository outputRepository)
+ {
+ if (outputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ this.outputRepository = outputRepository;
+ }
+
+ /**
+ * Generates a new, unique name for storing resources in the output repository. Assuming that proper synchronization
+ * has been applied, the generated name will be unique within that repository.
+ *
+ * @param namePrefix a user defined name for that resource.
+ * @param mimeType the mime type of the resource to be stored in the repository.
+ * @return the generated, fully qualified name.
+ */
+ public String generateName(final String namePrefix, final String mimeType)
+ throws IOException
+ {
+ final String name;
+ if (namePrefix != null)
+ {
+ name = namePrefix;
+ }
+ else
+ {
+ name = "file";
+ }
+
+ final String suffix = getSuffixForType(mimeType);
+ final String firstFileName = name + "." + suffix;
+ if (outputRepository.exists(firstFileName) == false)
+ {
+ return firstFileName;
+ }
+ int counter = 0;
+ while (true)
+ {
+ if (counter < 0) // wraparound should not happen..
+ {
+ throw new IOException();
+ }
+ final String filename = name + counter + "." + suffix;
+ if (outputRepository.exists(filename) == false)
+ {
+ return filename;
+ }
+ counter += 1;
+ }
+ }
+
+ protected String getSuffixForType(final String mimeType)
+ {
+ if ("image/png".equals(mimeType))
+ {
+ return "png";
+ }
+ if ("image/jpeg".equals(mimeType))
+ {
+ return "jpg";
+ }
+ if ("image/gif".equals(mimeType))
+ {
+ return "gif";
+ }
+
+ // todo ... use a flexible mapping ...
+ return "dat";
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf b/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf
new file mode 100644
index 000000000000..7c00aa6bccf9
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/Manifest.mf
@@ -0,0 +1,7 @@
+RegistrationClassName: com.sun.star.report.pentaho.SOReportJobFactory
+Class-Path: jcommon-1.0.10.jar sac.jar
+ libxml-0.9.5.jar flute-1.3-jfree-20061107.jar jfreereport-0.9.0-05.jar
+ liblayout-0.2.6.jar libloader-0.3.4.jar libfonts-0.2.6.jar
+ jcommon-serializer-0.1.0.jar libformula-0.1.8.jar
+ librepository-0.1.1.jar
+UNO-Type-Path:
diff --git a/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java b/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java
new file mode 100644
index 000000000000..04f5bdcc80b9
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/OfficeNamespaces.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeNamespaces.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import java.io.File;
+
+/**
+ * Creation-Date: Feb 22, 2007, 1:53:29 PM
+ *
+ * @author Thomas Morgner
+ */
+public class OfficeNamespaces
+{
+
+ public static final String OFFICE_NS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
+ public static final String TABLE_NS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
+ public static final String TEXT_NS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
+ public static final String STYLE_NS = "urn:oasis:names:tc:opendocument:xmlns:style:1.0";
+ public static final String DRAWING_NS = "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0";
+ public static final String FO_NS = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
+ public static final String XLINK_NS = "http://www.w3.org/1999/xlink";
+ public static final String PURL_NS = "http://purl.org/dc/elements/1.1/";
+ public static final String META_NS = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0";
+ public static final String DATASTYLE_NS = "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0";
+ public static final String SVG_NS = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
+ public static final String CHART_NS = "urn:oasis:names:tc:opendocument:xmlns:chart:1.0";
+ public static final String DR3D_NS = "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0";
+ public static final String MATHML_NS = "http://www.w3.org/1998/Math/MathML";
+ public static final String FORM_NS = "urn:oasis:names:tc:opendocument:xmlns:form:1.0";
+ public static final String SCRIPT_NS = "urn:oasis:names:tc:opendocument:xmlns:script:1.0";
+ public static final String OO2004_NS = "http://openoffice.org/2004/office";
+ public static final String OOW2004_NS = "http://openoffice.org/2004/writer";
+ public static final String OOC2004_NS = "http://openoffice.org/2004/calc";
+ public static final String XML_EVENT_NS = "http://www.w3.org/2001/xml-events";
+ public static final String XFORMS_NS = "http://www.w3.org/2002/xforms";
+ public static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
+ public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance";
+ public static final String OOREPORT_NS = "http://openoffice.org/2005/report";
+ public static final String CONFIG = "urn:oasis:names:tc:opendocument:xmlns:config:1.0";
+ public static final String INTERNAL_NS = "http://reporting.pentaho.org/namespaces/engine";
+ public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0";
+ /**
+ * @deprecated
+ */
+ public static final String NUMBER_NS = DATASTYLE_NS;
+
+ private OfficeNamespaces()
+ {
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java
new file mode 100644
index 000000000000..932dcdece24b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportAddIn.java
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PentahoReportAddIn.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import com.sun.star.report.ReportAddIn;
+import com.sun.star.report.ReportExpression;
+import com.sun.star.report.ReportExpressionMetaData;
+import com.sun.star.report.pentaho.expressions.SumExpression;
+
+/**
+ * This class is a dummy implementation. Ignore it for now, we may extend this
+ * one later.
+ */
+public class PentahoReportAddIn implements ReportAddIn
+{
+ public PentahoReportAddIn()
+ {
+ }
+
+ public ReportExpression createExpression(int expression)
+ {
+ if (expression == 0)
+ {
+ return new SumExpression();
+ }
+ return null;
+ }
+
+ public int getExpressionCount()
+ {
+ return 1;
+ }
+
+ public ReportExpressionMetaData getMetaData(int expression)
+ {
+ // todo implement me
+ return null;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java
new file mode 100644
index 000000000000..ac152c2e9f40
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngine.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PentahoReportEngine.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import com.sun.star.report.JobDefinitionException;
+import com.sun.star.report.ReportEngine;
+import com.sun.star.report.ReportEngineMetaData;
+import com.sun.star.report.ReportJob;
+import com.sun.star.report.ReportJobDefinition;
+import com.sun.star.report.util.DefaultReportJobDefinition;
+import org.jfree.report.JFreeReportBoot;
+
+public class PentahoReportEngine implements ReportEngine
+{
+ private ReportEngineMetaData metaData;
+
+ public PentahoReportEngine ()
+ {
+ JFreeReportBoot.getInstance().start();
+ this.metaData = new PentahoReportEngineMetaData();
+ }
+
+ public ReportEngineMetaData getMetaData ()
+ {
+ return metaData;
+ }
+
+ public ReportJobDefinition createJobDefinition ()
+ {
+ return new DefaultReportJobDefinition(metaData);
+ }
+
+ /**
+ * Open points: How to define scheduling?
+ *
+ * @return the report job definition for the job description.
+ *
+ * @throws com.sun.star.report.JobDefinitionException
+ *
+ */
+ public ReportJob createJob (final ReportJobDefinition definition)
+ throws JobDefinitionException
+ {
+ return new PentahoReportJob(definition);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java
new file mode 100644
index 000000000000..3d860c4b9903
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportEngineMetaData.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PentahoReportEngineMetaData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import java.util.HashMap;
+import java.util.HashSet;
+
+import com.sun.star.report.DataSourceFactory;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.ReportEngineMetaData;
+import com.sun.star.report.ReportEngineParameterNames;
+import com.sun.star.report.ImageService;
+import org.jfree.util.HashNMap;
+
+public class PentahoReportEngineMetaData
+ implements ReportEngineMetaData
+{
+ public static final String OPENDOCUMENT_TEXT = "application/vnd.oasis.opendocument.text";
+ public static final String OPENDOCUMENT_SPREADSHEET = "application/vnd.oasis.opendocument.spreadsheet";
+ public static final String DEBUG = "raw/text+xml";
+
+ private HashSet mandatoryParameters;
+ private HashMap parameterTypes;
+ private HashNMap enumerationValues;
+
+ public PentahoReportEngineMetaData ()
+ {
+ mandatoryParameters = new HashSet();
+ mandatoryParameters.add(ReportEngineParameterNames.CONTENT_TYPE);
+ mandatoryParameters.add(ReportEngineParameterNames.INPUT_NAME);
+ mandatoryParameters.add(ReportEngineParameterNames.INPUT_REPOSITORY);
+ mandatoryParameters.add(ReportEngineParameterNames.OUTPUT_NAME);
+ mandatoryParameters.add(ReportEngineParameterNames.OUTPUT_REPOSITORY);
+ mandatoryParameters.add(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
+ mandatoryParameters.add(ReportEngineParameterNames.IMAGE_SERVICE);
+
+ parameterTypes = new HashMap();
+ parameterTypes.put (ReportEngineParameterNames.CONTENT_TYPE, String.class);
+ parameterTypes.put (ReportEngineParameterNames.INPUT_NAME, String.class);
+ parameterTypes.put (ReportEngineParameterNames.OUTPUT_NAME, String.class);
+ parameterTypes.put (ReportEngineParameterNames.INPUT_REPOSITORY, InputRepository.class);
+ parameterTypes.put (ReportEngineParameterNames.OUTPUT_REPOSITORY, OutputRepository.class);
+ parameterTypes.put (ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, DataSourceFactory.class);
+ parameterTypes.put (ReportEngineParameterNames.IMAGE_SERVICE, ImageService.class);
+
+ enumerationValues = new HashNMap();
+ enumerationValues.add("content-type",
+ PentahoReportEngineMetaData.OPENDOCUMENT_TEXT);
+ enumerationValues.add("content-type",
+ PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET);
+ enumerationValues.add("content-type", PentahoReportEngineMetaData.DEBUG);
+ }
+
+ public Object[] getEnumerationValues (final String parameter)
+ {
+ return enumerationValues.toArray(parameter);
+ }
+
+ public Class getParameterType (final String parameter)
+ {
+ return (Class) parameterTypes.get(parameter);
+ }
+
+ public boolean isEnumeration (final String parameter)
+ {
+ return enumerationValues.containsKey(parameter);
+ }
+
+ /**
+ * Checks, whether a certain output type is available. Feed the mime-type of the output
+ * type in and you'll get a true or false back.
+ *
+ * @param mimeType
+ * @return true, if the output type is supported; false otherwise.
+ */
+ public boolean isOutputSupported (final String mimeType)
+ {
+ return enumerationValues.containsValue
+ ("content-type", mimeType.toLowerCase());
+ }
+
+ /**
+ * Lists all supported output parameters for the given mime-type. This listing can be
+ * used to build a generic user interface for configuring a certain output.
+ *
+ * @param mimeType
+ * @return
+ */
+ public String[] getOutputParameters (final String mimeType)
+ {
+ return new String[0];
+ }
+
+ public boolean isMandatory (final String parameter)
+ {
+ return mandatoryParameters.contains(parameter);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java
new file mode 100644
index 000000000000..18823cd1195e
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/PentahoReportJob.java
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PentahoReportJob.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import com.sun.star.report.DataSourceFactory;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.JobDefinitionException;
+import com.sun.star.report.JobProgressIndicator;
+import com.sun.star.report.JobProperties;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.ParameterMap;
+import com.sun.star.report.ReportEngineParameterNames;
+import com.sun.star.report.ReportExecutionException;
+import com.sun.star.report.ReportJob;
+import com.sun.star.report.ReportJobDefinition;
+import com.sun.star.report.ImageService;
+import com.sun.star.report.pentaho.loader.InputRepositoryLoader;
+import com.sun.star.report.pentaho.model.OfficeDocument;
+import com.sun.star.report.pentaho.output.text.TextRawReportProcessor;
+import com.sun.star.report.pentaho.output.spreadsheet.SpreadsheetRawReportProcessor;
+import org.jfree.report.flow.DefaultReportJob;
+import org.jfree.report.flow.ReportProcessor;
+import org.jfree.report.flow.raw.XmlPrintReportProcessor;
+import org.jfree.report.util.ReportParameters;
+import org.jfree.resourceloader.Resource;
+import org.jfree.resourceloader.ResourceException;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.util.Log;
+
+/**
+ * ToDo: Allow interrupting of jobs and report the report progress
+ */
+public class PentahoReportJob implements ReportJob
+{
+ private boolean finished;
+ private ArrayList listeners;
+ private DataSourceFactory dataSourceFactory;
+ private OutputRepository outputRepository;
+ private JobProperties jobProperties;
+ private OfficeDocument report;
+ private ResourceManager resourceManager;
+ private String outputName;
+ private ImageService imageService;
+ private InputRepository inputRepository;
+
+ public PentahoReportJob (final ReportJobDefinition definition)
+ throws JobDefinitionException
+ {
+ if (definition == null)
+ {
+ throw new NullPointerException();
+ }
+
+ this.listeners = new ArrayList();
+ this.jobProperties = definition.getProcessingParameters().copy();
+
+ this.dataSourceFactory = (DataSourceFactory) jobProperties.getProperty
+ (ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
+ if (this.dataSourceFactory == null)
+ {
+ throw new JobDefinitionException("DataSourceFactory must not be null.");
+ }
+
+ this.outputRepository = (OutputRepository) jobProperties.getProperty
+ (ReportEngineParameterNames.OUTPUT_REPOSITORY);
+ if (this.outputRepository == null)
+ {
+ throw new JobDefinitionException("OutputRepository must not be null.");
+ }
+
+ this.inputRepository =
+ (InputRepository) jobProperties.getProperty
+ (ReportEngineParameterNames.INPUT_REPOSITORY);
+ if (inputRepository == null)
+ {
+ throw new JobDefinitionException("InputRepository must not be null.");
+ }
+
+ this.outputName = (String) jobProperties
+ .getProperty(ReportEngineParameterNames.OUTPUT_NAME);
+ if (outputName == null)
+ {
+ throw new JobDefinitionException("OutputName must not be null");
+ }
+
+ this.imageService = (ImageService) jobProperties.getProperty(ReportEngineParameterNames.IMAGE_SERVICE);
+ if (imageService == null)
+ {
+ throw new JobDefinitionException("A valid image-service implementation must be given.");
+ }
+ this.resourceManager = new ResourceManager();
+ this.resourceManager.registerDefaults();
+ this.resourceManager.registerLoader(new InputRepositoryLoader(inputRepository));
+
+ try
+ {
+ this.report = parseReport(definition);
+ }
+ catch (ResourceException e)
+ {
+ throw new JobDefinitionException("Failed to parse the report.", e);
+ }
+ }
+
+ private OfficeDocument parseReport (final ReportJobDefinition definition)
+ throws ResourceException, JobDefinitionException
+ {
+ final String reportResource = (String) this.jobProperties.getProperty
+ (ReportEngineParameterNames.INPUT_NAME);
+ if (reportResource == null)
+ {
+ throw new JobDefinitionException("Report definition name must be given");
+ }
+
+ final Resource res = resourceManager.createDirectly
+ ("sun:oo://" + reportResource, OfficeDocument.class);
+ final OfficeDocument report = (OfficeDocument) res.getResource();
+ report.setDataFactory(new StarReportDataFactory(dataSourceFactory));
+ final ReportParameters inputParameters = report.getInputParameters();
+
+ final ParameterMap queryParameters = definition.getQueryParameters();
+ final String[] paramKeys = queryParameters.keys();
+ for (int i = 0; i < paramKeys.length; i++)
+ {
+ final String key = paramKeys[i];
+ inputParameters.put(key, queryParameters.get(key));
+ }
+
+ return report;
+ }
+
+ public void addProgressIndicator (final JobProgressIndicator indicator)
+ {
+ listeners.add(indicator);
+ }
+
+ /**
+ * Interrupt the job.
+ */
+ public void interrupt ()
+ {
+ // hey, not yet ..
+ }
+
+ /**
+ * Queries the jobs result status.
+ *
+ * @return true, if the job is finished (or has been interrupted), false if the job
+ * waits for activation.
+ */
+ public boolean isFinished ()
+ {
+ return finished;
+ }
+
+ public void finish ()
+ {
+ finished = true;
+ }
+
+ /**
+ * Queries the jobs execution status.
+ *
+ * @return true, if the job is currently running, false otherwise.
+ */
+ public boolean isRunning ()
+ {
+ return finished == false;
+ }
+
+ public void removeProgressIndicator (final JobProgressIndicator indicator)
+ {
+ listeners.remove(indicator);
+ }
+
+ /**
+ * Although we might want to run the job as soon as it has been created, sometimes it is
+ * wiser to let the user add some listeners first. If we execute at once, the user
+ * either has to deal with threading code or wont receive any progress information in
+ * single threaded environments.
+ */
+ public void execute ()
+ throws ReportExecutionException, IOException
+ {
+ final DefaultReportJob job = new DefaultReportJob(report);
+
+ final String contentType = (String)
+ jobProperties.getProperty(ReportEngineParameterNames.CONTENT_TYPE);
+ //noinspection OverlyBroadCatchBlock
+ try
+ {
+ final long startTime = System.currentTimeMillis();
+ final ReportProcessor rp = getProcessorForContentType(contentType);
+ rp.processReport(job);
+ job.close();
+ final long endTime = System.currentTimeMillis();
+ Log.debug ("Report processing time: " + (endTime - startTime));
+ }
+ catch (final Exception e)
+ {
+ throw new ReportExecutionException("Failed to process the report", e);
+ }
+
+ }
+
+ protected ReportProcessor getProcessorForContentType(final String mimeType)
+ throws ReportExecutionException
+ {
+ if (PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET.equals(mimeType))
+ {
+ return new SpreadsheetRawReportProcessor(inputRepository, outputRepository, outputName, imageService);
+ }
+ if (PentahoReportEngineMetaData.OPENDOCUMENT_TEXT.equals(mimeType))
+ {
+ return new TextRawReportProcessor(inputRepository, outputRepository, outputName, imageService);
+ }
+ if (PentahoReportEngineMetaData.DEBUG.equals(mimeType))
+ {
+ return new XmlPrintReportProcessor(System.out, "ISO-8859-1");
+ }
+ throw new ReportExecutionException("Invalid mime-type");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java b/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java
new file mode 100644
index 000000000000..16d61ca46a84
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java
@@ -0,0 +1,340 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SOReportJobFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+package com.sun.star.report.pentaho;
+
+import java.net.URL;
+
+import com.sun.star.beans.NamedValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.PropertyVetoException;
+import com.sun.star.beans.XPropertyChangeListener;
+import com.sun.star.beans.XVetoableChangeListener;
+import com.sun.star.embed.XStorage;
+import com.sun.star.lang.XInitialization;
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.lib.uno.helper.Factory;
+import com.sun.star.lib.uno.helper.PropertySetMixin;
+import com.sun.star.lib.uno.helper.WeakBase;
+import com.sun.star.registry.XRegistryKey;
+import com.sun.star.report.DataSourceFactory;
+import com.sun.star.report.JobProperties;
+import com.sun.star.report.ReportEngineParameterNames;
+import com.sun.star.report.ReportJob;
+import com.sun.star.report.ReportJobDefinition;
+import com.sun.star.report.SDBCReportDataFactory;
+import com.sun.star.report.SOImageService;
+import com.sun.star.report.StorageRepository;
+import com.sun.star.sdbc.XRowSet;
+import com.sun.star.task.XJob;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import org.jfree.util.Log;
+
+/**
+ * This class capsulates the class, that implements the minimal component, a factory for creating the service
+ * (<CODE>__getComponentFactory</CODE>) and a method, that writes the information into the given registry key
+ * (<CODE>__writeRegistryServiceInfo</CODE>).
+ */
+public class SOReportJobFactory
+{
+ private SOReportJobFactory()
+ {
+ }
+
+ public static class _SOReportJobFactory extends WeakBase implements XInitialization, XServiceInfo, XJob, XPropertySet
+ {
+ /**
+ * The service name, that must be used to get an instance of this service.
+ */
+ private static final String __serviceName =
+ "com.sun.star.report.pentaho.SOReportJobFactory";
+
+ private PropertySetMixin m_prophlp;
+
+ /**
+ * The initial component contextr, that gives access to the service manager, supported singletons, ... It's
+ * often later used
+ */
+ private XComponentContext m_cmpCtx;
+
+ public _SOReportJobFactory(final XComponentContext xCompContext)
+ {
+ m_cmpCtx = xCompContext;
+ try
+ {
+ final XMultiComponentFactory m_xMCF = m_cmpCtx.getServiceManager();
+ m_prophlp = new PropertySetMixin(m_cmpCtx, this,
+ new Type(XJob.class),
+ null); // no optionals
+ }
+ catch (Exception e)
+ {
+ Log.error ("Failed to query the service manager: ", e);
+ throw new RuntimeException();
+ }
+ }
+
+ /**
+ * This method is a member of the interface for initializing an object directly after its creation.
+ *
+ * @param object This array of arbitrary objects will be passed to the component after its creation.
+ * @throws Exception Every exception will not be handled, but will be passed to the caller.
+ */
+ public void initialize(final Object[] object)
+ throws com.sun.star.uno.Exception
+ {
+ /* The component describes what arguments its expected and in which
+ * order!At this point you can read the objects and can intialize
+ * your component using these objects.
+ */
+ }
+
+ /**
+ * This method returns an array of all supported service names.
+ *
+ * @return Array of supported service names.
+ */
+ public String[] getSupportedServiceNames()
+ {
+ return getServiceNames();
+ }
+
+ /**
+ * This method is a simple helper function to used in the static component initialisation functions as well as
+ * in getSupportedServiceNames.
+ */
+ public static String[] getServiceNames()
+ {
+ return new String[]{__serviceName};
+ }
+
+ /**
+ * This method returns true, if the given service will be supported by the component.
+ *
+ * @param sServiceName Service name.
+ * @return True, if the given service name will be supported.
+ */
+ public boolean supportsService(final String sServiceName)
+ {
+ return sServiceName.equals(__serviceName);
+ }
+
+ /**
+ * Return the class name of the component.
+ *
+ * @return Class name of the component.
+ */
+ public String getImplementationName()
+ {
+ return SOReportJobFactory.class.getName();
+ }
+
+ public Object execute(final NamedValue[] namedValue)
+ throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception
+ {
+ final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+ try
+ {
+ XStorage input = null;
+ XStorage output = null;
+ XRowSet rowSet = null;
+ String mimetype = null;
+ for (int i = 0; i < namedValue.length; ++i)
+ {
+ final NamedValue aProps = namedValue[i];
+ if ("DataSource".equalsIgnoreCase(aProps.Name))
+ {
+ }
+ else if ("RowSet".equalsIgnoreCase(aProps.Name))
+ {
+ rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, aProps.Value);
+ }
+ else if ("Parameters".equalsIgnoreCase(aProps.Name))
+ {
+ }
+ else if ("InputStorage".equalsIgnoreCase(aProps.Name))
+ {
+ input = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value);
+ }
+ else if ("OutputStorage".equalsIgnoreCase(aProps.Name))
+ {
+ output = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value);
+ }
+ else if ("mimetype".equalsIgnoreCase(aProps.Name))
+ {
+ mimetype = (String) aProps.Value;
+ }
+ }
+
+ if (rowSet == null || input == null || output == null)
+ {
+ throw new com.sun.star.lang.IllegalArgumentException();
+ }
+
+ if (mimetype == null)
+ {
+ mimetype = "application/vnd.oasis.opendocument.text";
+ }
+
+ final DataSourceFactory dataFactory = new SDBCReportDataFactory(rowSet);
+ final StorageRepository storageRepository = new StorageRepository(input, output);
+ final PentahoReportEngine engine = new PentahoReportEngine();
+ final ReportJobDefinition definition = engine.createJobDefinition();
+ final JobProperties procParms = definition.getProcessingParameters();
+
+ final String inputName = "content.xml";
+ final String outputName = "content.xml";
+ procParms.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, storageRepository);
+ procParms.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, storageRepository);
+ procParms.setProperty(ReportEngineParameterNames.INPUT_NAME, inputName);
+ procParms.setProperty(ReportEngineParameterNames.OUTPUT_NAME, outputName);
+ procParms.setProperty(ReportEngineParameterNames.CONTENT_TYPE, mimetype);
+ procParms.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataFactory);
+ procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, new SOImageService(m_cmpCtx));
+
+ final ReportJob job = engine.createJob(definition);
+ job.execute();
+ }
+ catch (java.lang.Exception e)
+ {
+ Log.error("ReportProcessing failed", e);
+ throw new com.sun.star.lang.WrappedTargetException
+ ("caught a " + e.getClass().getName(), this, new com.sun.star.uno.Exception(e.getLocalizedMessage()));
+ }
+ catch (java.lang.IncompatibleClassChangeError e2)
+ {
+ Log.error("Detected an IncompatibleClassChangeError");
+ e2.printStackTrace(System.err);
+ System.err.println(e2);
+ }
+ Thread.currentThread().setContextClassLoader(cl);
+
+ return null;
+ }
+
+ // com.sun.star.beans.XPropertySet:
+ public com.sun.star.beans.XPropertySetInfo getPropertySetInfo()
+ {
+ return m_prophlp.getPropertySetInfo();
+ }
+
+ public void setPropertyValue(final String aPropertyName, final Object aValue)
+ throws UnknownPropertyException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException,
+ WrappedTargetException
+ {
+ m_prophlp.setPropertyValue(aPropertyName, aValue);
+ }
+
+ public Object getPropertyValue(final String aPropertyName)
+ throws UnknownPropertyException, WrappedTargetException
+ {
+ return m_prophlp.getPropertyValue(aPropertyName);
+ }
+
+ public void addPropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener)
+ throws UnknownPropertyException, WrappedTargetException
+ {
+ m_prophlp.addPropertyChangeListener(aPropertyName, xListener);
+ }
+
+ public void removePropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener)
+ throws UnknownPropertyException, WrappedTargetException
+ {
+ m_prophlp.removePropertyChangeListener(aPropertyName, xListener);
+ }
+
+ public void addVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener)
+ throws UnknownPropertyException, WrappedTargetException
+ {
+ m_prophlp.addVetoableChangeListener(aPropertyName, xListener);
+ }
+
+ public void removeVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener)
+ throws UnknownPropertyException, WrappedTargetException
+ {
+ m_prophlp.removeVetoableChangeListener(aPropertyName, xListener);
+ }
+ }
+
+ /**
+ * Gives a factory for creating the service. This method is called by the <code>JavaLoader</code>
+ * <p/>
+ *
+ * @param sImplName the name of the implementation for which a service is desired
+ * @return returns a <code>XSingleComponentFactory</code> for creating the component
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static XSingleComponentFactory __getComponentFactory(final String sImplName)
+ {
+ XSingleComponentFactory xFactory = null;
+
+ try
+ {
+ if (sImplName.equals(_SOReportJobFactory.class.getName()))
+ {
+ xFactory = Factory.createComponentFactory(_SOReportJobFactory.class,
+ _SOReportJobFactory.getServiceNames());
+ }
+ }
+ catch (java.lang.IncompatibleClassChangeError e2)
+ {
+ e2.printStackTrace(System.err);
+ System.err.println(e2);
+ }
+
+ return xFactory;
+ }
+
+ /**
+ * Writes the service information into the given registry key. This method is called by the <code>JavaLoader</code>
+ * <p/>
+ *
+ * @param regKey the registryKey
+ * @return returns true if the operation succeeded
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static boolean __writeRegistryServiceInfo(final XRegistryKey regKey)
+ {
+ return Factory.writeRegistryServiceInfo(_SOReportJobFactory.class.getName(),
+ _SOReportJobFactory.getServiceNames(),
+ regKey);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java
new file mode 100644
index 000000000000..fc09ec3df3da
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StarReportData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import com.sun.star.report.DataSource;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportData;
+
+public class StarReportData implements ReportData
+{
+ private DataSource dataSource;
+ private int currentRow;
+ private int rowCount;
+
+ public StarReportData (final DataSource dataSource)
+ throws com.sun.star.report.DataSourceException
+ {
+ if (dataSource == null)
+ {
+ throw new NullPointerException();
+ }
+ this.dataSource = dataSource;
+ this.currentRow = 0;
+ this.rowCount = dataSource.getRowCount();
+ }
+
+ public boolean setCursorPosition(final int row) throws DataSourceException
+ {
+ try
+ {
+ if (dataSource.absolute(row))
+ {
+ currentRow = row;
+ return true;
+ }
+ return false;
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to move cursor", e);
+ }
+ }
+
+ public void close ()
+ throws DataSourceException
+ {
+ try
+ {
+ dataSource.close();
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to close datasource", e);
+ }
+ }
+
+ public int getCursorPosition ()
+ throws DataSourceException
+ {
+ return currentRow;
+ }
+
+ /**
+ * This operation checks, whether a call to next will be likely to succeed. If
+ * there is a next data row, this should return true.
+ *
+ * @return
+ * @throws org.jfree.report.DataSourceException
+ *
+ */
+ public boolean isAdvanceable() throws DataSourceException
+ {
+ return currentRow < rowCount;
+ }
+
+ public boolean next ()
+ throws DataSourceException
+ {
+ try
+ {
+ if (dataSource.next())
+ {
+ currentRow += 1;
+ return true;
+ }
+ return false;
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to move cursor", e);
+ }
+ }
+
+ public Object get (final int column)
+ throws DataSourceException
+ {
+ if (isReadable() == false)
+ {
+ throw new DataSourceException("Failed to query column.");
+ }
+
+ try
+ {
+ return dataSource.getObject(column + 1);
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to query column.", e);
+ }
+ }
+
+ public int getColumnCount ()
+ throws DataSourceException
+ {
+ try
+ {
+ return dataSource.getColumnCount();
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to query column count.", e);
+ }
+ }
+
+ public String getColumnName (final int column)
+ throws DataSourceException
+ {
+ try
+ {
+ return dataSource.getColumnName(column + 1);
+ }
+ catch (com.sun.star.report.DataSourceException e)
+ {
+ throw new DataSourceException("Failed to query column name.", e);
+ }
+ }
+
+ public boolean isReadable() throws DataSourceException
+ {
+ return currentRow > 0 && rowCount > 0;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java
new file mode 100644
index 000000000000..6229f76d5419
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/StarReportDataFactory.java
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StarReportDataFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import java.util.HashMap;
+
+import org.jfree.report.ReportDataFactory;
+import org.jfree.report.ReportData;
+import org.jfree.report.DataSet;
+import org.jfree.report.ReportDataFactoryException;
+import com.sun.star.report.DataSourceException;
+import com.sun.star.report.DataSourceFactory;
+
+public class StarReportDataFactory implements ReportDataFactory, Cloneable
+{
+ private DataSourceFactory backend;
+
+ public StarReportDataFactory (DataSourceFactory backend)
+ {
+ this.backend = backend;
+ }
+
+ /**
+ * Queries a datasource. The string 'query' defines the name of the query. The
+ * Parameterset given here may contain more data than actually needed.
+ * <p/>
+ * The dataset may change between two calls, do not assume anything!
+ *
+ * @param query
+ * @param parameters
+ * @return
+ */
+ public ReportData queryData (final String query, final DataSet parameters)
+ throws ReportDataFactoryException
+ {
+ try
+ {
+ final HashMap map = new HashMap();
+ final int count = parameters.getColumnCount();
+ for (int i = 0; i < count; i++)
+ {
+ final Object o = parameters.get(i);
+ map.put (parameters.getColumnName(i), o);
+ }
+ return new StarReportData(backend.queryData(query, map));
+ }
+ catch(DataSourceException dse)
+ {
+ throw new ReportDataFactoryException("Failed to create report data wrapper");
+ }
+ catch (org.jfree.report.DataSourceException e)
+ {
+ throw new ReportDataFactoryException("Failed to query data");
+ }
+ }
+
+ public void open()
+ {
+
+ }
+
+ public void close()
+ {
+
+ }
+
+
+ /**
+ * Derives a freshly initialized report data factory, which is independend of
+ * the original data factory. Opening or Closing one data factory must not
+ * affect the other factories.
+ *
+ * @return
+ */
+ public ReportDataFactory derive()
+ {
+ try
+ {
+ return (ReportDataFactory) clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new IllegalStateException("Clone failed?");
+ }
+ }
+
+ public Object clone () throws CloneNotSupportedException
+ {
+ return super.clone();
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java
new file mode 100644
index 000000000000..3a5dde0e0ae4
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/StarReportModule.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StarReportModule.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho;
+
+import org.jfree.base.modules.AbstractModule;
+import org.jfree.base.modules.ModuleInitializeException;
+import org.jfree.base.modules.SubSystem;
+
+public class StarReportModule extends AbstractModule
+{
+ public StarReportModule ()
+ throws ModuleInitializeException
+ {
+ loadModuleInfo();
+ }
+
+ /**
+ * Initializes the module. Use this method to perform all initial setup operations. This
+ * method is called only once in a modules lifetime. If the initializing cannot be
+ * completed, throw a ModuleInitializeException to indicate the error,. The module will
+ * not be available to the system.
+ *
+ * @param subSystem the subSystem.
+ * @throws org.jfree.base.modules.ModuleInitializeException
+ * if an error ocurred while initializing the module.
+ */
+ public void initialize (SubSystem subSystem)
+ throws ModuleInitializeException
+ {
+
+
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/configuration.properties b/reportdesign/java/com/sun/star/report/pentaho/configuration.properties
new file mode 100644
index 000000000000..784a6c627c64
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/configuration.properties
@@ -0,0 +1,152 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: configuration.properties,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+
+##
+# Do not modify the following lines. They connect this module to the central
+# parser registry.
+org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.model.OfficeDocument.star=com.sun.star.report.pentaho.parser.StarXmlFactoryModule
+org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.model.OfficeStylesCollection.star=com.sun.star.report.pentaho.parser.StarStyleXmlFactoryModule
+org.jfree.resourceloader.factory.modules.com.sun.star.report.pentaho.styles.StyleMapper.star=com.sun.star.report.pentaho.styles.StyleMapperXmlFactoryModule
+
+##
+# The known namespaces.
+#
+org.jfree.report.namespaces.star-rpt.Uri=http://openoffice.org/2005/report
+org.jfree.report.namespaces.star-rpt.Default-Style=res://com/sun/star/report/pentaho/star-rpt.css
+org.jfree.report.namespaces.star-rpt.Prefix=rpt
+org.jfree.report.namespaces.star-rpt.ClassAttr=style-name
+
+org.jfree.report.namespaces.star-office.Uri=http://openoffice.org/2004/office
+org.jfree.report.namespaces.star-office.Default-Style=res://com/sun/star/report/pentaho/star-office.css
+org.jfree.report.namespaces.star-office.Prefix=office
+org.jfree.report.namespaces.star-office.ClassAttr=style-name
+
+org.jfree.report.namespaces.oasis-style.Uri=urn:oasis:names:tc:opendocument:xmlns:style:1.0
+org.jfree.report.namespaces.oasis-style.Default-Style=res://com/sun/star/report/pentaho/oasis-style.css
+org.jfree.report.namespaces.oasis-style.Prefix=style
+
+org.jfree.report.namespaces.oasis-table.Uri=urn:oasis:names:tc:opendocument:xmlns:table:1.0
+org.jfree.report.namespaces.oasis-table.Default-Style=res://com/sun/star/report/pentaho/oasis-table.css
+org.jfree.report.namespaces.oasis-table.Prefix=table
+org.jfree.report.namespaces.oasis-table.ClassAttr=style-name
+
+org.jfree.report.namespaces.oasis-draw.Uri=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0
+org.jfree.report.namespaces.oasis-draw.Default-Style=res://com/sun/star/report/pentaho/oasis-draw.css
+org.jfree.report.namespaces.oasis-draw.Prefix=draw
+org.jfree.report.namespaces.oasis-draw.ClassAttr=style-name
+
+org.jfree.report.namespaces.oasis-text.Uri=urn:oasis:names:tc:opendocument:xmlns:text:1.0
+org.jfree.report.namespaces.oasis-text.Default-Style=res://com/sun/star/report/pentaho/oasis-text.css
+org.jfree.report.namespaces.oasis-text.Prefix=text
+org.jfree.report.namespaces.oasis-text.ClassAttr=style-name
+
+org.jfree.report.namespaces.oasis-number.Uri=urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0
+org.jfree.report.namespaces.oasis-number.Default-Style=res://com/sun/star/report/pentaho/oasis-number.css
+org.jfree.report.namespaces.oasis-number.Prefix=number
+org.jfree.report.namespaces.oasis-number.ClassAttr=style-name
+
+org.jfree.report.namespaces.oasis-form.Uri=urn:oasis:names:tc:opendocument:xmlns:form:1.0
+org.jfree.report.namespaces.oasis-form.Default-Style=res://com/sun/star/report/pentaho/oasis-form.css
+org.jfree.report.namespaces.oasis-form.Prefix=form
+
+#
+# This defines a subset of the real XSL-FO standard.
+org.jfree.report.namespaces.oasis-compat-fo.Uri=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0
+org.jfree.report.namespaces.oasis-compat-fo.Default-Style=res://com/sun/star/report/pentaho/xsl-fo.css
+org.jfree.report.namespaces.oasis-compat-fo.Prefix=fo
+
+#
+# This defines a subset of the real XSL-FO standard.
+org.jfree.report.namespaces.oasis-compat-svg.Uri=urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0
+org.jfree.report.namespaces.oasis-compat-svg.Default-Style=res://com/sun/star/report/pentaho/svg.css
+org.jfree.report.namespaces.oasis-compat-svg.Prefix=svg
+
+#
+# This defines a subset of the real XSL-FO standard.
+org.jfree.report.namespaces.oasis-compat-smil.Uri=urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0
+org.jfree.report.namespaces.oasis-compat-smil.Default-Style=res://com/sun/star/report/pentaho/smil.css
+org.jfree.report.namespaces.oasis-compat-smil.Prefix=svg
+
+org.jfree.report.namespaces.xsl-fo.Uri=http://www.w3.org/1999/XSL/Format
+org.jfree.report.namespaces.xsl-fo.Default-Style=res://com/sun/star/report/pentaho/xsl-fo.css
+org.jfree.report.namespaces.xsl-fo.Prefix=fo
+
+org.jfree.report.namespaces.svg.Uri=http://www.w3.org/2000/svg
+org.jfree.report.namespaces.svg.Default-Style=res://com/sun/star/report/pentaho/svg.css
+org.jfree.report.namespaces.svg.Prefix=svg
+org.jfree.report.namespaces.svg.ClassAttr=class
+org.jfree.report.namespaces.svg.StyleAttr=style
+
+org.jfree.report.namespaces.xml-xlink.Uri=http://www.w3.org/1999/xlink
+#org.jfree.report.namespaces.xml-xlink.Default-Style=res://com/sun/star/report/pentaho/xml-xlink.css
+org.jfree.report.namespaces.xml-xlink.Prefix=xlink
+
+#
+# Tag-definition for the XML-writer.
+# Prefix is 'com.sun.star.report.pentaho.output.'
+#
+# Declare the namespaces (this is independent of the ones defined above ..)
+# <prefix>"namespace."<ns-prefix>=<ns-uri>
+com.sun.star.report.pentaho.output.namespace.oasis-text=urn:oasis:names:tc:opendocument:xmlns:text:1.0
+com.sun.star.report.pentaho.output.default.oasis-text=deny
+
+com.sun.star.report.pentaho.output.namespace.oasis-config=urn:oasis:names:tc:opendocument:xmlns:config:1.0
+com.sun.star.report.pentaho.output.default.oasis-config=allow
+
+#
+# Next define the tags for which we want to customize the indent-behaviour
+com.sun.star.report.pentaho.output.tag.oasis-text.p=deny
+com.sun.star.report.pentaho.output.tag.oasis-text.section=allow
+com.sun.star.report.pentaho.output.tag.oasis-text.variable-decls=allow
+com.sun.star.report.pentaho.output.tag.oasis-text.variable-decl=allow
+
+com.sun.star.report.pentaho.output.tag.oasis-config.config-item=deny
+
+com.sun.star.report.pentaho.output.namespace.oasis-data=urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0
+com.sun.star.report.pentaho.output.default.oasis-data=allow
+com.sun.star.report.pentaho.output.tag.oasis-data.text=deny
+
+
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FixedTextElement=com.sun.star.report.pentaho.layoutprocessor.FixedTextLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.FormattedTextElement=com.sun.star.report.pentaho.layoutprocessor.FormattedTextLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.ImageElement=com.sun.star.report.pentaho.layoutprocessor.ImageElementLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.TableCellElement=com.sun.star.report.pentaho.layoutprocessor.TableCellLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeReport=com.sun.star.report.pentaho.layoutprocessor.OfficeReportLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeGroup=com.sun.star.report.pentaho.layoutprocessor.OfficeGroupLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeGroupSection=com.sun.star.report.pentaho.layoutprocessor.OfficeGroupSectionLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.VariablesDeclarationSection=com.sun.star.report.pentaho.layoutprocessor.VariablesDeclarationLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeDetailSection=com.sun.star.report.pentaho.layoutprocessor.OfficeDetailLayoutController
+org.jfree.report.flow.structure.com.sun.star.report.pentaho.model.OfficeTableSection=com.sun.star.report.pentaho.layoutprocessor.OfficeTableLayoutController
diff --git a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java
new file mode 100644
index 000000000000..2c76b3570d9a
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpression.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SumExpression.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.expressions;
+
+import com.sun.star.report.ReportExpression;
+import com.sun.star.report.DataRow;
+
+public class SumExpression implements ReportExpression
+{
+ private Object[] parameters;
+
+ public SumExpression ()
+ {
+ }
+
+ public Object getParameters ()
+ {
+ return parameters;
+ }
+
+ public Object getValue (DataRow row)
+ {
+
+ return null;
+ }
+
+ public void setParameters (Object[] parameters)
+ {
+ this.parameters = parameters;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java
new file mode 100644
index 000000000000..0b6427e11c14
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SumExpressionMetaData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.expressions;
+
+import java.util.Locale;
+
+import com.sun.star.report.ReportExpressionMetaData;
+
+public class SumExpressionMetaData implements ReportExpressionMetaData
+{
+ public String getDescription (Locale l)
+ {
+ // todo implement me
+ return null;
+ }
+
+ public String getDisplayName (Locale l)
+ {
+ // todo implement me
+ return null;
+ }
+
+ public String getName ()
+ {
+ // todo implement me
+ return null;
+ }
+
+ public int getParameterCount ()
+ {
+ // todo implement me
+ return 0;
+ }
+
+ public String getParameterDescription (int param, Locale locale)
+ {
+ // todo implement me
+ return null;
+ }
+
+ public String getParameterDisplayName (int param, Locale locale)
+ {
+ // todo implement me
+ return null;
+ }
+
+ public String getParameterName (int param)
+ {
+ // todo implement me
+ return null;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java
new file mode 100644
index 000000000000..0b95d6397414
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AbstractReportElementLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.model.ReportElement;
+import com.sun.star.report.pentaho.model.OfficeGroupSection;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.DataRow;
+import org.jfree.report.DataFlags;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Group;
+import org.jfree.report.expressions.Expression;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.AbstractLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.formula.lvalues.LValue;
+import org.jfree.formula.lvalues.ContextLookup;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 05.03.2007
+ * @noinspection CloneableClassWithoutClone
+ */
+public abstract class AbstractReportElementLayoutController
+ extends AbstractLayoutController
+{
+ public static final int NOT_STARTED = 0;
+ public static final int FINISHED = 2;
+
+ private int state;
+
+ protected AbstractReportElementLayoutController()
+ {
+ }
+
+
+ /**
+ * Advances the processing position.
+ *
+ * @param target the report target that receives generated events.
+ * @return the new layout controller instance representing the new state.
+ *
+ * @throws org.jfree.report.DataSourceException if there was a problem reading data from
+ * the datasource.
+ * @throws org.jfree.report.ReportProcessingException if there was a general problem during
+ * the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException if a query failed.
+ */
+ public LayoutController advance(final ReportTarget target)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ if (state != AbstractReportElementLayoutController.NOT_STARTED)
+ {
+ throw new IllegalStateException();
+ }
+
+ boolean isPrintableContent = true;
+ final ReportElement text = (ReportElement) getNode();
+ // Tests we have to perform:
+ // 1. Print when group changes. We can know whether a group changed by
+ // looking at the newly introduced iteration counter.
+ //
+ // Whether we use the next one or the one after that depends on whether
+ // this element is a child of a group-header or group-footer.
+ if (text.isPrintWhenGroupChanges())
+ {
+ // if this is set to true, then we print the element only if this is the
+ // first occurrence in this group.
+ if (isGroupChanged() == false)
+ {
+// Log.debug ("Group Change Condition");
+ isPrintableContent = false;
+ }
+ }
+
+ // 2. Print repeated values. This never applies to static text or static
+ // elements.
+ if (text.isPrintRepeatedValues() == false)
+ {
+ // If this is set to true, we evaluate the formula of the element and
+ // try to derive whether there was a change.
+ if (isValueChanged() == false)
+ {
+// Log.debug ("Value Repeat Condition");
+ isPrintableContent = false;
+ }
+ }
+
+ // 3. Evaluate the Display Condition
+ final Expression dc = text.getDisplayCondition();
+ if (dc != null)
+ {
+ final Object o = LayoutControllerUtil.evaluateExpression
+ (getFlowController(), text, dc);
+ if (Boolean.FALSE.equals(o))
+ {
+// Log.debug ("DISPLAY Condition forbids printing");
+ isPrintableContent = false;
+ }
+ }
+
+ if (isPrintableContent == false)
+ {
+ // There is no printable content at all. Set the state to FINISHED
+ return join (getFlowController());
+ }
+ else
+ {
+ // delegate to the handler ..
+ return delegateContentGeneration(target);
+ }
+
+ }
+
+ protected abstract boolean isValueChanged();
+
+ protected boolean isGroupChanged()
+ {
+ // search the group.
+ final SectionLayoutController slc = findGroup();
+ if (slc == null)
+ {
+ // Always print the content of the report header and footer and
+ // the page header and footer.
+ return true;
+ }
+
+ // we are in the first iteration, so yes, the group has changed recently.
+ return slc.getIterationCount() == 0;
+ }
+
+ private SectionLayoutController findGroup()
+ {
+ LayoutController parent = getParent();
+ boolean skipNext = false;
+ while (parent != null)
+ {
+ if (parent instanceof SectionLayoutController == false)
+ {
+ parent = parent.getParent();
+ continue;
+ }
+
+ final SectionLayoutController slc = (SectionLayoutController) parent;
+ final Element element = slc.getElement();
+ if (element instanceof OfficeGroupSection)
+ {
+ // This is a header or footer. So we take the next group instead.
+ skipNext = true;
+ parent = parent.getParent();
+ continue;
+ }
+
+ if (element instanceof Group == false)
+ {
+ parent = parent.getParent();
+ continue;
+ }
+
+ if (skipNext)
+ {
+ skipNext = false;
+ parent = parent.getParent();
+ continue;
+ }
+
+ return (SectionLayoutController) parent;
+ }
+ return null;
+ }
+
+ /**
+ * Joins with a delegated process flow. This is generally called from a child
+ * flow and should *not* (I mean it!) be called from outside. If you do,
+ * you'll suffer.
+ *
+ * @param flowController the flow controller of the parent.
+ * @return the joined layout controller that incorperates all changes from the
+ * delegate.
+ */
+ public LayoutController join(final FlowController flowController)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ final AbstractReportElementLayoutController alc =
+ (AbstractReportElementLayoutController) clone();
+ alc.state = AbstractReportElementLayoutController.FINISHED;
+ return alc;
+ }
+
+ protected abstract LayoutController delegateContentGeneration (final ReportTarget target)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException;
+
+ /**
+ * Checks, whether the layout controller would be advanceable. If this method
+ * returns true, it is generally safe to call the 'advance()' method.
+ *
+ * @return true, if the layout controller is advanceable, false otherwise.
+ */
+ public boolean isAdvanceable()
+ {
+ return state != AbstractReportElementLayoutController.FINISHED;
+ }
+
+ protected boolean isReferenceChanged (final LValue lValue)
+ {
+ if (lValue instanceof ContextLookup)
+ {
+ final ContextLookup rval = (ContextLookup) lValue;
+ final String s = rval.getName();
+ final DataRow view = getFlowController().getMasterRow().getGlobalView();
+ try
+ {
+ final DataFlags flags = view.getFlags(s);
+ if (flags != null)
+ {
+ if (flags.isChanged())
+ {
+// Log.debug ("Reference " + s + " is changed");
+ return true;
+ }
+ }
+// Log.debug ("Reference " + s + " is unchanged");
+ }
+ catch (DataSourceException e)
+ {
+ // ignore .. assume that the reference has not changed.
+ }
+ }
+ final LValue[] childValues = lValue.getChildValues();
+ for (int i = 0; i < childValues.length; i++)
+ {
+ final LValue value = childValues[i];
+ if (isReferenceChanged(value))
+ {
+ return true;
+ }
+ }
+// Log.debug ("Unchanged.");
+ return false;
+ }
+
+ public int getState()
+ {
+ return state;
+ }
+
+ protected void setState(final int state)
+ {
+ this.state = state;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java
new file mode 100644
index 000000000000..b76b7b5b7921
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedTextLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerFactory;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportContext;
+import org.jfree.report.data.GlobalMasterRow;
+import org.jfree.report.data.ReportDataRow;
+import org.jfree.report.structure.Section;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.DataSourceException;
+import com.sun.star.report.pentaho.model.FixedTextElement;
+
+/**
+ * Processes a fixed-text element of the OpenOffice reporting specifciation.
+ * The element itself contains a single paragraph which contains the content.
+ * After checking, whether this element should be printed, this layout
+ * controller simply delegates the dirty work to a suitable handler.
+ *
+ * @author Thomas Morgner
+ * @noinspection CloneableClassWithoutClone
+ * @since 05.03.2007
+ */
+public class FixedTextLayoutController
+ extends AbstractReportElementLayoutController
+{
+
+ public FixedTextLayoutController()
+ {
+ }
+
+
+ protected boolean isValueChanged()
+ {
+ final FlowController controller = getFlowController();
+ final GlobalMasterRow masterRow = controller.getMasterRow();
+ final ReportDataRow reportDataRow = masterRow.getReportDataRow();
+ if (reportDataRow.getCursor() == 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ protected LayoutController delegateContentGeneration
+ (final ReportTarget target)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException
+ {
+ final FixedTextElement fte = (FixedTextElement) getNode();
+ final Section content = fte.getContent();
+
+ final FlowController flowController = getFlowController();
+ final ReportContext reportContext = flowController.getReportContext();
+ final LayoutControllerFactory layoutControllerFactory =
+ reportContext.getLayoutControllerFactory();
+
+ final FixedTextLayoutController flc = (FixedTextLayoutController) clone();
+ flc.setState(AbstractReportElementLayoutController.FINISHED);
+ return layoutControllerFactory.create(flowController, content, flc);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
new file mode 100755
index 000000000000..d5424e19f522
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java
@@ -0,0 +1,136 @@
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataFlags;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.data.DefaultDataFlags;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
+import org.jfree.util.Log;
+
+/**
+ * Creation-Date: 06.06.2007, 17:03:30
+ *
+ * @author Thomas Morgner
+ */
+public class FormatValueUtility
+{
+ private static SimpleDateFormat dateFormat;
+
+ private FormatValueUtility()
+ {
+ }
+
+ public static void applyValueForVariable(final Object value, final AttributeMap variableSection)
+ {
+ if (value instanceof Date)
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "date");
+ variableSection.setAttribute
+ (OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
+ }
+ else if (value instanceof Number)
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "float");
+ variableSection.setAttribute
+ (OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value));
+ }
+ else if (value instanceof Boolean)
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "boolean");
+ if (Boolean.TRUE.equals(value))
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "true");
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "false");
+ }
+ }
+ else if (value != null)
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "string");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", String.valueOf(value));
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", "string");
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", "");
+ }
+ }
+
+
+ public static void applyValueForCell(final Object value, final AttributeMap variableSection)
+ {
+ if (value instanceof Date)
+ {
+ variableSection.setAttribute
+ (OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value));
+ }
+ else if (value instanceof Number)
+ {
+ variableSection.setAttribute
+ (OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value));
+ }
+ else if (value instanceof Boolean)
+ {
+ if (Boolean.TRUE.equals(value))
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "true");
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "boolean-value", "false");
+ }
+ }
+ else if (value != null)
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", String.valueOf(value));
+ }
+ else
+ {
+ variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "string-value", "");
+ }
+ }
+
+ private static synchronized String formatDate(final Date date)
+ {
+ if (dateFormat == null)
+ {
+ dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'.'S'Z'");
+ }
+ return dateFormat.format(date);
+ }
+
+ public static DataFlags computeDataFlag(final FormattedTextElement element,
+ final FlowController flowController)
+ throws DataSourceException
+ {
+ // here it is relatively easy. We have to evaluate the expression, convert
+ // the result into a string, and print that string.
+ final FormulaExpression formulaExpression = element.getValueExpression();
+ final Object result = LayoutControllerUtil.evaluateExpression
+ (flowController, element, formulaExpression);
+ if (result == null)
+ {
+ // ignore it. Ignoring it is much better than printing 'null'.
+ Log.debug("Formula '" + formulaExpression.getFormula() + "' evaluated to null.");
+ return null;
+ }
+ else if (result instanceof DataFlags)
+ {
+ return (DataFlags) result;
+ }
+ else
+ {
+ return new DefaultDataFlags(null, result, true);
+ }
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
new file mode 100644
index 000000000000..c3c7dbb1bea8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormattedTextLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+import org.jfree.formula.Formula;
+import org.jfree.formula.lvalues.LValue;
+import org.jfree.formula.parser.ParseException;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataFlags;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.structure.Element;
+import org.jfree.util.Log;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 05.03.2007
+ */
+public class FormattedTextLayoutController
+ extends AbstractReportElementLayoutController
+{
+// private Boolean inRepeatingSection;
+
+ public FormattedTextLayoutController()
+ {
+ }
+
+// private boolean isInRepeatingSection ()
+// {
+// if (inRepeatingSection == null)
+// {
+// LayoutController parent = getParent();
+// while (parent != null && inRepeatingSection == null)
+// {
+// if (parent instanceof OfficeRepeatingStructureLayoutController)
+// {
+// final OfficeRepeatingStructureLayoutController orslc =
+// (OfficeRepeatingStructureLayoutController) parent;
+// if (orslc.isNormalFlowProcessing())
+// {
+// inRepeatingSection = Boolean.FALSE;
+// }
+// else
+// {
+// inRepeatingSection = Boolean.TRUE;
+// }
+// }
+// parent = parent.getParent();
+// }
+//
+// if (inRepeatingSection == null)
+// {
+// inRepeatingSection = Boolean.FALSE;
+// }
+// }
+// return inRepeatingSection.booleanValue();
+// }
+
+ private VariablesCollection getVariablesCollection()
+ {
+ LayoutController parent = getParent();
+ while (parent != null)
+ {
+ if (parent instanceof OfficeRepeatingStructureLayoutController)
+ {
+ final OfficeRepeatingStructureLayoutController orslc =
+ (OfficeRepeatingStructureLayoutController) parent;
+ if (orslc.isNormalFlowProcessing())
+ {
+ return null;
+ }
+
+ return orslc.getVariablesCollection();
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ protected boolean isValueChanged()
+ {
+ try
+ {
+ final FormattedTextElement element = (FormattedTextElement) getNode();
+ final FormulaExpression formulaExpression = element.getValueExpression();
+ final Formula formula = formulaExpression.getCompiledFormula();
+ final LValue lValue = formula.getRootReference();
+ return isReferenceChanged(lValue);
+ }
+ catch (final ParseException e)
+ {
+ Log.debug ("Parse Exception" , e);
+ return false;
+ }
+ }
+
+ protected LayoutController delegateContentGeneration(final ReportTarget target)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException
+ {
+ final FormattedTextElement element = (FormattedTextElement) getNode();
+ final VariablesCollection vc = getVariablesCollection();
+ if (vc != null)
+ {
+ final String name = vc.addVariable(element);
+ final AttributeMap variablesGet = new AttributeMap();
+ variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
+ Element.TYPE_ATTRIBUTE, "variable-get");
+ variablesGet.setAttribute(JFreeReportInfo.REPORT_NAMESPACE,
+ Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
+ variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "name", name);
+ //variablesGet.setAttribute(OfficeNamespaces.TEXT_NS, "display", "value");
+ final String valueType = computeValueType();
+ variablesGet.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", valueType);
+ target.startElement(variablesGet);
+
+ target.endElement(variablesGet);
+ }
+ else
+ {
+
+ final DataFlags df = FormatValueUtility.computeDataFlag(element, getFlowController());
+ if (df != null)
+ {
+ target.processContent(df);
+ }
+ }
+
+ return join(getFlowController());
+ }
+
+ private Element getParentTableCell()
+ {
+ LayoutController parent = getParent();
+ while (parent != null)
+ {
+ if (parent instanceof ElementLayoutController)
+ {
+ final ElementLayoutController cellController = (ElementLayoutController) parent;
+ return cellController.getElement();
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ private String computeValueType ()
+ {
+ final Element tce = getParentTableCell();
+ if (tce == null)
+ {
+ // NO particular format means: Fallback to string and hope and pray ..
+ return "string";
+ }
+
+ final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, "value-type");
+ if (type == null)
+ {
+ return "string";
+ }
+ return type;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java
new file mode 100644
index 000000000000..14f9e42c3c36
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageElementContext.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 30.03.2007
+ */
+public class ImageElementContext
+{
+ private int colSpan;
+ private int rowSpan;
+ private String[] rowStyles;
+ private String[] colStyles;
+
+ public ImageElementContext(final int colSpan, final int rowSpan)
+ {
+ this.colSpan = colSpan;
+ this.rowSpan = rowSpan;
+ this.colStyles = new String[colSpan];
+ this.rowStyles = new String[rowSpan];
+ }
+
+ public int getColSpan()
+ {
+ return colSpan;
+ }
+
+ public int getRowSpan()
+ {
+ return rowSpan;
+ }
+
+ public String[] getRowStyles()
+ {
+ return rowStyles;
+ }
+
+ public String[] getColStyles()
+ {
+ return colStyles;
+ }
+
+ public void setRowStyle (final int pos, final String styleName)
+ {
+ rowStyles[pos] = styleName;
+ }
+
+ public void setColStyle (final int pos, final String styleName)
+ {
+ colStyles[pos] = styleName;
+ }
+
+ public String getRowStyle (final int pos)
+ {
+ return rowStyles[pos];
+ }
+
+ public String getColStyle (final int pos)
+ {
+ return colStyles[pos];
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
new file mode 100644
index 000000000000..b378453843ae
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java
@@ -0,0 +1,329 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageElementLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.ImageElement;
+import org.jfree.formula.Formula;
+import org.jfree.formula.lvalues.LValue;
+import org.jfree.formula.parser.ParseException;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.util.TextUtilities;
+import org.jfree.report.data.DefaultDataFlags;
+import org.jfree.report.data.GlobalMasterRow;
+import org.jfree.report.data.ReportDataRow;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Node;
+import org.jfree.util.Log;
+import org.jfree.util.ObjectUtilities;
+
+/**
+ * Produces an image. The image-structures itself (draw:frame and so on) are not generated here. This element produces a
+ * place-holder element and relies on the output target to compute a sensible position for the element. The report
+ * definition does not give any hints about the size of the image, so we have to derive this from the surrounding
+ * context.
+ *
+ * @author Thomas Morgner
+ * @since 05.03.2007
+ */
+public class ImageElementLayoutController
+ extends AbstractReportElementLayoutController
+{
+ private ImageElementContext context;
+
+ public ImageElementLayoutController()
+ {
+ }
+
+ protected LayoutController delegateContentGeneration
+ (final ReportTarget target)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException
+ {
+ final ImageElement imageElement = (ImageElement) getNode();
+ final FormulaExpression formulaExpression = imageElement.getFormula();
+ if (formulaExpression == null)
+ {
+ // A static image is easy. At least at this level. Dont ask about the weird things we have to do in the
+ // output targets ...
+ final String linkTarget = imageElement.getImageData();
+ generateImage(target, linkTarget, imageElement.isScale(), imageElement.isPreserveIRI());
+ }
+ else
+ {
+ final Object value =
+ LayoutControllerUtil.evaluateExpression(getFlowController(), imageElement, formulaExpression);
+ generateImage(target, value, imageElement.isScale(), imageElement.isPreserveIRI());
+ }
+ return join(getFlowController());
+ }
+
+ private void generateImage(final ReportTarget target,
+ final Object linkTarget,
+ final boolean scale,
+ final boolean preserveIri)
+ throws ReportProcessingException, DataSourceException
+ {
+ if (linkTarget == null)
+ {
+ return;
+ }
+
+ final AttributeMap image = new AttributeMap();
+ image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.INTERNAL_NS);
+ image.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "image");
+ image.setAttribute(OfficeNamespaces.INTERNAL_NS, "scale", String.valueOf(scale));
+ image.setAttribute(OfficeNamespaces.INTERNAL_NS, "preserve-IRI", String.valueOf(preserveIri));
+ image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-context", createContext());
+ image.setAttribute(OfficeNamespaces.INTERNAL_NS, "image-data", linkTarget);
+ target.startElement(image);
+ target.endElement(image);
+ }
+
+ protected ImageElementContext createContext()
+ {
+ if (context == null)
+ {
+
+ // Step 1: Find the parent cell.
+ final LayoutController cellController = findParentCell();
+ if (cellController == null)
+ {
+ Log.warn("Image is not contained in a table. Unable to calculate the image-size.");
+ return null;
+ }
+ final Element tableCell = (Element) cellController.getNode();
+ final int rowSpan = TextUtilities.parseInt
+ ((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-rows-spanned"), 1);
+ final int colSpan = TextUtilities.parseInt
+ ((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-cols-spanned"), 1);
+ if (rowSpan < 1 || colSpan < 1)
+ {
+ Log.warn("Rowspan or colspan for image-size calculation was invalid.");
+ return null;
+ }
+
+ final LayoutController rowController = cellController.getParent();
+ if (rowController == null)
+ {
+ Log.warn("Table-Cell has no parent. Unable to calculate the image-size.");
+ return null;
+ }
+ final Section tableRow = (Section) rowController.getNode();
+ // we are now making the assumption, that the row is a section, that contains the table-cell.
+ // This breaks the ability to return nodes or to construct reports on the fly, but the OO-report format
+ // is weird anyway and wont support such advanced techniques for the next few centuries ..
+ final int columnPos = findNodeInSection(tableRow, tableCell);
+ if (columnPos == -1)
+ {
+ Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size.");
+ return null;
+ }
+
+ final LayoutController tableController = rowController.getParent();
+ if (tableController == null)
+ {
+ Log.warn("Table-Row has no Table. Unable to calculate the image-size.");
+ return null;
+ }
+
+ final Section table = (Section) tableController.getNode();
+ // ok, we got a table, so as next we have to search for the columns now.
+ final Section columns = (Section) table.findFirstChild(OfficeNamespaces.TABLE_NS, "table-columns");
+ if (columns.getNodeCount() <= columnPos + colSpan)
+ {
+ // the colspan is to large. The table definition is therefore invalid. We do not try to fix this.
+ Log.warn(
+ "The Table's defined columns do not match the col-span or col-position. Unable to calculate the image-size.");
+ return null;
+ }
+
+ final ImageElementContext context = new ImageElementContext(colSpan, rowSpan);
+
+ final Node[] columnDefs = columns.getNodeArray();
+ int columnCounter = 0;
+ for (int i = 0; i < columnDefs.length; i++)
+ {
+ final Element column = (Element) columnDefs[i];
+
+ if (ObjectUtilities.equal(column.getNamespace(), OfficeNamespaces.TABLE_NS) == false ||
+ ObjectUtilities.equal(column.getType(), "table-column") == false)
+ {
+ continue;
+ }
+ if (columnCounter >= columnPos)
+ {
+ final String colStyle = (String) column.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ context.setColStyle(columnCounter - columnPos, colStyle);
+ }
+
+ columnCounter += 1;
+
+ if (columnCounter >= (columnPos + colSpan))
+ {
+ break;
+ }
+
+ }
+
+ // finally search the styles for the row now.
+ final int rowPos = findNodeInSection(table, tableRow);
+ if (rowPos == -1)
+ {
+ Log.warn("Table-Cell is not a direct child of the table-row. Unable to calculate the image-size.");
+ return null;
+ }
+
+ final Node[] rows = table.getNodeArray();
+ int rowCounter = 0;
+ for (int i = 0; i < rows.length; i++)
+ {
+ final Element row = (Element) rows[i];
+
+ if (ObjectUtilities.equal(row.getNamespace(), OfficeNamespaces.TABLE_NS) == false ||
+ ObjectUtilities.equal(row.getType(), "table-row") == false)
+ {
+ continue;
+ }
+ if (rowCounter >= rowPos)
+ {
+ final String rowStyle = (String) row.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ context.setRowStyle(rowCounter - rowPos, rowStyle);
+ }
+
+ rowCounter += 1;
+
+ if (rowCounter >= (rowPos + rowSpan))
+ {
+ break;
+ }
+ }
+ this.context = context;
+ }
+ return this.context;
+ }
+
+ private int findNodeInSection(final Section tableRow,
+ final Element tableCell)
+ {
+ int retval = 0;
+ final Node[] nodes = tableRow.getNodeArray();
+ final String namespace = tableCell.getNamespace();
+ final String type = tableCell.getType();
+ for (int i = 0; i < nodes.length; i++)
+ {
+ final Node node = nodes[i];
+ if (node instanceof Element == false)
+ {
+ continue;
+ }
+ final Element child = (Element) node;
+ if (ObjectUtilities.equal(child.getNamespace(), namespace) == false ||
+ ObjectUtilities.equal(child.getType(), type) == false)
+ {
+ continue;
+ }
+
+ if (node == tableCell)
+ {
+ return retval;
+ }
+ retval += 1;
+ }
+ return -1;
+ }
+
+ private LayoutController findParentCell()
+ {
+ LayoutController parent = getParent();
+ while (parent != null)
+ {
+ final Object node = parent.getNode();
+ if (node instanceof Element)
+ {
+ final Element element = (Element) node;
+ if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table-cell".equals(element.getType()))
+ {
+ return parent;
+ }
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ protected boolean isValueChanged()
+ {
+ final ImageElement imageElement = (ImageElement) getNode();
+ final FormulaExpression formulaExpression = imageElement.getFormula();
+ if (formulaExpression == null)
+ {
+ final FlowController controller = getFlowController();
+ final GlobalMasterRow masterRow = controller.getMasterRow();
+ final ReportDataRow reportDataRow = masterRow.getReportDataRow();
+ if (reportDataRow.getCursor() == 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ try
+ {
+ final Formula formula = formulaExpression.getCompiledFormula();
+ final LValue lValue = formula.getRootReference();
+ return isReferenceChanged(lValue);
+ }
+ catch (ParseException e)
+ {
+ return false;
+ }
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java
new file mode 100644
index 000000000000..2b3ef8df1b92
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeDetailLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.ReportData;
+import org.jfree.report.data.GlobalMasterRow;
+import org.jfree.report.data.ReportDataRow;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+
+/**
+ * Creation-Date: 11.04.2007, 11:04:02
+ *
+ * @author Thomas Morgner
+ */
+public class OfficeDetailLayoutController extends SectionLayoutController
+{
+ public static final int STATE_PROCESS_VARIABLES = 2;
+ public static final int STATE_PROCESS_NORMAL_FLOW = 3;
+
+ private boolean waitForJoin;
+ private int state;
+
+ public OfficeDetailLayoutController()
+ {
+ }
+
+ /**
+ * Initializes the layout controller. This method is called exactly once. It
+ * is the creators responsibility to call this method.
+ * <p/>
+ * Calling initialize after the first advance must result in a
+ * IllegalStateException.
+ *
+ * @param node the currently processed object or layout node.
+ * @param flowController the current flow controller.
+ * @param parent the parent layout controller that was responsible for
+ * instantiating this controller.
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ public void initialize(final Object node,
+ final FlowController flowController,
+ final LayoutController parent)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ super.initialize(node, flowController, parent);
+ state = OfficeDetailLayoutController.STATE_PROCESS_VARIABLES;
+ }
+
+ /**
+ * This method is called for each newly instantiated layout controller. The returned layout controller instance should
+ * have a processing state of either 'OPEN' or 'FINISHING' depending on whether there is any content or any child
+ * nodes to process.
+ *
+ * @param target the report target that receives generated events.
+ * @return the new layout controller instance representing the new state.
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ protected LayoutController startElement(final ReportTarget target)
+ throws DataSourceException, ReportProcessingException, ReportDataFactoryException
+ {
+ final FlowController fc = getFlowController();
+ final GlobalMasterRow masterRow = fc.getMasterRow();
+ final ReportDataRow reportDataRow = masterRow.getReportDataRow();
+ final ReportData reportData = reportDataRow.getReportData();
+ if (reportData.isReadable() == false)
+ {
+ reportData.isReadable();
+ // If this report has no data, then do not print the detail section. The detail section
+ // is the only section that behaves this way, and for now this is only done in the OO-implementation
+ final SectionLayoutController derived = (SectionLayoutController) clone();
+ derived.setProcessingState(ElementLayoutController.FINISHED);
+ derived.setFlowController(fc);
+ return derived;
+ }
+
+ if (state == OfficeDetailLayoutController.STATE_PROCESS_VARIABLES)
+ {
+ final VariablesDeclarationSection variables = new VariablesDeclarationSection();
+ final OfficeDetailLayoutController controller = (OfficeDetailLayoutController) clone();
+ controller.state = OfficeDetailLayoutController.STATE_PROCESS_NORMAL_FLOW;
+ controller.waitForJoin = true;
+ return processChild(controller, variables, fc);
+ }
+
+ return super.startElement(target);
+ }
+
+ protected void resetSectionForRepeat()
+ {
+ super.resetSectionForRepeat();
+ state = STATE_PROCESS_VARIABLES;
+ }
+
+ /**
+ * Joins with a delegated process flow. This is generally called from a child
+ * flow and should *not* (I mean it!) be called from outside. If you do,
+ * you'll suffer.
+ *
+ * @param flowController the flow controller of the parent.
+ * @return the joined layout controller that incorperates all changes from the
+ * delegate.
+ */
+ public LayoutController join(final FlowController flowController)
+ {
+ if (waitForJoin)
+ {
+ final OfficeDetailLayoutController derived = (OfficeDetailLayoutController) clone();
+ derived.setProcessingState(ElementLayoutController.NOT_STARTED);
+ derived.setFlowController(flowController);
+ derived.waitForJoin = false;
+ return derived;
+ }
+ return super.join(flowController);
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java
new file mode 100644
index 000000000000..1de27c0a6f10
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java
@@ -0,0 +1,218 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeGroupLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeGroup;
+import com.sun.star.report.pentaho.model.OfficeGroupSection;
+import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 15.03.2007
+ */
+public class OfficeGroupLayoutController extends SectionLayoutController
+ implements OfficeRepeatingStructureLayoutController
+{
+ public static final int STATE_PROCESS_REPEATING_HEADER = 0;
+ public static final int STATE_PROCESS_REPEATING_FOOTER = 1;
+ public static final int STATE_PROCESS_VARIABLES = 2;
+ public static final int STATE_PROCESS_NORMAL_FLOW = 3;
+ private boolean waitForJoin;
+ private int state;
+ private VariablesCollection variablesCollection;
+
+ public OfficeGroupLayoutController()
+ {
+ }
+
+
+ /**
+ * Initializes the layout controller. This method is called exactly once. It
+ * is the creators responsibility to call this method.
+ * <p/>
+ * Calling initialize after the first advance must result in a
+ * IllegalStateException.
+ *
+ * @param node the currently processed object or layout node.
+ * @param flowController the current flow controller.
+ * @param parent the parent layout controller that was responsible for
+ * instantiating this controller.
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ public void initialize(final Object node,
+ final FlowController flowController,
+ final LayoutController parent)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ super.initialize(node, flowController, parent);
+ state = OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER;
+ variablesCollection = new VariablesCollection(computeVariablesPrefix());
+ }
+
+
+ protected LayoutController processContent(final ReportTarget target)
+ throws DataSourceException, ReportProcessingException,
+ ReportDataFactoryException
+ {
+ if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER)
+ {
+ final OfficeGroup group = (OfficeGroup) getElement();
+ final OfficeGroupSection header =
+ (OfficeGroupSection) group.findFirstChild
+ (OfficeNamespaces.OOREPORT_NS, "group-header");
+
+ final OfficeGroupLayoutController controller =
+ (OfficeGroupLayoutController) clone();
+ controller.state =
+ OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER;
+
+ if (header == null || header.isRepeatSection() == false)
+ {
+ return controller;
+ }
+
+ controller.waitForJoin = true;
+ return processChild(controller, header, getFlowController());
+ }
+
+ if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER)
+ {
+ final OfficeGroup group = (OfficeGroup) getElement();
+ final OfficeGroupSection footer =
+ (OfficeGroupSection) group.findFirstChild
+ (OfficeNamespaces.OOREPORT_NS, "group-footer");
+
+ final OfficeGroupLayoutController controller =
+ (OfficeGroupLayoutController) clone();
+ controller.state =
+ OfficeGroupLayoutController.STATE_PROCESS_VARIABLES;
+
+ if (footer == null || footer.isRepeatSection() == false)
+ {
+ return controller;
+ }
+
+ controller.waitForJoin = true;
+ return processChild(controller, footer, getFlowController());
+ }
+
+ if (state == OfficeGroupLayoutController.STATE_PROCESS_VARIABLES)
+ {
+ // todo: Fill the variables section with something sensible ..
+ final VariablesDeclarationSection variables =
+ new VariablesDeclarationSection();
+ final OfficeGroupLayoutController controller =
+ (OfficeGroupLayoutController) clone();
+ controller.state =
+ OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW;
+ controller.waitForJoin = true;
+ return processChild(controller, variables, getFlowController());
+ }
+ return super.processContent(target);
+ }
+
+ protected void resetSectionForRepeat()
+ {
+ super.resetSectionForRepeat();
+ state = STATE_PROCESS_VARIABLES;
+ }
+
+ /**
+ * Joins with a delegated process flow. This is generally called from a child
+ * flow and should *not* (I mean it!) be called from outside. If you do,
+ * you'll suffer.
+ *
+ * @param flowController the flow controller of the parent.
+ * @return the joined layout controller that incorperates all changes from the
+ * delegate.
+ */
+ public LayoutController join(final FlowController flowController)
+ {
+ if (waitForJoin)
+ {
+ final OfficeGroupLayoutController derived = (OfficeGroupLayoutController) clone();
+ derived.setProcessingState(ElementLayoutController.OPENED);
+ derived.setFlowController(flowController);
+ derived.waitForJoin = false;
+ return derived;
+ }
+ return super.join(flowController);
+ }
+
+ public boolean isNormalFlowProcessing ()
+ {
+ return state == OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW;
+ }
+
+ private String computeVariablesPrefix()
+ {
+ int count = 0;
+ LayoutController lc = this;
+ while (lc != null)
+ {
+ if (lc instanceof OfficeGroupLayoutController)
+ {
+ count += 1;
+ }
+ lc = lc.getParent();
+ }
+ return "auto_group_" + count + "_";
+ }
+
+ public VariablesCollection getVariablesCollection()
+ {
+ return variablesCollection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java
new file mode 100644
index 000000000000..3de276e4e3fe
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeGroupSectionLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.structure.Element;
+import org.jfree.report.DataSourceException;
+import org.jfree.layouting.util.AttributeMap;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * This layoutcontroller simply checks, whether the parent layout controller
+ * is a OfficeGroupLayoutController and whether this layout controller is
+ * processing the normal flow or an repeating section. If a repeating section
+ * is being processed, an marker attribute is added to the element's call
+ * to OutputProcessor.startElement() and OutputProcessor.endElement().
+ *
+ * @author Thomas Morgner
+ * @since 19.03.2007
+ */
+public class OfficeGroupSectionLayoutController extends SectionLayoutController
+{
+
+ public OfficeGroupSectionLayoutController()
+ {
+ }
+
+
+ protected AttributeMap computeAttributes(final FlowController fc,
+ final Element element,
+ final ReportTarget target)
+ throws DataSourceException
+ {
+ final AttributeMap attrs = super.computeAttributes(fc, element, target);
+ final LayoutController controller = getParent();
+ if (controller instanceof OfficeGroupLayoutController == false)
+ {
+ return attrs;
+ }
+ final OfficeGroupLayoutController oglc =
+ (OfficeGroupLayoutController) controller;
+ if (oglc.isNormalFlowProcessing())
+ {
+ return attrs;
+ }
+
+ attrs.setAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section", "true");
+ return attrs;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java
new file mode 100644
index 000000000000..902d725be616
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeRepeatingStructureLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 22.03.2007
+ */
+public interface OfficeRepeatingStructureLayoutController extends LayoutController
+{
+ public boolean isNormalFlowProcessing();
+
+ public VariablesCollection getVariablesCollection();
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java
new file mode 100644
index 000000000000..2c7f739abd17
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeReportLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:05 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.model.OfficeReport;
+import com.sun.star.report.pentaho.model.VariablesDeclarationSection;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportContext;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.ElementLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerFactory;
+import org.jfree.report.structure.Node;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 06.03.2007
+ */
+public class OfficeReportLayoutController extends ElementLayoutController
+ implements OfficeRepeatingStructureLayoutController
+{
+ private static final int STATE_NOT_STARTED = 0;
+ private static final int STATE_TEMPLATES = 1;
+ private static final int STATE_PAGE_HEADER_DONE = 2;
+ private static final int STATE_PAGE_FOOTER_DONE = 3;
+ private static final int STATE_COLUMN_HEADER_DONE = 4;
+ private static final int STATE_COLUMN_FOOTER_DONE = 5;
+ private static final int STATE_INITIAL_VARIABLES_DONE = 6;
+ private static final int STATE_REPORT_HEADER_DONE = 7;
+ private static final int STATE_REPORT_BODY_DONE = 8;
+ private static final int STATE_REPORT_FOOTER_VARIABLES = 9;
+ private static final int STATE_REPORT_FOOTER_DONE = 10;
+
+ private int state;
+ private VariablesCollection variablesCollection;
+
+ public OfficeReportLayoutController()
+ {
+ }
+
+
+ /**
+ * Initializes the layout controller. This method is called exactly once. It
+ * is the creators responsibility to call this method.
+ * <p/>
+ * Calling initialize after the first advance must result in a
+ * IllegalStateException.
+ *
+ * @param node the currently processed object or layout node.
+ * @param flowController the current flow controller.
+ * @param parent the parent layout controller that was responsible for
+ * instantiating this controller.
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ public void initialize(final Object node, final FlowController flowController,
+ final LayoutController parent)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ super.initialize(node, flowController, parent);
+ variablesCollection = new VariablesCollection("auto_report_");
+ }
+
+ /**
+ * Processes any content in this element. This method is called when the
+ * processing state is 'OPENED'. The returned layout controller will retain
+ * the 'OPENED' state as long as there is more content available. Once all
+ * content has been processed, the returned layout controller should carry a
+ * 'FINISHED' state.
+ *
+ * @param target the report target that receives generated events.
+ * @return the new layout controller instance representing the new state.
+ *
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ protected LayoutController processContent(final ReportTarget target)
+ throws DataSourceException, ReportProcessingException,
+ ReportDataFactoryException
+ {
+ final OfficeReport or = (OfficeReport) getElement();
+
+ switch (state)
+ {
+ case OfficeReportLayoutController.STATE_NOT_STARTED:
+ {
+ return delegateToTemplace(OfficeReportLayoutController.STATE_TEMPLATES);
+ }
+ case OfficeReportLayoutController.STATE_TEMPLATES:
+ {
+ return delegateSection(or.getPageHeader(),
+ OfficeReportLayoutController.STATE_PAGE_HEADER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_PAGE_HEADER_DONE:
+ {
+ return delegateSection(or.getPageFooter(),
+ OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE:
+ {
+ return delegateSection(or.getColumnHeader(),
+ OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE:
+ {
+ return delegateSection(or.getColumnFooter(),
+ OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE:
+ {
+ return delegateSection(new VariablesDeclarationSection(),
+ OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE);
+ }
+ case OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE:
+ {
+ return delegateSection(or.getReportHeader(),
+ OfficeReportLayoutController.STATE_REPORT_HEADER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_REPORT_HEADER_DONE:
+ {
+ return delegateSection(or.getBodySection(),
+ OfficeReportLayoutController.STATE_REPORT_BODY_DONE);
+ }
+ case OfficeReportLayoutController.STATE_REPORT_BODY_DONE:
+ {
+ return delegateSection(new VariablesDeclarationSection(),
+ OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES);
+ }
+ case OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES:
+ {
+ return delegateSection(or.getReportFooter(),
+ OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE);
+ }
+ case OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE:
+ {
+ final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
+ olc.setProcessingState(ElementLayoutController.FINISHING);
+ return olc;
+ }
+ default:
+ {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ private LayoutController delegateToTemplace(final int nextState)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException
+ {
+ final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
+ olc.state = nextState;
+
+ final OfficeTableTemplateLayoutController templateLc = new OfficeTableTemplateLayoutController();
+ templateLc.initialize(getElement(), getFlowController(), olc);
+ return templateLc;
+
+ }
+
+ private LayoutController delegateSection(final Node n, final int nextState)
+ throws ReportProcessingException, ReportDataFactoryException,
+ DataSourceException
+ {
+ final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone();
+ olc.state = nextState;
+ if (n == null)
+ {
+ return olc;
+ }
+
+ final FlowController flowController = getFlowController();
+ final ReportContext reportContext = flowController.getReportContext();
+ final LayoutControllerFactory layoutControllerFactory =
+ reportContext.getLayoutControllerFactory();
+ return layoutControllerFactory.create(flowController, n, olc);
+
+ }
+
+
+ /**
+ * Joins with a delegated process flow. This is generally called from a child
+ * flow and should *not* (I mean it!) be called from outside. If you do,
+ * you'll suffer.
+ *
+ * @param flowController the flow controller of the parent.
+ * @return the joined layout controller that incorperates all changes from the
+ * delegate.
+ */
+ public LayoutController join(final FlowController flowController)
+ {
+ final OfficeReportLayoutController derived = (OfficeReportLayoutController) clone();
+ derived.setFlowController(flowController);
+ return derived;
+ }
+
+ public boolean isNormalFlowProcessing()
+ {
+ return state != OfficeReportLayoutController.STATE_PAGE_HEADER_DONE &&
+ state != OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE;
+ }
+
+ public VariablesCollection getVariablesCollection()
+ {
+ return variablesCollection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java
new file mode 100644
index 000000000000..d115e5e9d2bf
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeTableLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Node;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.util.IntegerCache;
+import org.jfree.layouting.util.AttributeMap;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Creation-Date: 24.04.2007, 14:40:20
+ *
+ * @author Thomas Morgner
+ */
+public class OfficeTableLayoutController extends SectionLayoutController
+{
+ public OfficeTableLayoutController()
+ {
+ }
+
+ protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target)
+ throws DataSourceException
+ {
+ final AttributeMap attributeMap = super.computeAttributes(fc, element, target);
+ final Section s = (Section) element;
+ int rowCount = 0;
+ final Node[] nodeArray = s.getNodeArray();
+ for (int i = 0; i < nodeArray.length; i++)
+ {
+ final Node node = nodeArray[i];
+ if (node instanceof Element == false)
+ {
+ continue;
+ }
+ final Element child = (Element) node;
+ if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) &&
+ "table-row".equals(child.getType()))
+ {
+ rowCount += 1;
+ }
+ }
+ attributeMap.setAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count", IntegerCache.getInteger(rowCount));
+ return attributeMap;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java
new file mode 100644
index 000000000000..090fa99affa8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java
@@ -0,0 +1,176 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeTableTemplateLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeGroup;
+import com.sun.star.report.pentaho.model.OfficeReport;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+
+/**
+ * Creation-Date: 24.04.2007, 16:06:52
+ *
+ * @author Thomas Morgner
+ */
+public class OfficeTableTemplateLayoutController extends SectionLayoutController
+{
+ private Node[] nodes;
+
+ public OfficeTableTemplateLayoutController()
+ {
+ }
+
+ /**
+ * Initializes the layout controller. This method is called exactly once. It is the creators responsibility to call
+ * this method.
+ * <p/>
+ * Calling initialize after the first advance must result in a IllegalStateException.
+ *
+ * @param node the currently processed object or layout node.
+ * @param flowController the current flow controller.
+ * @param parent the parent layout controller that was responsible for instantiating this controller.
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ public void initialize(final Object node, final FlowController flowController, final LayoutController parent)
+ throws DataSourceException, ReportDataFactoryException, ReportProcessingException
+ {
+ final Section section = new Section();
+ section.setNamespace(OfficeNamespaces.INTERNAL_NS);
+ section.setType("template");
+ super.initialize(section, flowController, parent);
+
+ final OfficeReport report = (OfficeReport) node;
+ final ArrayList tables = new ArrayList();
+ if (report.getReportHeader() != null)
+ {
+ addFromSection(tables, (Section) report.getReportHeader());
+ }
+ addFromBody(tables, (Section) report.getBodySection());
+ if (report.getReportFooter() != null)
+ {
+ addFromSection(tables, (Section) report.getReportFooter());
+ }
+
+ this.nodes = (Node[]) tables.toArray(new Node[tables.size()]);
+ }
+
+ private void addFromBody(final ArrayList tables, final Section section)
+ {
+ final Node[] nodeArray = section.getNodeArray();
+ for (int i = 0; i < nodeArray.length; i++)
+ {
+ final Node node = nodeArray[i];
+ if (node instanceof Section == false)
+ {
+ continue;
+ }
+ final Section child = (Section) node;
+ if (node instanceof OfficeGroup)
+ {
+ addFromGroup(tables, child);
+ }
+ else
+ {
+ addFromSection(tables, child);
+ }
+ }
+ }
+
+ private void addFromGroup(final ArrayList tables, final Section section)
+ {
+ final Node[] nodeArray = section.getNodeArray();
+ for (int i = 0; i < nodeArray.length; i++)
+ {
+ final Node node = nodeArray[i];
+ if (node instanceof Section == false)
+ {
+ continue;
+ }
+
+ final Section element = (Section) node;
+ if (OfficeNamespaces.INTERNAL_NS.equals(element.getNamespace()) && "group-body".equals(element.getType()))
+ {
+ addFromBody(tables, element);
+ }
+ else
+ {
+ addFromSection(tables, element);
+ }
+ }
+ }
+
+ private void addFromSection(final ArrayList tables, final Section section)
+ {
+ final Node[] nodeArray = section.getNodeArray();
+ for (int i = 0; i < nodeArray.length; i++)
+ {
+ final Node node = nodeArray[i];
+ if (node instanceof Element == false)
+ {
+ continue;
+ }
+
+ final Element element = (Element) node;
+ if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) &&
+ "table".equals(element.getType()))
+ {
+ tables.add(element);
+ }
+ }
+ }
+
+ public Node[] getNodes()
+ {
+ return nodes;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
new file mode 100644
index 000000000000..d51bd0ab1f91
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableCellLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FormatCondition;
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+import com.sun.star.report.pentaho.model.ReportElement;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.DataFlags;
+import org.jfree.report.expressions.Expression;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
+import org.jfree.report.flow.layoutprocessor.SectionLayoutController;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+import org.jfree.util.ObjectUtilities;
+
+/**
+ * Before writing the table cell, we have to evaluate the childs of the cell. The cell itself can either be empty or it
+ * has a one ore more paragraphs inside. The paragraph contains a single report element, but may contain additional
+ * other content.
+ *
+ * @author Thomas Morgner
+ * @noinspection CloneableClassWithoutClone
+ * @since 05.03.2007
+ */
+public class TableCellLayoutController extends SectionLayoutController
+{
+ public TableCellLayoutController()
+ {
+ }
+
+ protected AttributeMap computeAttributes(final FlowController fc,
+ final Element element,
+ final ReportTarget target)
+ throws DataSourceException
+ {
+ final AttributeMap attributeMap = super.computeAttributes(fc, element, target);
+ final String definedStyle = (String) attributeMap.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ attributeMap.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", getDisplayStyleName((Section) element, definedStyle));
+
+ try
+ {
+ final DataFlags value = computeValue();
+ if (value != null)
+ {
+ FormatValueUtility.applyValueForCell(value.getValue(), attributeMap);
+ }
+ }
+ catch (Exception e)
+ {
+ // ignore ..
+ }
+ return attributeMap;
+ }
+
+ private DataFlags computeValue() throws DataSourceException
+ {
+ // Search for the first FormattedTextElement
+ final Section cell = (Section) getElement();
+ final FormattedTextElement element = findFormattedTextElement(cell);
+ if (element == null)
+ {
+ return null;
+ }
+ return FormatValueUtility.computeDataFlag(element, getFlowController());
+ }
+
+ private FormattedTextElement findFormattedTextElement(final Section section)
+ {
+ final Node[] nodeArray = section.getNodeArray();
+ for (int i = 0; i < nodeArray.length; i++)
+ {
+ final Node node = nodeArray[i];
+ if (node instanceof FormattedTextElement)
+ {
+ return (FormattedTextElement) node;
+ }
+ if (node instanceof Section)
+ {
+ final FormattedTextElement retval = findFormattedTextElement((Section) node);
+ if (retval != null)
+ {
+ return retval;
+ }
+ }
+ }
+ return null;
+ }
+
+ private String getDisplayStyleName(final Section section,
+ final String defaultStyle)
+ {
+ if (section.isEnabled() == false)
+ {
+ return defaultStyle;
+ }
+ if (section.getNodeCount() == 0)
+ {
+ return defaultStyle;
+ }
+
+ final Node[] nodes = section.getNodeArray();
+ for (int i = 0; i < nodes.length; i++)
+ {
+ final Node child = nodes[i];
+ if (child instanceof ReportElement)
+ {
+ final ReportElement element = (ReportElement) child;
+ if (element.isEnabled() == false)
+ {
+ continue;
+ }
+
+ if (element.getFormatConditionCount() == 0)
+ {
+ continue;
+ }
+
+ final Expression displayCond = element.getDisplayCondition();
+ if (displayCond != null)
+ {
+ try
+ {
+ if (Boolean.FALSE.equals(LayoutControllerUtil.evaluateExpression
+ (getFlowController(), element, displayCond)))
+ {
+ continue;
+ }
+ }
+ catch (DataSourceException e)
+ {
+ // ignore silently ..
+ }
+ }
+
+ final FormatCondition[] conditions = element.getFormatConditions();
+ for (int j = 0; j < conditions.length; j++)
+ {
+ final FormatCondition formCond = conditions[j];
+ if (formCond.isEnabled() == false)
+ {
+ continue;
+ }
+
+ try
+ {
+ final Object o = LayoutControllerUtil.evaluateExpression
+ (getFlowController(), element, formCond.getFormula());
+ if (Boolean.TRUE.equals(o))
+ {
+ return formCond.getStyleName();
+ }
+ }
+ catch (DataSourceException e)
+ {
+ // ignore silently ..
+ }
+ }
+ }
+
+ if (child instanceof Section)
+ {
+ final String childFormatCondition =
+ getDisplayStyleName((Section) child, defaultStyle);
+ if (ObjectUtilities.equal(childFormatCondition, defaultStyle) == false)
+ {
+ return childFormatCondition;
+ }
+ }
+ }
+ return defaultStyle;
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java
new file mode 100644
index 000000000000..939e4093abc1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VariablesCollection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+
+/**
+ * A variables collection is used to collect all FormattedTextElement objects
+ * of a repeated header or footer. Later, for each of these elements a variable
+ * setter is inserted into a hidden (in fact just very small) paragraph. These
+ * variables can later be read using the 'variable-get' construct.
+ *
+ * From the idea, this is equal to the 'strings' declaration of CSS3, although
+ * this code is explicit instead of declarative.
+ *
+ * @author Thomas Morgner
+ * @since 22.03.2007
+ */
+public class VariablesCollection
+{
+ private VariablesCollection parent;
+ private String namePrefix;
+ private ArrayList variables;
+
+ public VariablesCollection(final String namePrefix)
+ {
+ this(namePrefix, null);
+ }
+
+ public VariablesCollection(final String namePrefix, final VariablesCollection parent)
+ {
+ if (namePrefix == null)
+ {
+ throw new NullPointerException("NamePrefix cannot be null");
+ }
+
+ this.namePrefix = namePrefix;
+ this.parent = parent;
+ this.variables = new ArrayList();
+ }
+
+ public VariablesCollection getParent()
+ {
+ return parent;
+ }
+
+ public String getNamePrefix()
+ {
+ return namePrefix;
+ }
+
+ public String addVariable (final FormattedTextElement element)
+ {
+ variables.add(element);
+ final int size = variables.size();
+ return namePrefix + size;
+ }
+
+ public FormattedTextElement[] getVariables ()
+ {
+ return (FormattedTextElement[])
+ variables.toArray(new FormattedTextElement[variables.size()]);
+ }
+
+ public int getVariablesCount ()
+ {
+ return variables.size();
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java
new file mode 100644
index 000000000000..5893714d77a8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VariablesDeclarationLayoutController.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.layoutprocessor;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.flow.FlowController;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.layoutprocessor.AbstractLayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutController;
+import org.jfree.report.flow.layoutprocessor.LayoutControllerUtil;
+import org.jfree.report.structure.Element;
+
+/**
+ * Writes a full variables-declaration section.
+ *
+ * @author Thomas Morgner
+ * @since 20.03.2007
+ */
+public class VariablesDeclarationLayoutController
+ extends AbstractLayoutController
+{
+ private boolean processed;
+
+ public VariablesDeclarationLayoutController()
+ {
+ }
+
+ private OfficeRepeatingStructureLayoutController getRepeatingParent()
+ {
+ LayoutController parent = getParent();
+ while (parent != null)
+ {
+ if (parent instanceof OfficeRepeatingStructureLayoutController)
+ {
+ return (OfficeRepeatingStructureLayoutController) parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+
+ /**
+ * Advances the processing position.
+ *
+ * @param target the report target that receives generated events.
+ * @return the new layout controller instance representing the new state.
+ *
+ * @throws org.jfree.report.DataSourceException
+ * if there was a problem reading data from the datasource.
+ * @throws org.jfree.report.ReportProcessingException
+ * if there was a general problem during the report processing.
+ * @throws org.jfree.report.ReportDataFactoryException
+ * if a query failed.
+ */
+ public LayoutController advance(final ReportTarget target)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ if (processed)
+ {
+ throw new IllegalStateException("Already processed.");
+ }
+
+ final VariablesDeclarationLayoutController vlc =
+ (VariablesDeclarationLayoutController) clone();
+ vlc.processed = true;
+
+ final OfficeRepeatingStructureLayoutController orslc = getRepeatingParent();
+ if (orslc == null)
+ {
+ // There is no repeating parent. What the heck are we doing here ..
+ return vlc;
+ }
+
+ final VariablesCollection collection = orslc.getVariablesCollection();
+ if (collection.getVariablesCount() == 0)
+ {
+ // no processing necessary, as the header or footer contain no variables at all ..
+ return vlc;
+ }
+
+
+ final Element node = (Element) getNode();
+ final AttributeMap vdSection = node.getAttributeMap();
+ target.startElement(vdSection);
+
+ final FormattedTextElement[] variables = collection.getVariables();
+ for (int i = 0; i < variables.length; i++)
+ {
+ final FormattedTextElement variable = variables[i];
+ final String varName = collection.getNamePrefix() + (i + 1);
+ final AttributeMap map = generateVariableSetSection(variable);
+ map.setAttribute(OfficeNamespaces.TEXT_NS, "name", varName);
+ target.startElement(map);
+ target.endElement(map);
+
+ }
+ target.endElement(vdSection);
+ return vlc;
+ }
+
+ private AttributeMap generateVariableSetSection(final FormattedTextElement variable)
+ throws DataSourceException
+ {
+ final AttributeMap variableSection = new AttributeMap();
+ variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
+ variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set");
+ variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none");
+
+ final FormulaExpression valueExpression = variable.getValueExpression();
+ final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression);
+ FormatValueUtility.applyValueForVariable(value, variableSection);
+ variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + String.valueOf(value));
+ return variableSection;
+ }
+
+ /**
+ * Checks, whether the layout controller would be advanceable. If this method
+ * returns true, it is generally safe to call the 'advance()' method.
+ *
+ * @return true, if the layout controller is advanceable, false otherwise.
+ */
+ public boolean isAdvanceable()
+ {
+ return processed == false;
+ }
+
+ /**
+ * Joins with a delegated process flow. This is generally called from a child
+ * flow and should *not* (I mean it!) be called from outside. If you do,
+ * you'll suffer.
+ *
+ * @param flowController the flow controller of the parent.
+ * @return the joined layout controller that incorperates all changes from the
+ * delegate.
+ */
+ public LayoutController join(final FlowController flowController)
+ throws DataSourceException, ReportDataFactoryException,
+ ReportProcessingException
+ {
+ throw new UnsupportedOperationException
+ ("Join is not supported in this layout controller");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
new file mode 100644
index 000000000000..5dfc6726a125
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryLoader.java
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: InputRepositoryLoader.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.loader;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.sun.star.report.InputRepository;
+import org.jfree.resourceloader.ResourceData;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceKeyCreationException;
+import org.jfree.resourceloader.ResourceLoader;
+import org.jfree.resourceloader.ResourceLoadingException;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.resourceloader.loader.LoaderUtils;
+
+public class InputRepositoryLoader implements ResourceLoader
+{
+ private InputRepository inputRepository;
+ private ResourceManager resourceManager;
+
+ public InputRepositoryLoader (final InputRepository inputRepository)
+ {
+ if (inputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ this.inputRepository = inputRepository;
+ }
+
+ /**
+ * Checks, whether this resource loader implementation was responsible for
+ * creating this key.
+ *
+ * @param key
+ * @return
+ */
+ public boolean isSupportedKey(final ResourceKey key)
+ {
+ if (InputRepositoryLoader.class.getName().equals(key.getSchema()))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Creates a new resource key from the given object and the factory keys.
+ *
+ * @param value
+ * @param factoryKeys
+ * @return the created key or null, if the format was not recognized.
+ * @throws org.jfree.resourceloader.ResourceKeyCreationException
+ * if creating the key failed.
+ */
+ public ResourceKey createKey(final Object value,
+ final Map factoryKeys)
+ throws ResourceKeyCreationException
+ {
+ if (value instanceof String == false)
+ {
+ return null;
+ }
+ final String strVal = (String) value;
+ if (strVal.startsWith("sun:oo://") == false)
+ {
+ return null;
+ }
+ return new ResourceKey(InputRepositoryLoader.class.getName(),
+ new InputResourceKey(inputRepository.getId(), strVal), factoryKeys);
+ }
+
+ /**
+ * Derives a new resource key from the given key. If neither a path nor new
+ * factory-keys are given, the parent key is returned.
+ *
+ * @param parent the parent
+ * @param path the derived path (can be null).
+ * @param factoryKeys the optional factory keys (can be null).
+ * @return the derived key.
+ * @throws org.jfree.resourceloader.ResourceKeyCreationException
+ * if the key cannot be derived for any reason.
+ */
+ public ResourceKey deriveKey(final ResourceKey parent,
+ final String path,
+ final Map factoryKeys)
+ throws ResourceKeyCreationException
+ {
+ if (isSupportedKey(parent) == false)
+ {
+ throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
+ }
+
+ final InputResourceKey parentKey = (InputResourceKey) parent.getIdentifier();
+ final String resource;
+ if (path.startsWith("sun:oo://"))
+ {
+ resource = path;
+ }
+ else if (path.startsWith("/"))
+ {
+ resource = "sun:oo:/" + path;
+ }
+ else
+ {
+ resource = LoaderUtils.mergePaths(parentKey.getPath(), path);
+ }
+ final Map map;
+ if (factoryKeys != null)
+ {
+ map = new HashMap();
+ map.putAll(parent.getFactoryParameters());
+ map.putAll(factoryKeys);
+ }
+ else
+ {
+ map = parent.getFactoryParameters();
+ }
+ return new ResourceKey(parent.getSchema(),
+ new InputResourceKey(parentKey.getInputRepositoryId(), resource), map);
+ }
+
+ public URL toURL(final ResourceKey key)
+ {
+ return null;
+ }
+
+ public ResourceData load (final ResourceKey key)
+ throws ResourceLoadingException
+ {
+ if (isSupportedKey(key) == false)
+ {
+ throw new ResourceLoadingException("None of my keys.");
+ }
+
+ return new InputRepositoryResourceData(key, inputRepository);
+ }
+
+ public void setResourceManager (final ResourceManager manager)
+ {
+ this.resourceManager = manager;
+ }
+
+ public ResourceManager getResourceManager ()
+ {
+ return resourceManager;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java
new file mode 100644
index 000000000000..f21f78945fc9
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: InputRepositoryResourceData.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.loader;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import com.sun.star.report.InputRepository;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceLoadingException;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.resourceloader.loader.AbstractResourceData;
+
+public class InputRepositoryResourceData extends AbstractResourceData
+{
+ private InputRepository inputRepository;
+ private ResourceKey key;
+ private String resourceIdentifer;
+
+ public InputRepositoryResourceData (final ResourceKey key,
+ final InputRepository repository)
+ {
+ this.key = key;
+ this.inputRepository = repository;
+ final InputResourceKey rkey = (InputResourceKey) key.getIdentifier();
+ final String identifier = rkey.getPath();
+ this.resourceIdentifer = identifier.substring("sun:oo://".length());
+ }
+
+ public Object getAttribute (String key)
+ {
+ // we dont support attributes here ..
+ return null;
+ }
+
+ public ResourceKey getKey ()
+ {
+ return key;
+ }
+
+ public InputStream getResourceAsStream (ResourceManager caller)
+ throws ResourceLoadingException
+ {
+ try
+ {
+ return inputRepository.createInputStream(resourceIdentifer);
+ }
+ catch (IOException e)
+ {
+ throw new ResourceLoadingException
+ ("Failed to create input stream for " + resourceIdentifer, e);
+ }
+ }
+
+ public long getVersion (ResourceManager caller)
+ {
+ return inputRepository.getVersion(resourceIdentifer);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java b/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java
new file mode 100644
index 000000000000..58e115bb42e1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/loader/InputResourceKey.java
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: InputResourceKey.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.loader;
+
+import java.io.Serializable;
+
+/**
+ * Creation-Date: Feb 22, 2007, 8:51:42 PM
+ *
+ * @author Thomas Morgner
+ */
+public class InputResourceKey implements Serializable
+{
+ private static final long serialVersionUID = 2819901838705793075L;
+
+ private Object inputRepositoryId;
+ private String path;
+
+ public InputResourceKey(final Object inputRepositoryId, final String path)
+ {
+ this.inputRepositoryId = inputRepositoryId;
+ this.path = path;
+ }
+
+ public Object getInputRepositoryId()
+ {
+ return inputRepositoryId;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public String toString()
+ {
+ return "InputResourceKey{" +
+ "inputRepositoryId=" + inputRepositoryId +
+ ", path='" + path + '\'' +
+ '}';
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/makefile.mk b/reportdesign/java/com/sun/star/report/pentaho/makefile.mk
new file mode 100644
index 000000000000..34dc1314a368
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/makefile.mk
@@ -0,0 +1,114 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..$/..
+PRJNAME = reportdesign
+TARGET = $(PRJNAME)
+PACKAGE = com$/sun$/star$/report$/pentaho
+# we have circular dependencies
+nodep=true
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+
+#----- compile .java files -----------------------------------------
+
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar jcommon-1.0.10.jar libxml-0.9.5.jar jfreereport-0.9.0-05.jar libloader-0.3.4.jar sac.jar liblayout-0.2.6.jar jcommon-serializer-0.1.0.jar libfonts-0.2.6.jar libformula-0.1.8.jar
+JAVAFILES := $(shell $(FIND) . -name "*.java")
+# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:s/.java/.class/))
+
+#----- copy .properties and .css files -----------------------------------------
+# external find gives / for 4nt too...
+# PROPERTYFILES := $(subst,/,$/ $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell $(FIND) . -name "*.properties")))
+PROPERTYFILES := $(CLASSDIR)$/$(PACKAGE)$/configuration.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/module.properties \
+ $(CLASSDIR)$/$(PACKAGE)$/parser$/selectors.properties
+
+# CSSFILES := $(subst,./,$(CLASSDIR)$/$(PACKAGE)$/ $(shell $(FIND) . -name "*.css"))
+CSSFILES := $(CLASSDIR)$/$(PACKAGE)$/oasis-datastyle.css\
+ $(CLASSDIR)$/$(PACKAGE)$/oasis-draw.css\
+ $(CLASSDIR)$/$(PACKAGE)$/oasis-form.css\
+ $(CLASSDIR)$/$(PACKAGE)$/oasis-style.css\
+ $(CLASSDIR)$/$(PACKAGE)$/oasis-table.css\
+ $(CLASSDIR)$/$(PACKAGE)$/oasis-text.css\
+ $(CLASSDIR)$/$(PACKAGE)$/smil.css\
+ $(CLASSDIR)$/$(PACKAGE)$/star-office.css\
+ $(CLASSDIR)$/$(PACKAGE)$/star-report.css\
+ $(CLASSDIR)$/$(PACKAGE)$/star-rpt.css\
+ $(CLASSDIR)$/$(PACKAGE)$/svg.css\
+ $(CLASSDIR)$/$(PACKAGE)$/xsl-fo.css
+
+XSDFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/rpt-schema-v1.0-os.xsd \
+ $(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xsd
+
+XMLFILES := $(CLASSDIR)$/$(PACKAGE)$/styles$/stylemapper.xml
+
+TXTFILES := $(CLASSDIR)$/$(PACKAGE)$/parser$/style-mapping.txt
+
+
+#----- make a jar from compiled files ------------------------------
+
+JARCLASSDIRS = .
+JARTARGET = $(TARGET).jar
+JARCOMPRESS = TRUE
+CUSTOMMANIFESTFILE = Manifest.mf
+
+
+# --- Targets ------------------------------------------------------
+.INCLUDE : target.mk
+
+.IF "$(JARTARGETN)"!=""
+$(JARTARGETN) : $(PROPERTYFILES) $(CSSFILES) $(XSDFILES) $(TXTFILES) $(XMLFILES)
+.ENDIF # "$(JARTARGETN)"!=""
+
+$(CLASSDIR)$/$(PACKAGE)$/%.properties : %.properties
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(CLASSDIR)$/$(PACKAGE)$/%.css : %.css
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(CLASSDIR)$/$(PACKAGE)$/%.xsd : %.xsd
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(CLASSDIR)$/$(PACKAGE)$/%.xml : %.xml
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(CLASSDIR)$/$(PACKAGE)$/%.txt : %.txt
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java b/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java
new file mode 100644
index 000000000000..87a4f959584d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/DataStyle.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataStyle.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Represents an automatic or manual data style definition.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class DataStyle extends Section
+{
+ public DataStyle()
+ {
+ }
+
+ public String getStyleName()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
+ }
+
+ public void setStyleName(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java
new file mode 100644
index 000000000000..181f83ad1d03
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/FixedTextElement.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedTextElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class FixedTextElement extends ReportElement
+{
+ private Section content;
+
+ public FixedTextElement()
+ {
+ content = new Section();
+ content.setVirtual(true);
+ }
+
+ public Section getContent()
+ {
+ return content;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java
new file mode 100644
index 000000000000..50e3481703f1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFaceDeclsSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import java.util.HashMap;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class FontFaceDeclsSection extends Element
+{
+ private HashMap fontFaces;
+
+ public FontFaceDeclsSection()
+ {
+ fontFaces = new HashMap();
+ setType("font-face-decls");
+ setNamespace(OfficeNamespaces.OFFICE_NS);
+ }
+
+ public void addFontFace(final FontFaceElement style)
+ {
+ fontFaces.put (style.getStyleName(), style);
+ }
+
+ public FontFaceElement getFontFace (final String name)
+ {
+ return (FontFaceElement) fontFaces.get(name);
+ }
+
+ public FontFaceElement[] getAllFontFaces()
+ {
+ return (FontFaceElement[]) fontFaces.values().toArray
+ (new FontFaceElement[fontFaces.size()]);
+ }
+
+
+ public boolean containsFont(final String fontName)
+ {
+ return fontFaces.containsKey(fontName);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java
new file mode 100644
index 000000000000..f2e713898b0c
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/FontFaceElement.java
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFaceElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Represents an automatic or manual data style definition.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class FontFaceElement extends Section
+{
+ public FontFaceElement()
+ {
+ }
+
+ public String getStyleName()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
+ }
+
+ public void setStyleName(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java b/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java
new file mode 100644
index 000000000000..97480a3f1e9a
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/FormatCondition.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormatCondition.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.expressions.FormulaExpression;
+
+/**
+ * The format condition defines, what style-format is applied to an element.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class FormatCondition
+{
+ private FormulaExpression formula;
+ private String styleName;
+ private boolean enabled;
+
+ public FormatCondition(final FormulaExpression formula,
+ final String styleName,
+ final boolean enabled)
+ {
+ this.formula = formula;
+ this.styleName = styleName;
+ this.enabled = enabled;
+ }
+
+
+ public FormulaExpression getFormula()
+ {
+ return formula;
+ }
+
+ public String getStyleName()
+ {
+ return styleName;
+ }
+
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java
new file mode 100644
index 000000000000..a800615c5f3f
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/FormattedTextElement.java
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormattedTextElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.expressions.FormulaExpression;
+
+/**
+ * A formatted text element takes a formula, evaluates it and formats the
+ * given element using some arbitary style. (As this is totally undocumented,
+ * we leave this out for now. Either we'll insert a field there or we call
+ * an UNO-component to do the formatting.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class FormattedTextElement extends ReportElement
+{
+ private FormulaExpression valueExpression;
+
+ public FormattedTextElement()
+ {
+ }
+
+
+ public FormulaExpression getValueExpression()
+ {
+ return valueExpression;
+ }
+
+ public void setValueExpression(final FormulaExpression valueExpression)
+ {
+ this.valueExpression = valueExpression;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java
new file mode 100644
index 000000000000..0cd48a5fda12
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/ImageElement.java
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.expressions.FormulaExpression;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class ImageElement extends ReportElement
+{
+ private FormulaExpression formula;
+
+ public ImageElement()
+ {
+ }
+
+ public FormulaExpression getFormula()
+ {
+ return formula;
+ }
+
+ public void setFormula(final FormulaExpression formula)
+ {
+ this.formula = formula;
+ }
+
+ public boolean isScale()
+ {
+ return "true".equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "scale"));
+ }
+
+ public void setScale(final boolean scale)
+ {
+ setAttribute(OfficeNamespaces.OOREPORT_NS, "scale", String.valueOf(scale));
+ }
+
+ public boolean isPreserveIRI()
+ {
+ return "true".equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "preserve-IRI"));
+ }
+
+ public void setPreserveIRI(final boolean preserveIRI)
+ {
+ setAttribute(OfficeNamespaces.OOREPORT_NS, "preserve-IRI", String.valueOf(preserveIRI));
+ }
+
+ public String getImageData()
+ {
+ return (String) getAttribute(OfficeNamespaces.FORM_NS, "image-data");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java
new file mode 100644
index 000000000000..5acff04cde17
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeDetailSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.DetailSection;
+
+/**
+ * A Marker-Class.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeDetailSection extends DetailSection
+{
+ public OfficeDetailSection()
+ {
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java
new file mode 100644
index 000000000000..a4c0fe5433f3
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeDocument.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeDocument.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.JFreeReport;
+
+/**
+ * An office document represents the root of the report processing. In
+ * OpenOffice reports, this is the only child of the report object.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeDocument extends JFreeReport
+{
+ private OfficeStylesCollection stylesCollection;
+
+ public OfficeDocument()
+ {
+ }
+
+ public OfficeStylesCollection getStylesCollection()
+ {
+ return stylesCollection;
+ }
+
+ public void setStylesCollection(final OfficeStylesCollection stylesCollection)
+ {
+ if (stylesCollection == null)
+ {
+ throw new NullPointerException();
+ }
+ this.stylesCollection = stylesCollection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java
new file mode 100644
index 000000000000..84a5949fe5c6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroup.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeGroup.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:06 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Group;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * An office group is a virtual section that contains the group header, footer
+ * and either a detail section or another group.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeGroup extends Group
+{
+ public OfficeGroup()
+ {
+ }
+
+ public boolean isStartNewColumn ()
+ {
+ return "true".equals
+ (getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column"));
+ }
+
+ public boolean isResetPageNumber ()
+ {
+ return "true".equals
+ (getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number"));
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java
new file mode 100644
index 000000000000..9c81ac3b15b6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeGroupSection.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeGroupSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * A group header or footer. If such a section is marked as sticky, it will be
+ * repeated on each new page.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeGroupSection extends Section
+{
+ public OfficeGroupSection()
+ {
+ }
+
+ public boolean isRepeatSection ()
+ {
+ final Object repeatFlag =
+ getAttribute(OfficeNamespaces.OOREPORT_NS, "repeat-section");
+ return "true".equals(repeatFlag);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java
new file mode 100644
index 000000000000..2d1dfeae4216
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeMasterPage.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * A master page. A master page can contain header and footer and is linked
+ * to a page-layout.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class OfficeMasterPage extends Section
+{
+
+ public OfficeMasterPage()
+ {
+ }
+
+ public String getStyleName()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
+ }
+
+ public void setStyleName(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
+ }
+
+ public String getPageLayout()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name");
+ }
+
+ public void setPageLayout(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name", name);
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java
new file mode 100644
index 000000000000..6c67d6b56882
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeMasterStyles.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import java.util.HashMap;
+
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+
+/**
+ * The master-styles section can have either a master-page, handout-master
+ * or draw-layer-set. (The latter ones are ignored for the reporting purposes,
+ * they are PowerPoint related.)
+ *
+ * There is no documentation how the system selects a master-page if there is
+ * no master-page assigned to the paragraph. However, it seems as if the
+ * master-page called 'Standard' is used as initial default.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class OfficeMasterStyles extends Element
+{
+ private HashMap masterPages;
+ private Section otherNodes;
+
+ public OfficeMasterStyles()
+ {
+ masterPages = new HashMap();
+ otherNodes = new Section();
+ }
+
+ public void addMasterPage (final OfficeMasterPage masterPage)
+ {
+ if (masterPage == null)
+ {
+ throw new NullPointerException();
+ }
+ this.masterPages.put(masterPage.getStyleName(), masterPage);
+ }
+
+ public OfficeMasterPage getMasterPage (final String name)
+ {
+ return (OfficeMasterPage) masterPages.get (name);
+ }
+
+ public OfficeMasterPage[] getAllMasterPages()
+ {
+ return (OfficeMasterPage[]) masterPages.values().toArray
+ (new OfficeMasterPage[masterPages.size()]);
+ }
+
+ public Section getOtherNodes()
+ {
+ return otherNodes;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java
new file mode 100644
index 000000000000..7337069dbf85
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeReport.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeReport.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Node;
+
+/**
+ * A office report is an ordered section. It contains several root-level bands
+ * which need to be processed in a given order.
+ *
+ * A report can have named expression attached. These expressions will be
+ * computed at the global scope and will be available for all child elements.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeReport extends Element
+{
+ private Node pageHeader;
+ private Node pageFooter;
+ private Node columnHeader;
+ private Node columnFooter;
+ private Node reportHeader;
+ private Node reportFooter;
+ private Node bodySection;
+
+ public OfficeReport()
+ {
+ }
+
+ public Node getPageHeader()
+ {
+ return pageHeader;
+ }
+
+ public void setPageHeader(final Node pageHeader)
+ {
+ this.pageHeader = pageHeader;
+ }
+
+ public Node getPageFooter()
+ {
+ return pageFooter;
+ }
+
+ public void setPageFooter(final Node pageFooter)
+ {
+ this.pageFooter = pageFooter;
+ }
+
+ public Node getColumnHeader()
+ {
+ return columnHeader;
+ }
+
+ public void setColumnHeader(final Node columnHeader)
+ {
+ this.columnHeader = columnHeader;
+ }
+
+ public Node getColumnFooter()
+ {
+ return columnFooter;
+ }
+
+ public void setColumnFooter(final Node columnFooter)
+ {
+ this.columnFooter = columnFooter;
+ }
+
+ public Node getReportHeader()
+ {
+ return reportHeader;
+ }
+
+ public void setReportHeader(final Node reportHeader)
+ {
+ this.reportHeader = reportHeader;
+ }
+
+ public Node getReportFooter()
+ {
+ return reportFooter;
+ }
+
+ public void setReportFooter(final Node reportFooter)
+ {
+ this.reportFooter = reportFooter;
+ }
+
+ public Node getBodySection()
+ {
+ return bodySection;
+ }
+
+ public void setBodySection(final Node bodySection)
+ {
+ this.bodySection = bodySection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java
new file mode 100644
index 000000000000..281d895bdbdd
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyle.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStyle.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+
+/**
+ * Represents an automatic or manual style definition.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class OfficeStyle extends Section
+{
+ public OfficeStyle()
+ {
+ setNamespace(OfficeNamespaces.STYLE_NS);
+ setType("style");
+ }
+
+ public String getStyleName()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
+ }
+
+ public void setStyleName(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
+ }
+
+ /**
+ * A parent style name must be a common style (it cannot be an automatic
+ * style) and has to exist. If no parent style is given, an implementation
+ * specific default style is used.
+ *
+ * @return
+ */
+ public String getStyleParent()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name");
+ }
+
+ public void setStyleParent(final String parentName)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name", parentName);
+ }
+
+ public String getStyleFamily()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "family");
+ }
+
+ public void setStyleFamily(final String family)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "family", family);
+ }
+
+// public String getMasterPageName()
+// {
+// return (String) getAttribute(OfficeNamespaces.STYLE_NS, "master-page-name");
+// }
+
+ public Element getParagraphProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ }
+
+ public Element getTextProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "text-properties");
+ }
+
+ public Element getTableRowProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "table-row-properties");
+ }
+
+ public Element getTableProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "table-properties");
+ }
+
+ public Element getTableColumnProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "table-column-properties");
+ }
+
+ public Element getSectionProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "section-properties");
+ }
+
+ public Element getTableCellProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "table-cell-properties");
+ }
+
+ public Element getGraphicProperties ()
+ {
+ return findFirstChild(OfficeNamespaces.STYLE_NS, "graphic-properties");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java
new file mode 100644
index 000000000000..41e6ae43bcab
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStyles.java
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStyles.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.jfree.report.structure.Element;
+
+/**
+ * Holds one style type, either an automatic, common or master style. This is a
+ * marker container that defines the nature of the styles contained within this
+ * container. (Yeah, it is awkward, but that's how the document model describes
+ * it.)
+ *
+ * The style family can be one of paragraph, text, section, table, table-column,
+ * table-row, table-cell, table-page, chart, default, drawing-page, graphic,
+ * presentation, control and ruby.
+ *
+ * @author Thomas Morgner
+ * @since 07.03.2007
+ */
+public class OfficeStyles extends Element
+{
+ public static class StyleKey implements Serializable
+ {
+ private static final long serialVersionUID = 4931878927362887477L;
+ private String family;
+ private String name;
+
+ public StyleKey(final String family, final String name)
+ {
+ if (family == null)
+ {
+ throw new NullPointerException();
+ }
+ this.family = family;
+ this.name = name;
+ }
+
+
+ public String getFamily()
+ {
+ return family;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean equals(final Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null || getClass() != obj.getClass())
+ {
+ return false;
+ }
+
+ final StyleKey styleKey = (StyleKey) obj;
+
+ if (!family.equals(styleKey.family))
+ {
+ return false;
+ }
+ if (name != null ? !name.equals(styleKey.name) : styleKey.name != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result = family.hashCode();
+ result = 31 * result + (name != null ? name.hashCode() : 0);
+ return result;
+ }
+ }
+
+ private HashMap pageStyles;
+ private HashMap dataStyles;
+ private HashMap styles;
+ private ArrayList otherChilds;
+
+ public OfficeStyles()
+ {
+ this.styles = new HashMap();
+ this.dataStyles = new HashMap();
+ this.pageStyles = new HashMap();
+ this.otherChilds = new ArrayList();
+ }
+
+ public OfficeStyle getStyle(final String family, final String name)
+ {
+ return (OfficeStyle) styles.get(new StyleKey(family, name));
+ }
+
+ public void addStyle (final OfficeStyle style)
+ {
+ if (style == null)
+ {
+ throw new NullPointerException();
+ }
+ final String styleFamily = style.getStyleFamily();
+ if (styleFamily == null)
+ {
+ throw new NullPointerException();
+ }
+ if (style.getStyleName() == null)
+ {
+ throw new NullPointerException();
+ }
+ styles.put(new StyleKey(styleFamily, style.getStyleName()), style);
+ }
+
+ public void addPageStyle (final PageLayout style)
+ {
+ pageStyles.put(style.getStyleName(), style);
+ }
+
+ public PageLayout getPageStyle (final String name)
+ {
+ return (PageLayout) pageStyles.get (name);
+ }
+
+ public void addDataStyle(final DataStyle style)
+ {
+ dataStyles.put (style.getStyleName(), style);
+ }
+
+ public DataStyle getDataStyle (final String name)
+ {
+ return (DataStyle) dataStyles.get(name);
+ }
+
+ public void addOtherNode (final Element node)
+ {
+ otherChilds.add(node);
+ }
+
+ public DataStyle[] getAllDataStyles()
+ {
+ return (DataStyle[]) dataStyles.values().toArray
+ (new DataStyle[dataStyles.size()]);
+ }
+
+ public PageLayout[] getAllPageStyles()
+ {
+ return (PageLayout[]) pageStyles.values().toArray
+ (new PageLayout[pageStyles.size()]);
+ }
+
+ public OfficeStyle[] getAllStyles()
+ {
+ return (OfficeStyle[]) styles.values().toArray
+ (new OfficeStyle[styles.size()]);
+ }
+
+ public Element[] getOtherStyles()
+ {
+ return (Element[]) otherChilds.toArray(new Element[otherChilds.size()]);
+ }
+
+ public boolean containsStyle(final String family, final String name)
+ {
+ return styles.containsKey(new StyleKey(family, name));
+ }
+
+ public boolean containsDataStyle(final String styleName)
+ {
+ return dataStyles.containsKey(styleName);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java
new file mode 100644
index 000000000000..e3d1236dbc9d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStylesCollection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+
+/**
+ * Holds all style-definitions and provides some simplified lookup methods to
+ * grab them by their type and name.
+ * <p/>
+ * For now, we are only interested in 'style:style' nodes. Each of these nodes
+ * has a style-name and a style-family. Each style declaration can have a parent
+ * style, from which properties are inherited.
+ * <p/>
+ * Style names are unique within the family, no matter whether the style is an
+ * automatic style, an common style or a master style.
+ * <p/>
+ * The contents of this element are the union of the 'styles.xml' file (if it
+ * exists), the font-declarations and auto-styles of the document-content.xml
+ * and the styles declared in the main document.
+ *
+ * @author Thomas Morgner
+ * @since 06.03.2007
+ */
+public class OfficeStylesCollection extends Element
+{
+ // Font-face declarations are copied as is. We simply merge them by adding
+ // them all in one set. This may result in duplicate entries, but as the
+ // fileformat does not forbid that, it therefore must be ok.
+ private FontFaceDeclsSection fontFaceDecls;
+ private OfficeStyles automaticStyles;
+ private OfficeStyles commonStyles;
+ private OfficeMasterStyles masterStyles;
+
+ public OfficeStylesCollection()
+ {
+ fontFaceDecls = new FontFaceDeclsSection();
+
+ automaticStyles = new OfficeStyles();
+ automaticStyles.setType("automatic-styles");
+ automaticStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
+
+ commonStyles = new OfficeStyles();
+ commonStyles.setType("styles");
+ commonStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
+
+ masterStyles = new OfficeMasterStyles();
+ masterStyles.setType("master-styles");
+ masterStyles.setNamespace(OfficeNamespaces.OFFICE_NS);
+ }
+
+ public OfficeStyle getStyle(final String family, final String name)
+ {
+ final OfficeStyle commonStyle = commonStyles.getStyle(family, name);
+ if (commonStyle != null)
+ {
+ return commonStyle;
+ }
+ final OfficeStyle autoStyle = automaticStyles.getStyle(family, name);
+ if (autoStyle != null)
+ {
+ return autoStyle;
+ }
+
+ // And later: Autogenerate one of the default styles.
+ // However, at this moment, we dont have a clue about the default styles
+ // at all. Maybe we should add them to make this implementation more robust
+ // against invalid documents.
+ return null;
+ }
+
+ public boolean containsStyle (final String family, final String name)
+ {
+ return (getStyle(family, name) != null);
+ }
+
+ public OfficeStyles getAutomaticStyles()
+ {
+ return automaticStyles;
+ }
+
+ public OfficeStyles getCommonStyles()
+ {
+ return commonStyles;
+ }
+
+ public OfficeMasterStyles getMasterStyles()
+ {
+ return masterStyles;
+ }
+
+ public FontFaceDeclsSection getFontFaceDecls()
+ {
+ return fontFaceDecls;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java
new file mode 100644
index 000000000000..1127f0471f53
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/OfficeTableSection.java
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeTableSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+
+/**
+ * Creation-Date: 24.04.2007, 15:55:17
+ *
+ * @author Thomas Morgner
+ */
+public class OfficeTableSection extends Section
+{
+ public OfficeTableSection()
+ {
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java b/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java
new file mode 100644
index 000000000000..1ecf2c7077ef
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/PageLayout.java
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageLayout.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Element;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * A page layout describes the physical properties of a page. It is equal to
+ * an @page rule in CSS.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class PageLayout extends Section
+{
+
+ public PageLayout()
+ {
+ setNamespace(OfficeNamespaces.STYLE_NS);
+ setType("page-layout");
+ }
+
+ public String getStyleName()
+ {
+ return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name");
+ }
+
+ public void setStyleName(final String name)
+ {
+ setAttribute(OfficeNamespaces.STYLE_NS, "name", name);
+ }
+
+ public Section getHeaderStyle ()
+ {
+ return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "header-style");
+ }
+
+ public Section getFooterStyle ()
+ {
+ return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "footer-style");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java
new file mode 100644
index 000000000000..bfc41067d233
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/PageSection.java
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+import org.jfree.layouting.util.AttributeMap;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * This represents either a page header or page footer.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class PageSection extends Section
+{
+ public PageSection()
+ {
+ }
+
+ public static boolean isPrintWithReportHeader(final AttributeMap attrs)
+ {
+ final String pagePrintOption = (String) attrs.getAttribute
+ (OfficeNamespaces.OOREPORT_NS, "page-print-option");
+ if ("not-with-report-header".equals(pagePrintOption))
+ {
+ return false;
+ }
+ if ("not-with-report-header-nor-footer".equals(pagePrintOption))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public static boolean isPrintWithReportFooter(final AttributeMap attrs)
+ {
+ final String pagePrintOption = (String) attrs.getAttribute
+ (OfficeNamespaces.OOREPORT_NS, "page-print-option");
+ if ("not-with-report-footer".equals(pagePrintOption))
+ {
+ return false;
+ }
+ if ("not-with-report-header-nor-footer".equals(pagePrintOption))
+ {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java b/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java
new file mode 100644
index 000000000000..7122b3dd9bf1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/RawText.java
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RawText.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.StaticText;
+
+/**
+ * A marker implementation. If encountered by the OfficeRawTarget, this text
+ * will be written without being normalized. Such text represents a page
+ * header or footer.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class RawText extends StaticText
+{
+ public RawText(final String text)
+ {
+ super(text);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java
new file mode 100644
index 000000000000..a268315adab5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/ReportElement.java
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import java.util.ArrayList;
+
+import org.jfree.report.structure.Element;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * A report element is the base class for all content generating elements in a
+ * report.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public abstract class ReportElement extends Element
+{
+ private ArrayList formatConditions;
+
+ protected ReportElement()
+ {
+ formatConditions = new ArrayList();
+ }
+
+ /**
+ * Checks the current group and prints this element only if the current row is
+ * the first row for that particular group.
+ *
+ * @return true, if the element should only be printed in the first row of the
+ * current group, false otherwise.
+ */
+ public boolean isPrintWhenGroupChanges()
+ {
+ return "true".equals(getAttribute
+ (OfficeNamespaces.OOREPORT_NS, "print-when-group-changes"));
+ }
+
+ public void setPrintWhenGroupChanges(final boolean printWhenGroupChanges)
+ {
+ setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes",
+ String.valueOf(printWhenGroupChanges));
+ }
+
+ /**
+ * Checks, whether the printed value has been changed since the last run. The
+ * element will only be printed, if there was at least one change.
+ *
+ * @return true, if repeated values should be printed, false if repeated
+ * values should be surpressed.
+ */
+ public boolean isPrintRepeatedValues()
+ {
+ return "true".equals(getAttribute
+ (OfficeNamespaces.OOREPORT_NS, "print-repeated-values"));
+ }
+
+ public void setPrintRepeatedValues(final boolean printRepeatedValues)
+ {
+ setAttribute(OfficeNamespaces.OOREPORT_NS, "print-repeated-values",
+ String.valueOf(printRepeatedValues));
+ }
+
+ public void addFormatCondition(final FormatCondition formatCondition)
+ {
+ if (formatCondition == null)
+ {
+ throw new NullPointerException();
+ }
+
+ this.formatConditions.add(formatCondition);
+ }
+
+ public FormatCondition[] getFormatConditions ()
+ {
+ return (FormatCondition[]) this.formatConditions.toArray
+ (new FormatCondition[this.formatConditions.size()]);
+ }
+
+ public int getFormatConditionCount ()
+ {
+ return formatConditions.size();
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java b/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java
new file mode 100644
index 000000000000..480548e2f0e4
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/TableCellElement.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableCellElement.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import org.jfree.report.structure.Section;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 05.03.2007
+ */
+public class TableCellElement extends Section
+{
+
+ public TableCellElement()
+ {
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java b/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java
new file mode 100644
index 000000000000..b304bc4bff0a
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VariablesDeclarationSection.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.model;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Section;
+
+/**
+ * A paragraph that contains variables-declarations. This paragraph will be
+ * printed in the first cell of the first table (if there's one).
+ *
+ * The VariablesDeclarationSection is an auto-generated structure element that
+ * has no model-representation. The section itself is empty and simply acts
+ * as flag for the output-processor. The output processor itself is responsible
+ * to maintain the variables.
+ *
+ * @author Thomas Morgner
+ * @since 19.03.2007
+ */
+public class VariablesDeclarationSection extends Section
+{
+
+ public VariablesDeclarationSection()
+ {
+ setNamespace(OfficeNamespaces.INTERNAL_NS);
+ setType("variables-section");
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/module.properties b/reportdesign/java/com/sun/star/report/pentaho/module.properties
new file mode 100644
index 000000000000..09b89a0cdadc
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/module.properties
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: module.properties,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:04 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+
+module-info:
+ name: factory-report-sun
+ producer: The JFreeReport project - www.jfree.org/jfreereport
+ description: XML-Parsers for StarOffice report definitions. These definitions\
+ are basicly similiar to the old JFreeReport format, with some limited absolute\
+ positioning capabilities.
+ version.major: 0
+ version.minor: 90
+ version.patchlevel: 0
+
+depends:
+ module: org.jfree.report.modules.factories.report.base.ReportFactoryBaseModule
+ version.major: 0
+ version.minor: 90
+ version.patchlevel: 0
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css
new file mode 100644
index 000000000000..01fa9d16fe03
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-datastyle.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
+
+/**
+ * All default styles for data-styles elements.
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css
new file mode 100644
index 000000000000..87fe338294e2
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-draw.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+
+/**
+ * All default styles for draw elements.
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css
new file mode 100644
index 000000000000..b9f4967eaa1b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-form.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:form:1.0");
+
+/**
+ * All default styles for form elements.
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css
new file mode 100644
index 000000000000..6e5f9c8f51c5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-style.css
@@ -0,0 +1,10 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+
+/**
+ * All default styles for style elements. (They should not be visible anyway,
+ * but better be complete than be sorry afterwards.)
+ */
+
+raw-styles {
+ display:none;
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css
new file mode 100644
index 000000000000..efddd2919966
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-table.css
@@ -0,0 +1,37 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+
+table {
+ display: table;
+}
+
+table-columns {
+ display: table-column-group;
+}
+
+table-column {
+ display: table-column;
+}
+
+table-row {
+ display: table-row;
+}
+
+table-cell {
+ display: table-cell;
+}
+
+table-cell[number-cols-spanned],
+table-cell[number-cols-spanned],
+table-columns[number-cols-spanned],
+table-column[number-cols-spanned] {
+ -x-liblayout-colspan: attr(number-cols-spanned);
+}
+
+table-cell[number-rows-spanned],
+table-cell[number-rows-spanned] {
+ -x-liblayout-rowspan: attr(number-rows-spanned);
+}
+
+
+
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css b/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css
new file mode 100644
index 000000000000..c8b6acc03d94
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/oasis-text.css
@@ -0,0 +1,9 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+
+/**
+ * All default styles for form elements.
+ */
+
+p {
+ display: block;
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java
new file mode 100644
index 000000000000..a65c6e0a9a51
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java
@@ -0,0 +1,471 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageProducer.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output;
+
+import java.awt.Image;
+import java.awt.Dimension;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.sql.Blob;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Arrays;
+
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.ImageService;
+import com.sun.star.report.ReportExecutionException;
+import com.sun.star.report.pentaho.DefaultNameGenerator;
+import com.keypoint.PngEncoder;
+import org.jfree.io.IOUtils;
+import org.jfree.layouting.input.style.values.CSSNumericType;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.util.Log;
+import org.jfree.util.StringUtils;
+import org.jfree.util.WaitingImageObserver;
+
+/**
+ * This class manages the images embedded in a report.
+ *
+ * @author Thomas Morgner
+ * @since 31.03.2007
+ */
+public class ImageProducer
+{
+ public static class OfficeImage
+ {
+ private CSSNumericValue width;
+ private CSSNumericValue height;
+ private String embeddableLink;
+
+ public OfficeImage(final String embeddableLink, final CSSNumericValue width, final CSSNumericValue height)
+ {
+ this.embeddableLink = embeddableLink;
+ this.width = width;
+ this.height = height;
+ }
+
+ public CSSNumericValue getWidth()
+ {
+ return width;
+ }
+
+ public CSSNumericValue getHeight()
+ {
+ return height;
+ }
+
+ public String getEmbeddableLink()
+ {
+ return embeddableLink;
+ }
+ }
+
+ private static class ByteDataImageKey
+ {
+ private byte[] keyData;
+ private Integer hashCode;
+
+ protected ByteDataImageKey(final byte[] keyData)
+ {
+ if (keyData == null)
+ {
+ throw new NullPointerException();
+ }
+ this.keyData = keyData;
+ }
+
+
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final ByteDataImageKey key = (ByteDataImageKey) o;
+ if (!Arrays.equals(keyData, key.keyData))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ if (hashCode != null)
+ {
+ return hashCode.intValue();
+ }
+
+ final int length = Math.min(keyData.length, 512);
+ int hashCode = 0;
+ for (int i = 0; i < length; i++)
+ {
+ final byte b = keyData[i];
+ hashCode = b + hashCode * 23;
+ }
+ this.hashCode = new Integer(hashCode);
+ return hashCode;
+ }
+ }
+
+ private HashMap imageCache;
+ private InputRepository inputRepository;
+ private OutputRepository outputRepository;
+ private ImageService imageService;
+ private DefaultNameGenerator nameGenerator;
+
+ public ImageProducer(final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final ImageService imageService)
+ {
+ if (inputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ if (outputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ if (imageService == null)
+ {
+ throw new NullPointerException();
+ }
+
+ this.inputRepository = inputRepository;
+ this.outputRepository = outputRepository;
+ this.imageService = imageService;
+ this.imageCache = new HashMap();
+ this.nameGenerator = new DefaultNameGenerator(outputRepository);
+ }
+
+ /**
+ * Image-Data can be one of the following types: String, URL, URI, byte-array, blob.
+ *
+ * @param imageData
+ * @param preserveIRI
+ * @return
+ */
+ public OfficeImage produceImage(final Object imageData,
+ final boolean preserveIRI)
+ {
+
+ Log.debug ("Want to produce image " + imageData);
+ if (imageData instanceof String)
+ {
+ return produceFromString((String) imageData, preserveIRI);
+ }
+
+ if (imageData instanceof URL)
+ {
+ return produceFromURL((URL) imageData, preserveIRI);
+ }
+
+ if (imageData instanceof Blob)
+ {
+ return produceFromBlob((Blob) imageData);
+ }
+
+ if (imageData instanceof byte[])
+ {
+ return produceFromByteArray((byte[]) imageData);
+ }
+
+ if (imageData instanceof Image)
+ {
+ return produceFromImage((Image) imageData);
+ }
+ // not usable ..
+ return null;
+ }
+
+ private OfficeImage produceFromImage(final Image image)
+ {
+ // quick caching ... use a weak list ...
+ final WaitingImageObserver obs = new WaitingImageObserver(image);
+ obs.waitImageLoaded();
+
+ final PngEncoder encoder = new PngEncoder(image, PngEncoder.ENCODE_ALPHA, PngEncoder.FILTER_NONE, 5);
+ final byte[] data = encoder.pngEncode();
+ return produceFromByteArray(data);
+ }
+
+ private OfficeImage produceFromBlob(final Blob blob)
+ {
+ try
+ {
+ final InputStream inputStream = blob.getBinaryStream();
+ final int length = (int) blob.length();
+
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream(length);
+ try
+ {
+ IOUtils.getInstance().copyStreams(inputStream, bout);
+ }
+ finally
+ {
+ inputStream.close();
+ }
+ return produceFromByteArray(bout.toByteArray());
+ }
+ catch (IOException e)
+ {
+ Log.warn("Failed to produce image from Blob", e);
+ }
+ catch (SQLException e)
+ {
+ Log.warn("Failed to produce image from Blob", e);
+ }
+ return null;
+ }
+
+ private OfficeImage produceFromByteArray(final byte[] data)
+ {
+ final ByteDataImageKey imageKey = new ByteDataImageKey(data);
+ final OfficeImage o = (OfficeImage) imageCache.get(imageKey);
+ if (o != null)
+ {
+ return o;
+ }
+
+ try
+ {
+ final String mimeType = imageService.getMimeType(data);
+ final Dimension dims = imageService.getImageSize(data);
+
+ // copy the image into the local output-storage
+ // todo: Implement data-fingerprinting so that we can detect the mime-type
+ final String name = nameGenerator.generateName("Pictures/image", mimeType);
+ final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType);
+ final ByteArrayInputStream bin = new ByteArrayInputStream(data);
+
+ try
+ {
+ IOUtils.getInstance().copyStreams(bin, outputStream);
+ }
+ finally
+ {
+ outputStream.close();
+ }
+
+ final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
+ final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
+ final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal);
+ imageCache.put(imageKey, officeImage);
+ return officeImage;
+ }
+ catch (IOException e)
+ {
+ Log.warn("Failed to load image from local input-repository", e);
+ }
+ catch (ReportExecutionException e)
+ {
+ Log.warn("Failed to create image from local input-repository", e);
+ }
+ return null;
+ }
+
+ private OfficeImage produceFromString(final String source,
+ final boolean preserveIRI)
+ {
+
+ try
+ {
+ final URL url = new URL(source);
+ return produceFromURL(url, preserveIRI);
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore .. but we had to try this ..
+ }
+
+ final OfficeImage o = (OfficeImage) imageCache.get(source);
+ if (o != null)
+ {
+ return o;
+ }
+
+ // Next, check whether this is a local path.
+ if (inputRepository.isReadable(source))
+ {
+ // cool, the file exists. Let's try to read it.
+ try
+ {
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
+ final InputStream inputStream = inputRepository.createInputStream(source);
+ try
+ {
+ IOUtils.getInstance().copyStreams(inputStream, bout);
+ }
+ finally
+ {
+ inputStream.close();
+ }
+ final byte[] data = bout.toByteArray();
+ final Dimension dims = imageService.getImageSize(data);
+ final String mimeType = imageService.getMimeType(data);
+
+ final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
+ final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
+
+ final String filename = copyToOutputRepository(mimeType, source, data);
+ final OfficeImage officeImage = new OfficeImage(filename, widthVal, heightVal);
+ imageCache.put(source, officeImage);
+ return officeImage;
+ }
+ catch (IOException e)
+ {
+ Log.warn("Failed to load image from local input-repository", e);
+ }
+ catch (ReportExecutionException e)
+ {
+ Log.warn("Failed to create image from local input-repository", e);
+ }
+ }
+
+ // Return the image as broken image instead ..
+ final OfficeImage officeImage = new OfficeImage(source, null, null);
+ imageCache.put(source, officeImage);
+ return officeImage;
+ }
+
+ private OfficeImage produceFromURL(final URL url,
+ final boolean preserveIRI)
+ {
+ final OfficeImage o = (OfficeImage) imageCache.get(url);
+ if (o != null)
+ {
+ return o;
+ }
+
+ try
+ {
+ final ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
+ final URLConnection urlConnection = url.openConnection();
+ final InputStream inputStream = new BufferedInputStream(urlConnection.getInputStream());
+ try
+ {
+ IOUtils.getInstance().copyStreams(inputStream, bout);
+ }
+ finally
+ {
+ inputStream.close();
+ }
+ final byte[] data = bout.toByteArray();
+
+ final Dimension dims = imageService.getImageSize(data);
+ final String mimeType = imageService.getMimeType(data);
+ final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
+ final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
+
+ if (preserveIRI == false)
+ {
+ final OfficeImage retval = new OfficeImage(url.toString(), widthVal, heightVal);
+ imageCache.put(url, retval);
+ return retval;
+ }
+
+ final String file = url.getFile();
+ final String name = copyToOutputRepository(mimeType, file, data);
+ final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal);
+ imageCache.put(url, officeImage);
+ return officeImage;
+ }
+ catch (IOException e)
+ {
+ Log.warn("Failed to load image from local input-repository" + e);
+ }
+ catch (ReportExecutionException e)
+ {
+ Log.warn("Failed to create image from local input-repository" + e);
+ }
+
+ if (preserveIRI == false)
+ {
+ final OfficeImage image = new OfficeImage(url.toString(), null, null);
+ imageCache.put(url, image);
+ return image;
+ }
+
+ // OK, everything failed; the image is not - repeat it - not usable.
+ return null;
+ }
+
+ private String copyToOutputRepository(final String urlMimeType, final String file, final byte[] data)
+ throws IOException, ReportExecutionException
+ {
+ final String mimeType;
+ if (urlMimeType == null)
+ {
+ mimeType = imageService.getMimeType(data);
+ }
+ else
+ {
+ mimeType = urlMimeType;
+ }
+
+ // copy the image into the local output-storage
+ final String name = nameGenerator.generateName("Pictures/image", mimeType);
+ final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType);
+ final ByteArrayInputStream bin = new ByteArrayInputStream(data);
+
+ try
+ {
+ IOUtils.getInstance().copyStreams(bin, outputStream);
+ }
+ finally
+ {
+ outputStream.close();
+ }
+ return name;
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
new file mode 100644
index 000000000000..f7c47d00c398
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java
@@ -0,0 +1,1469 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeDocumentReportTarget.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output;
+
+import java.awt.Image;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.zip.DeflaterOutputStream;
+import java.util.zip.InflaterInputStream;
+
+import com.sun.star.report.ImageService;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.layoutprocessor.ImageElementContext;
+import com.sun.star.report.pentaho.model.OfficeDocument;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.styles.LengthCalculator;
+import com.sun.star.report.pentaho.styles.StyleMapper;
+import org.jfree.io.IOUtils;
+import org.jfree.layouting.input.style.parser.CSSValueFactory;
+import org.jfree.layouting.input.style.parser.StyleSheetParserUtil;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.layouting.layouter.style.CSSValueResolverUtility;
+import org.jfree.layouting.namespace.NamespaceDefinition;
+import org.jfree.layouting.namespace.Namespaces;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataFlags;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.JFreeReportBoot;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.AbstractReportTarget;
+import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
+import org.jfree.report.flow.ReportTargetUtil;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.util.AttributeNameGenerator;
+import org.jfree.report.util.IntegerCache;
+import org.jfree.report.util.MemoryByteArrayOutputStream;
+import org.jfree.resourceloader.ResourceException;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.util.FastStack;
+import org.jfree.util.LineBreakIterator;
+import org.jfree.util.Log;
+import org.jfree.xmlns.common.AttributeList;
+import org.jfree.xmlns.writer.DefaultTagDescription;
+import org.jfree.xmlns.writer.XmlWriter;
+import org.jfree.xmlns.writer.XmlWriterSupport;
+import org.w3c.css.sac.LexicalUnit;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 08.03.2007
+ */
+public abstract class OfficeDocumentReportTarget extends AbstractReportTarget
+{
+ public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output.";
+
+ public static final int ROLE_NONE = 0;
+ public static final int ROLE_REPORT_HEADER = 1;
+ public static final int ROLE_REPORT_FOOTER = 2;
+ public static final int ROLE_GROUP_HEADER = 3;
+ public static final int ROLE_GROUP_FOOTER = 4;
+ public static final int ROLE_REPEATING_GROUP_HEADER = 5;
+ public static final int ROLE_REPEATING_GROUP_FOOTER = 6;
+ public static final int ROLE_PAGE_HEADER = 7;
+ public static final int ROLE_PAGE_FOOTER = 8;
+ public static final int ROLE_DETAIL = 9;
+ public static final int ROLE_VARIABLES = 10;
+ public static final int ROLE_TEMPLATE = 11;
+
+ public static final int STATE_IN_DOCUMENT = 0;
+ public static final int STATE_IN_BODY = 1;
+ public static final int STATE_IN_CONTENT = 2;
+ public static final int STATE_IN_GROUP = 3;
+ public static final int STATE_IN_GROUP_BODY = 4;
+ public static final int STATE_IN_SECTION = 5;
+ public static final int STATE_IN_OTHER = 6;
+
+ protected static class BufferState
+ {
+ private XmlWriter xmlWriter;
+ private MemoryByteArrayOutputStream xmlBuffer;
+ private OfficeStylesCollection stylesCollection;
+
+ protected BufferState(final XmlWriter xmlWriter,
+ final MemoryByteArrayOutputStream xmlBuffer,
+ final OfficeStylesCollection stylesCollection)
+ {
+ this.stylesCollection = stylesCollection;
+ this.xmlWriter = xmlWriter;
+ this.xmlBuffer = xmlBuffer;
+ }
+
+
+ public OfficeStylesCollection getStylesCollection()
+ {
+ return stylesCollection;
+ }
+
+ public XmlWriter getXmlWriter()
+ {
+ return xmlWriter;
+ }
+
+ public String getXmlBuffer() throws ReportProcessingException
+ {
+ try
+ {
+ final byte[] zippedData = xmlBuffer.getRaw();
+ final InputStreamReader reader = new InputStreamReader
+ (new InflaterInputStream(new ByteArrayInputStream(zippedData, 0, xmlBuffer.getLength())), "UTF-16");
+ final StringWriter writer = new StringWriter((zippedData.length / 2) + 1);
+ IOUtils.getInstance().copyWriter(reader, writer);
+ return writer.toString();
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed to copy buffer", e);
+ }
+ }
+
+ public Reader getXmlAsReader() throws ReportProcessingException
+ {
+ try
+ {
+ final byte[] zippedData = xmlBuffer.getRaw();
+ return new InputStreamReader
+ (new InflaterInputStream(new ByteArrayInputStream(zippedData, 0, xmlBuffer.getLength())), "UTF-16");
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed to copy buffer", e);
+ }
+ }
+ }
+
+ protected static class GroupContext
+ {
+ private GroupContext parent;
+ private int iterationCount;
+
+ protected GroupContext(final GroupContext parent)
+ {
+ this.parent = parent;
+ }
+
+ public GroupContext getParent()
+ {
+ return parent;
+ }
+
+ public int getIterationCount()
+ {
+ return iterationCount;
+ }
+
+ public void iterationFinished()
+ {
+ iterationCount += 1;
+ }
+ }
+
+ private FastStack states;
+ private int currentRole;
+
+ private FastStack xmlWriters;
+ private XmlWriter rootXmlWriter;
+
+ /**
+ * This styles-collection contains all styles that were predefined in the report definition file. The common styles
+ * and the master-styles will be written unmodified, the automatic styles will be ignored.
+ */
+ private OfficeStylesCollection predefinedStylesCollection;
+
+ /**
+ * This styles-collection contains all master-styles that have been generated by the report definition process. It
+ * also contains all automatic styles that have been generated for the page-bands (and the pagebands as well).
+ */
+ private OfficeStylesCollection globalStylesCollection;
+
+ /**
+ * The content styles collection contains all automatic styles that have been generated for the normal-flow content.
+ */
+ private OfficeStylesCollection contentStylesCollection;
+
+ private OutputRepository outputRepository;
+ private AttributeNameGenerator tableNameGenerator;
+ private AttributeNameGenerator autoStyleNameGenerator;
+ private String target;
+ private static final int INITIAL_BUFFER_SIZE = 40960;
+ private StyleMapper styleMapper;
+ private StyleSheetParserUtil styleSheetParserUtil;
+ private AttributeNameGenerator imageNames;
+ private ImageProducer imageProducer;
+ private GroupContext groupContext;
+ private static final boolean DEBUG_ELEMENTS =
+ JFreeReportBoot.getInstance().getExtendedConfig().getBoolProperty
+ ("com.sun.star.report.pentaho.output.DebugElements");
+
+ protected OfficeDocumentReportTarget(final ReportJob reportJob,
+ final ResourceManager resourceManager,
+ final ResourceKey baseResource,
+ final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final String target,
+ final ImageService imageService)
+ throws ReportProcessingException
+ {
+ super(reportJob, resourceManager, baseResource);
+ if (imageService == null)
+ {
+ throw new NullPointerException("ImageService must not be null");
+ }
+ if (target == null)
+ {
+ throw new NullPointerException("Target-Name must not be null");
+ }
+
+ this.target = target;
+
+ this.tableNameGenerator = new AttributeNameGenerator();
+ this.autoStyleNameGenerator = new AttributeNameGenerator();
+ this.outputRepository = outputRepository;
+ this.states = new FastStack();
+ this.xmlWriters = new FastStack();
+ this.imageNames = new AttributeNameGenerator();
+
+ this.imageProducer = new ImageProducer(inputRepository, outputRepository, imageService);
+
+ try
+ {
+ final ResourceManager realResourceManager = getResourceManager();
+ styleMapper = StyleMapper.loadInstance(realResourceManager);
+ }
+ catch (ResourceException e)
+ {
+ throw new ReportProcessingException("Failed to load style-mapper", e);
+ }
+ }
+
+ protected abstract String getTargetMimeType();
+
+ protected OutputRepository getOutputRepository()
+ {
+ return outputRepository;
+ }
+
+ /**
+ * Starts the output of a new office document. This method writes the generic 'office:document-content' tag along with
+ * all known namespace declarations.
+ *
+ * @param report the report object.
+ * @throws DataSourceException if there was an error accessing the datasource
+ * @throws ReportProcessingException if some other error occured.
+ */
+ public void startReport(final ReportStructureRoot report)
+ throws DataSourceException, ReportProcessingException
+ {
+ imageNames.reset();
+ this.groupContext = new GroupContext(null);
+
+ final DefaultTagDescription tagDescription = createTagDescription();
+ try
+ {
+ final OutputStream outputStream = outputRepository.createOutputStream(target,"text/xml");
+ final Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
+
+ this.rootXmlWriter = new XmlWriter(writer, tagDescription);
+ this.rootXmlWriter.setAlwaysAddNamespace(true);
+
+ final AttributeList rootAttributes = new AttributeList();
+ rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS);
+ rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS);
+ rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS);
+ rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS);
+ rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS);
+ rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS);
+ rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS);
+ rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS);
+ rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS);
+ rootAttributes.addNamespaceDeclaration("number", OfficeNamespaces.DATASTYLE_NS);
+ rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS);
+ rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS);
+ rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS);
+ rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS);
+ rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS);
+ rootAttributes.addNamespaceDeclaration("script", OfficeNamespaces.SCRIPT_NS);
+ rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
+ rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS);
+ rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS);
+ rootAttributes.addNamespaceDeclaration("dom", OfficeNamespaces.XML_EVENT_NS);
+ rootAttributes.addNamespaceDeclaration("xforms", OfficeNamespaces.XFORMS_NS);
+ rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS);
+ rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS);
+ rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");
+
+ this.rootXmlWriter.writeXmlDeclaration("UTF-8");
+ this.rootXmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-content", rootAttributes, XmlWriterSupport.OPEN);
+
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_DOCUMENT));
+
+ autoStyleNameGenerator.reset();
+ tableNameGenerator.reset();
+
+ final OfficeDocument reportDoc = (OfficeDocument) report;
+ predefinedStylesCollection = reportDoc.getStylesCollection();
+
+ final OfficeStyles commonStyles = predefinedStylesCollection.getCommonStyles();
+ if (commonStyles.containsStyle("graphic", "Graphics") == false)
+ {
+ final OfficeStyle graphicsDefaultStyle = new OfficeStyle();
+ graphicsDefaultStyle.setStyleFamily("graphic");
+ graphicsDefaultStyle.setStyleName("Graphics");
+ final Element graphicProperties = produceFirstChild(graphicsDefaultStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
+ graphicProperties.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", "paragraph");
+ graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "x", "0cm");
+ graphicProperties.setAttribute(OfficeNamespaces.SVG_NS, "y", "0cm");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap", "dynamic");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "number-wrapped-paragraphs", "no-limit");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "wrap-contour", "false");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-pos", "top");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-rel", "paragraph");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-pos", "center");
+ graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "horizontal-rel", "paragraph");
+ commonStyles.addStyle(graphicsDefaultStyle);
+ }
+
+ // Make sure that later generated styles do not overwrite existing styles.
+ fillStyleNameGenerator(predefinedStylesCollection);
+
+ contentStylesCollection = new OfficeStylesCollection();
+ globalStylesCollection = new OfficeStylesCollection();
+
+ startBuffering(contentStylesCollection, true);
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+ protected AttributeNameGenerator getAutoStyleNameGenerator()
+ {
+ return autoStyleNameGenerator;
+ }
+
+ private void fillStyleNameGenerator(final OfficeStylesCollection stylesCollection)
+ {
+ final OfficeStyles commonStyles = stylesCollection.getCommonStyles();
+ final OfficeStyle[] allCommonStyles = commonStyles.getAllStyles();
+ for (int i = 0; i < allCommonStyles.length; i++)
+ {
+ final OfficeStyle style = allCommonStyles[i];
+ autoStyleNameGenerator.generateName(style.getStyleName());
+ }
+
+ final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
+ final OfficeStyle[] allAutoStyles = autoStyles.getAllStyles();
+ for (int i = 0; i < allAutoStyles.length; i++)
+ {
+ final OfficeStyle style = allAutoStyles[i];
+ autoStyleNameGenerator.generateName(style.getStyleName());
+ }
+ }
+
+ public OfficeStylesCollection getPredefinedStylesCollection()
+ {
+ return predefinedStylesCollection;
+ }
+
+ public OfficeStylesCollection getGlobalStylesCollection()
+ {
+ return globalStylesCollection;
+ }
+
+ public OfficeStylesCollection getContentStylesCollection()
+ {
+ return contentStylesCollection;
+ }
+
+ /**
+ * Returns the XML-Writer tag description. This description defines whether an element can have character data inside.
+ * Such element will disable the indention, as in that case the additional whitespaces might alter the meaning of the
+ * element's contents.
+ *
+ * @return the tag description library.
+ */
+ protected DefaultTagDescription createTagDescription()
+ {
+ final DefaultTagDescription tagDescription = new DefaultTagDescription();
+ tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(),
+ OfficeDocumentReportTarget.TAG_DEF_PREFIX);
+ return tagDescription;
+ }
+
+ /**
+ * Returns the current processing state.
+ *
+ * @return the processing state.
+ */
+ protected int getCurrentState()
+ {
+ if (states.isEmpty())
+ {
+ throw new IllegalStateException();
+ }
+ final Integer o = (Integer) states.peek();
+ return o.intValue();
+ }
+
+ /**
+ * Starts the processing of an element and updates the processing state. This will select an apropriate handler method
+ * for the call and will call one of the start* methods.
+ *
+ * @param attrs the attribute map for the current element
+ * @throws DataSourceException
+ * @throws ReportProcessingException
+ */
+ public final void startElement(final AttributeMap attrs)
+ throws DataSourceException, ReportProcessingException
+ {
+ // todo
+ if (DEBUG_ELEMENTS)
+ {
+ Log.debug("Starting " + getCurrentState() + "/" + states.size() + " " +
+ ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " +
+ ReportTargetUtil.getElemenTypeFromAttribute(attrs));
+ }
+ try
+ {
+ switch (getCurrentState())
+ {
+ case OfficeDocumentReportTarget.STATE_IN_DOCUMENT:
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OFFICE_NS, "body", attrs))
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_BODY));
+ startBody(attrs);
+ }
+ else
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
+ if (isFilteredNamespace(ReportTargetUtil.getNamespaceFromAttribute(attrs)) == false)
+ {
+ startOther(attrs);
+ }
+ }
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_BODY:
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OFFICE_NS, "report", attrs))
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_CONTENT));
+ startContent(attrs);
+ }
+ else
+ {
+ throw new IllegalStateException
+ ("The 'office:body' element must have exactly one child of type 'report'");
+ }
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_CONTENT:
+ case OfficeDocumentReportTarget.STATE_IN_GROUP:
+ case OfficeDocumentReportTarget.STATE_IN_GROUP_BODY:
+ {
+ // A group.
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "group-body", attrs) ||
+ ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "report-body", attrs))
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP_BODY));
+ startGroupBody(attrs);
+ }
+ else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group", attrs))
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_GROUP));
+ groupContext = new GroupContext(groupContext);
+ startGroup(attrs);
+ }
+ else
+ {
+ // Either a page-header, page-footer, report-header, report-footer
+ // or detail-band or variables-section
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION));
+ currentRole = computeRoleForSection(attrs);
+ startReportSection(attrs, currentRole);
+ }
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_SECTION:
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
+ startOther(attrs);
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_OTHER:
+ {
+ states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_OTHER));
+ startOther(attrs);
+ return;
+ }
+ default:
+ throw new IllegalStateException("Failure: " + getCurrentState());
+ }
+ }
+ catch (IOException ioe)
+ {
+ ioe.printStackTrace();
+ throw new ReportProcessingException("Failed to write content", ioe);
+ }
+// finally
+// {
+// Log.debug ("Started " + getNamespaceFromAttribute(attrs) + ":" +
+// getElemenTypeFromAttribute(attrs) + " -> " + getCurrentState());
+// }
+ }
+
+ protected GroupContext getGroupContext()
+ {
+ return groupContext;
+ }
+
+ protected void performStyleProcessing(final AttributeMap attrs)
+ throws ReportProcessingException
+ {
+ final OfficeStylesCollection stylesCollection = getStylesCollection();
+ final OfficeStylesCollection predefCollection = getPredefinedStylesCollection();
+ final OfficeStylesCollection globalStylesCollection = getGlobalStylesCollection();
+
+ final String elementNamespace =
+ ReportTargetUtil.getNamespaceFromAttribute(attrs);
+ final String elementName =
+ ReportTargetUtil.getElemenTypeFromAttribute(attrs);
+
+ final String[] namespaces = attrs.getNameSpaces();
+ for (int i = 0; i < namespaces.length; i++)
+ {
+ final String attrNamespace = namespaces[i];
+ if (isFilteredNamespace(attrNamespace))
+ {
+ continue;
+ }
+
+ final Map attributes = attrs.getAttributes(attrNamespace);
+ final Iterator iterator = attributes.entrySet().iterator();
+ while (iterator.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry) iterator.next();
+ final String attrName = (String) entry.getKey();
+ final String attrValue = String.valueOf(entry.getValue());
+
+ final String styleFamily = styleMapper.getStyleFamilyFor
+ (elementNamespace, elementName, attrNamespace, attrName);
+ if (styleFamily == null)
+ {
+ // None of the known style attributes.
+ continue;
+ }
+
+ if (styleMapper.isListOfStyles
+ (elementNamespace, elementName, attrNamespace, attrName))
+ {
+ // ignored for now.
+ Log.warn("List of styles is not yet implemented.");
+ continue;
+ }
+
+ // Copy styles is only called once per style.
+ StyleUtilities.copyStyle(styleFamily, attrValue, stylesCollection, globalStylesCollection, predefCollection);
+ }
+ }
+ }
+
+
+ private int computeRoleForSection(final AttributeMap attrs)
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "template", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_TEMPLATE;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-header", attrs))
+ {
+ if ("true".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section")))
+ {
+ return OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER;
+ }
+ return OfficeDocumentReportTarget.ROLE_GROUP_HEADER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-footer", attrs))
+ {
+ if ("true".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "repeated-section")))
+ {
+ return OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER;
+ }
+ return OfficeDocumentReportTarget.ROLE_GROUP_FOOTER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "page-header", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_PAGE_HEADER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "page-footer", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_PAGE_FOOTER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "report-header", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_REPORT_HEADER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "report-footer", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_REPORT_FOOTER;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "detail", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_DETAIL;
+ }
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "variables-section", attrs))
+ {
+ return OfficeDocumentReportTarget.ROLE_VARIABLES;
+ }
+ throw new IllegalStateException();
+ //return OfficeDocumentReportTarget.ROLE_NONE;
+ }
+
+ protected void startBody(final AttributeMap attrs)
+ throws IOException
+ {
+ getXmlWriter().writeTag(OfficeNamespaces.OFFICE_NS, "body", XmlWriterSupport.OPEN);
+ }
+
+ protected void startReportSection(final AttributeMap attrs, final int role)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER ||
+ role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER ||
+ role == OfficeDocumentReportTarget.ROLE_TEMPLATE)
+ {
+ startBuffering(new OfficeStylesCollection(), true);
+ }
+ }
+
+ protected abstract void startContent(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException;
+
+ protected void startGroup(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ }
+
+ protected void startGroupBody(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ }
+
+ protected abstract void startOther(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException;
+
+ public void processText(final String text)
+ throws DataSourceException, ReportProcessingException
+ {
+ try
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+ final LineBreakIterator lb = new LineBreakIterator(text);
+ while (lb.hasNext())
+ {
+ final String line = (String) lb.next();
+ final String normalizedText = XmlWriterSupport.normalize(line, false);
+ xmlWriter.writeText(normalizedText);
+ if (lb.hasNext())
+ {
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE);
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+ protected boolean isFilteredNamespace(final String namespace)
+ {
+ if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (OfficeNamespaces.INTERNAL_NS.equals(namespace))
+ {
+ return true;
+ }
+ if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (OfficeNamespaces.OOREPORT_NS.equals(namespace))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void processContent(final DataFlags value)
+ throws DataSourceException, ReportProcessingException
+ {
+ final Object rawvalue = value.getValue();
+ if (rawvalue == null)
+ {
+ return;
+ }
+
+ // special handler for image (possibly also for URL ..)
+ if (rawvalue instanceof Image)
+ {
+ // do nothing yet. We should define something for that later ..
+ return;
+ }
+
+ final XmlWriter xmlWriter = getXmlWriter();
+ final String text = String.valueOf(rawvalue);
+ try
+ {
+ final LineBreakIterator lb = new LineBreakIterator(text);
+ while (lb.hasNext())
+ {
+ final String line = (String) lb.next();
+ final String normalizedText = XmlWriterSupport.normalize(line, false);
+ xmlWriter.writeText(normalizedText);
+ if (lb.hasNext())
+ {
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE);
+ }
+ }
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+
+ public void endElement(final AttributeMap attrs)
+ throws DataSourceException, ReportProcessingException
+ {
+ // final int oldState = getCurrentState();
+ try
+ {
+
+ switch (getCurrentState())
+ {
+ case OfficeDocumentReportTarget.STATE_IN_OTHER:
+ {
+ endOther(attrs);
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_SECTION:
+ {
+ endReportSection(attrs, currentRole);
+ currentRole = OfficeDocumentReportTarget.ROLE_NONE;
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_GROUP:
+ {
+ endGroup(attrs);
+ groupContext = groupContext.getParent();
+ groupContext.iterationFinished();
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_GROUP_BODY:
+ {
+ endGroupBody(attrs);
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_CONTENT:
+ {
+ endContent(attrs);
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_BODY:
+ {
+ endBody(attrs);
+ return;
+ }
+ case OfficeDocumentReportTarget.STATE_IN_DOCUMENT:
+ {
+ throw new IllegalStateException("This cannot be.");
+ }
+ default:
+ {
+ throw new IllegalStateException("Invalid state encountered.");
+ }
+ }
+ }
+ catch (IOException ioe)
+ {
+ throw new ReportProcessingException("IO Error while writing content",
+ ioe);
+ }
+ finally
+ {
+ states.pop();
+
+ if (DEBUG_ELEMENTS)
+ {
+ Log.debug("Finished " + getCurrentState() + "/" + states.size() + " " +
+ ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" +
+ ReportTargetUtil.getElemenTypeFromAttribute(attrs));
+ }
+
+ }
+ }
+
+ protected void endGroupBody(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+
+ }
+
+ public int getCurrentRole()
+ {
+ return currentRole;
+ }
+
+ protected abstract void endOther(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException;
+
+ protected void endReportSection(final AttributeMap attrs,
+ final int role)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER ||
+ role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER ||
+ role == OfficeDocumentReportTarget.ROLE_TEMPLATE)
+ {
+ finishBuffering();
+ }
+ }
+
+ protected void endGroup(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ }
+
+ protected abstract void endContent(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException;
+
+ protected void endBody(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ getXmlWriter().writeCloseTag();
+ }
+
+ public void endReport(final ReportStructureRoot report)
+ throws DataSourceException, ReportProcessingException
+ {
+ if (xmlWriters.size() != 1)
+ {
+ throw new IllegalStateException("Invalid writer-stack state");
+ }
+
+ try
+ {
+ final StylesWriter inlineStylesWriter = new StylesWriter(rootXmlWriter);
+ inlineStylesWriter.writeContentStyles
+ (predefinedStylesCollection, contentStylesCollection);
+
+ final BufferState state = finishBuffering();
+ this.rootXmlWriter.writeStream(state.getXmlAsReader());
+
+ final OutputStream stylesOutStream =
+ outputRepository.createOutputStream("styles.xml","text/xml");
+ final OutputStreamWriter osw =
+ new OutputStreamWriter(stylesOutStream, "UTF-8");
+ final StylesWriter stylesWriter = new StylesWriter(osw);
+ stylesWriter.writeGlobalStyles
+ (predefinedStylesCollection, globalStylesCollection);
+ stylesWriter.close();
+
+ this.rootXmlWriter.writeCloseTag();
+ this.rootXmlWriter.close();
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+ public XmlWriter getXmlWriter()
+ {
+ final BufferState bufferState = (BufferState) xmlWriters.peek();
+ return bufferState.getXmlWriter();
+ }
+
+ public OfficeStylesCollection getStylesCollection()
+ {
+ final BufferState bufferState = (BufferState) xmlWriters.peek();
+ return bufferState.getStylesCollection();
+ }
+
+ public void startBuffering(final OfficeStylesCollection stylesCollection,
+ final boolean indent) throws ReportProcessingException
+ {
+ final XmlWriter currentWriter;
+ if (xmlWriters.isEmpty())
+ {
+ currentWriter = rootXmlWriter;
+ }
+ else
+ {
+ final BufferState bufferState = (BufferState) xmlWriters.peek();
+ currentWriter = bufferState.getXmlWriter();
+ }
+
+ try
+ {
+ final MemoryByteArrayOutputStream out =
+ new MemoryByteArrayOutputStream(INITIAL_BUFFER_SIZE, 256 * INITIAL_BUFFER_SIZE);
+ final DeflaterOutputStream deflateOut = new DeflaterOutputStream(out);
+ final OutputStreamWriter xmlBuffer = new OutputStreamWriter(deflateOut, "UTF-16");
+ // final StringWriter xmlBuffer = new StringWriter
+ // (OfficeDocumentReportTarget.INITIAL_BUFFER_SIZE);
+ final XmlWriter contentXmlWriter = new XmlWriter(xmlBuffer, createTagDescription());
+ contentXmlWriter.copyNamespaces(currentWriter);
+ if (indent)
+ {
+ contentXmlWriter.setAdditionalIndent(currentWriter.getCurrentIndentLevel());
+ contentXmlWriter.setWriteFinalLinebreak(true);
+ }
+ else
+ {
+ contentXmlWriter.setWriteFinalLinebreak(false);
+ }
+ contentXmlWriter.setAlwaysAddNamespace(true);
+ xmlWriters.push(new BufferState(contentXmlWriter, out, stylesCollection));
+ }
+ catch (IOException ioe)
+ {
+ throw new ReportProcessingException("Unable to create the buffer");
+ }
+ }
+
+ public BufferState finishBuffering() throws ReportProcessingException
+ {
+ final BufferState state = (BufferState) xmlWriters.pop();
+ try
+ {
+ state.getXmlWriter().close();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return state;
+ }
+
+ public void commit()
+ throws ReportProcessingException
+ {
+ // do not call flush before the report is fully finished. Every flush
+ // causes the Office-Backend to fully ZIP all contents (it acts like a
+ // 'Save' call from the UI) and that's expensive like hell
+ }
+
+ public NamespaceDefinition getNamespaceByUri(final String uri)
+ {
+ return null;
+ }
+
+ protected AttributeList buildAttributeList(final AttributeMap attrs)
+ {
+ final AttributeList attrList = new AttributeList();
+ final String[] namespaces = attrs.getNameSpaces();
+ for (int i = 0; i < namespaces.length; i++)
+ {
+ final String attrNamespace = namespaces[i];
+ if (isFilteredNamespace(attrNamespace))
+ {
+ continue;
+ }
+
+ final Map localAttributes = attrs.getAttributes(attrNamespace);
+ final Iterator entries = localAttributes.entrySet().iterator();
+ while (entries.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry) entries.next();
+ final String key = String.valueOf(entry.getKey());
+ if (OfficeNamespaces.TABLE_NS.equals(attrNamespace) &&
+ "name".equals(key))
+ {
+ final String tableName = String.valueOf(entry.getValue());
+ final String saneName = sanitizeName(tableName);
+ attrList.setAttribute(attrNamespace, key,
+ tableNameGenerator.generateName(saneName));
+ }
+ else
+ {
+ attrList.setAttribute
+ (attrNamespace, key, String.valueOf(entry.getValue()));
+ }
+ }
+ }
+ return attrList;
+ }
+
+ protected String sanitizeName(final String name)
+ {
+ // A table name cannot contain spaces and should only contain
+ // ascii-characters.
+ if (name == null)
+ {
+ return "";
+ }
+ final char[] chars = name.toCharArray();
+ final StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < chars.length; i++)
+ {
+ final char aChar = chars[i];
+ if (Character.isWhitespace(aChar))
+ {
+ buffer.append('_');
+ }
+ else
+ {
+ buffer.append(aChar);
+ }
+ }
+ return buffer.toString();
+ }
+
+ /**
+ * Returns the length in point. This method is f**king slow, it eats half of the processing time. I surely should
+ * replace it with something more efficient later.
+ *
+ * @param text
+ * @return
+ */
+ protected CSSNumericValue parseLength(final String text)
+ {
+ if (styleSheetParserUtil == null)
+ {
+ styleSheetParserUtil = StyleSheetParserUtil.getInstance();
+ }
+
+ final LexicalUnit cssValue = styleSheetParserUtil.parseLexicalStyleValue(
+ text);
+ return CSSValueFactory.createLengthValue(cssValue);
+ }
+
+ public boolean isRepeatingSection()
+ {
+ return (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER ||
+ currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER ||
+ currentRole == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER ||
+ currentRole == OfficeDocumentReportTarget.ROLE_PAGE_HEADER ||
+ currentRole == OfficeDocumentReportTarget.ROLE_VARIABLES);
+
+ }
+
+ protected OfficeStyle deriveStyle(final String styleFamily, final String styleName)
+ throws ReportProcessingException
+ {
+ // autogenerate a style. The style has already been added to the current
+ // auto-collection.
+ final OfficeStyle style = StyleUtilities.deriveStyle(styleFamily, styleName,
+ getStylesCollection(), getGlobalStylesCollection(),
+ getPredefinedStylesCollection(), getAutoStyleNameGenerator());
+ return style;
+ }
+
+
+ protected void startImageProcessing(final AttributeMap attrs)
+ throws ReportProcessingException
+ {
+ final Object imageData = attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "image-data");
+ final boolean preserveIRI = "true".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "preserve-IRI"));
+
+ // for the first shot, do nothing fancy ..
+ final ImageProducer.OfficeImage image = imageProducer.produceImage(imageData, preserveIRI);
+ if (image != null)
+ {
+ final ImageElementContext imageContext = (ImageElementContext)
+ attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "image-context");
+
+ // When scaling, we have to create an image-style.
+ final CSSNumericValue width = image.getWidth(); // always in 100th of a mm
+ final CSSNumericValue height = image.getHeight(); // always in 100th of a mm
+
+ Log.debug ("Image " + imageData + " Width: " + width + ", Height: " + height);
+
+ CSSNumericValue imageAreaWidthVal;
+ CSSNumericValue imageAreaHeightVal;
+ String styleName = null;
+ if (imageContext != null)
+ {
+ imageAreaWidthVal = computeImageWidth(imageContext);
+ imageAreaHeightVal = computeImageHeight(imageContext);
+
+ // compute the clip-area ..
+ final CSSNumericValue normalizedImageWidth =
+ CSSValueResolverUtility.convertLength(width, imageAreaWidthVal.getType());
+ final CSSNumericValue normalizedImageHeight =
+ CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType());
+
+ final boolean scale = "true".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "scale"));
+ if (scale == false && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0)
+ {
+ final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
+ final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
+ if (clipWidth > 0 && clipHeight > 0)
+ {
+ final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
+ final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
+ final StringBuffer buffer = new StringBuffer();
+ buffer.append("rect(");
+ buffer.append(clipHeight / 2);
+ buffer.append(imageAreaHeightVal.getType().getType());
+ buffer.append(" ");
+ buffer.append(clipWidth / 2);
+ buffer.append(imageAreaWidthVal.getType().getType());
+ buffer.append(" ");
+ buffer.append(clipHeight / 2);
+ buffer.append(imageAreaHeightVal.getType().getType());
+ buffer.append(" ");
+ buffer.append(clipWidth / 2);
+ buffer.append(imageAreaWidthVal.getType().getType());
+ buffer.append(")");
+ graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
+
+ styleName = imageStyle.getStyleName();
+ getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
+ }
+ else if (clipWidth > 0)
+ {
+ final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
+ final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
+ final StringBuffer buffer = new StringBuffer();
+ buffer.append("rect(0cm ");
+ buffer.append(clipWidth / 2);
+ buffer.append(imageAreaWidthVal.getType().getType());
+ buffer.append(" 0cm ");
+ buffer.append(clipWidth / 2);
+ buffer.append(imageAreaWidthVal.getType().getType());
+ buffer.append(")");
+ graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
+
+ styleName = imageStyle.getStyleName();
+ getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
+ imageAreaHeightVal = normalizedImageHeight;
+ }
+ else if (clipHeight > 0)
+ {
+ final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
+ final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
+ final StringBuffer buffer = new StringBuffer();
+ buffer.append("rect(");
+ buffer.append(clipHeight / 2);
+ buffer.append(imageAreaHeightVal.getType().getType());
+ buffer.append(" 0cm ");
+ buffer.append(clipHeight / 2);
+ buffer.append(imageAreaHeightVal.getType().getType());
+ buffer.append(" 0cm)");
+ graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());
+
+ styleName = imageStyle.getStyleName();
+ getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
+ imageAreaWidthVal = normalizedImageWidth;
+ }
+ else
+ {
+ imageAreaWidthVal = normalizedImageWidth;
+ imageAreaHeightVal = normalizedImageHeight;
+ }
+ }
+ // If we do scale, then we simply use the given image-area-size as valid image size and dont
+ // care about the image itself ..
+ }
+ else
+ {
+ Log.debug ("There is no image-context, so we have to rely on the image's natural bounds. " +
+ "This may go awfully wrong.");
+ imageAreaWidthVal = image.getWidth();
+ imageAreaHeightVal = image.getHeight();
+ }
+
+ final AttributeList frameList = new AttributeList();
+ frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "name", imageNames.generateName("Image"));
+ if (styleName != null)
+ {
+ frameList.setAttribute(OfficeNamespaces.DRAWING_NS, "style-name", styleName);
+ }
+ frameList.setAttribute(OfficeNamespaces.TEXT_NS, "anchor-type", "paragraph");
+ frameList.setAttribute(OfficeNamespaces.SVG_NS, "z-index", "0");
+ frameList.setAttribute(OfficeNamespaces.SVG_NS, "x", "0cm");
+ frameList.setAttribute(OfficeNamespaces.SVG_NS, "y", "0cm");
+
+ Log.debug ("Image " + imageData + " A-Width: " + imageAreaWidthVal + ", A-Height: " + imageAreaHeightVal);
+
+ if (imageAreaWidthVal != null)
+ {
+ frameList.setAttribute(OfficeNamespaces.SVG_NS,
+ "width", String.valueOf(imageAreaWidthVal.getValue()) + imageAreaWidthVal.getType().getType());
+ }
+
+ if (imageAreaHeightVal != null)
+ {
+ frameList.setAttribute(OfficeNamespaces.SVG_NS,
+ "height", String.valueOf(imageAreaHeightVal.getValue()) + imageAreaHeightVal.getType().getType());
+ }
+
+
+ final AttributeList imageList = new AttributeList();
+ imageList.setAttribute(OfficeNamespaces.XLINK_NS, "href", image.getEmbeddableLink());
+ imageList.setAttribute(OfficeNamespaces.XLINK_NS, "type", "simple");
+ imageList.setAttribute(OfficeNamespaces.XLINK_NS, "show", "embed");
+ imageList.setAttribute(OfficeNamespaces.XLINK_NS, "actuate", "onLoad");
+
+
+ try
+ {
+ getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "frame", frameList, XmlWriterSupport.OPEN);
+ getXmlWriter().writeTag(OfficeNamespaces.DRAWING_NS, "image", imageList, XmlWriterSupport.CLOSE);
+ getXmlWriter().writeCloseTag();
+ }
+ catch (IOException ioe)
+ {
+ throw new ReportProcessingException("Failed", ioe);
+ }
+ }
+ }
+
+ private CSSNumericValue computeImageWidth(final ImageElementContext imageElementContext)
+ {
+ final LengthCalculator calculator = new LengthCalculator();
+ final String[] strings = imageElementContext.getColStyles();
+ for (int i = 0; i < strings.length; i++)
+ {
+ final String styleName = strings[i];
+ final CSSNumericValue value = computeColumnWidth(styleName);
+ if (value != null)
+ {
+ calculator.add(value);
+ }
+ }
+ return calculator.getResult();
+ }
+
+ private CSSNumericValue computeImageHeight(final ImageElementContext imageElementContext)
+ {
+ final LengthCalculator calculator = new LengthCalculator();
+ final String[] strings = imageElementContext.getRowStyles();
+ for (int i = 0; i < strings.length; i++)
+ {
+ final String styleName = strings[i];
+ final CSSNumericValue value = computeRowHeight(styleName);
+ if (value != null)
+ {
+ calculator.add(value);
+ }
+ }
+ return calculator.getResult();
+ }
+
+
+ protected CSSNumericValue computeRowHeight(final String rowStyle)
+ {
+ final OfficeStylesCollection contentStyles = getContentStylesCollection();
+ final OfficeStyle style = contentStyles.getStyle("table-row", rowStyle);
+ if (style != null)
+ {
+ final Element element = style.getTableRowProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+
+ final String styleParent = style.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+
+ final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
+ final OfficeStyle globalStyle = globalStyles.getStyle("table-row", rowStyle);
+ if (globalStyle != null)
+ {
+ final Element element = globalStyle.getTableRowProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+ final String styleParent = globalStyle.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+
+ final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
+ final OfficeStyle predefStyle = predefStyles.getStyle("table-row", rowStyle);
+ if (predefStyle != null)
+ {
+ final Element element = predefStyle.getTableRowProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+ final String styleParent = predefStyle.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+ // not found.
+ return null;
+ }
+
+
+ protected CSSNumericValue computeColumnWidth(final String colStyle)
+ {
+ final OfficeStylesCollection contentStyles = getContentStylesCollection();
+ final OfficeStyle style = contentStyles.getStyle("table-column", colStyle);
+ if (style != null)
+ {
+ final Element element = style.getTableColumnProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+
+ final String styleParent = style.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+
+ final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
+ final OfficeStyle globalStyle = globalStyles.getStyle("table-column", colStyle);
+ if (globalStyle != null)
+ {
+ final Element element = globalStyle.getTableColumnProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+ final String styleParent = globalStyle.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+
+ final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
+ final OfficeStyle predefStyle = predefStyles.getStyle("table-column", colStyle);
+ if (predefStyle != null)
+ {
+ final Element element = predefStyle.getTableColumnProperties();
+ if (element != null)
+ {
+ final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
+ if (height != null)
+ {
+ return parseLength(height);
+ }
+ }
+ final String styleParent = predefStyle.getStyleParent();
+ if (styleParent != null)
+ {
+ return computeRowHeight(styleParent);
+ }
+ }
+ // not found.
+ return null;
+ }
+
+ protected Element produceFirstChild(final Section style,
+ final String nameSpace,
+ final String type)
+ {
+ Element paragraphProps = style.findFirstChild(nameSpace, type);
+ if (paragraphProps == null)
+ {
+ paragraphProps = new Section();
+ paragraphProps.setNamespace(nameSpace);
+ paragraphProps.setType(type);
+ style.addNode(paragraphProps);
+ }
+ return paragraphProps;
+ }
+
+
+} \ No newline at end of file
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java b/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java
new file mode 100644
index 000000000000..c709dd6fbe29
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/StyleUtilities.java
@@ -0,0 +1,513 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleUtilities.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output;
+
+import java.util.HashSet;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.DataStyle;
+import com.sun.star.report.pentaho.model.FontFaceDeclsSection;
+import com.sun.star.report.pentaho.model.FontFaceElement;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.structure.Element;
+import org.jfree.report.util.AttributeNameGenerator;
+import org.jfree.util.Log;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class StyleUtilities
+{
+
+ private StyleUtilities()
+ {
+ }
+
+ /**
+ * Copies the specififed style (keyed by its family and name) into the current styles collection. This copies the
+ * style and all inherited styles into the target collection. Inherited common styles will be always be added to the
+ * common collection (which will be written into the 'styles.xml' later).
+ * <p/>
+ * This method does nothing if the specified style already exists in the styles collection.
+ *
+ * @param styleFamily the family of the style to copy
+ * @param styleName the unique name of the style.
+ * @param stylesCollection the current styles collection
+ * @param commonCollection the global styles collection
+ * @param predefCollection the predefined styles from where to copy the styles.
+ * @throws ReportProcessingException if the style copying failed.
+ */
+ public static void copyStyle(final String styleFamily,
+ final String styleName,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection)
+ throws ReportProcessingException
+ {
+ copyStyle(styleFamily, styleName, stylesCollection,
+ commonCollection, predefCollection, new HashSet());
+ }
+
+ /**
+ * Copies the specififed style (keyed by its family and name) into the current styles collection. This copies the
+ * style and all inherited styles into the target collection. Inherited common styles will be always be added to the
+ * common collection (which will be written into the 'styles.xml' later).
+ * <p/>
+ * This method does nothing if the specified style already exists in the styles collection.
+ *
+ * @param styleFamily the family of the style to copy
+ * @param styleName the unique name of the style.
+ * @param stylesCollection the current styles collection
+ * @param commonCollection the global styles collection
+ * @param predefCollection the predefined styles from where to copy the styles.
+ * @param inheritanceTracker a collection of all styles that have been touched. This is used to prevent infinite
+ * loops and duplicates.
+ * @throws ReportProcessingException if the style copying failed.
+ */
+ private static void copyStyle(final String styleFamily,
+ final String styleName,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection,
+ final HashSet inheritanceTracker)
+ throws ReportProcessingException
+ {
+ if (inheritanceTracker.contains(styleName))
+ {
+ return;
+ }
+ inheritanceTracker.add(styleName);
+
+ if (stylesCollection.containsStyle(styleFamily, styleName) ||
+ commonCollection.getCommonStyles().containsStyle(styleFamily, styleName))
+ {
+ // fine, there's already a copy of the stylesheet.
+ return;
+ }
+
+ final OfficeStyle predefCommonStyle =
+ predefCollection.getCommonStyles().getStyle(styleFamily, styleName);
+ if (predefCommonStyle != null)
+ {
+ // so we have an style from the predefined collection.
+ // copy it an add it to the current stylescollection
+ final OfficeStyles commonStyles = commonCollection.getCommonStyles();
+
+ copyStyleInternal(predefCommonStyle, commonStyles, stylesCollection,
+ commonCollection, predefCollection, styleFamily, inheritanceTracker);
+ return;
+ }
+
+ final OfficeStyle predefAutoStyle =
+ predefCollection.getAutomaticStyles().getStyle(styleFamily, styleName);
+ if (predefAutoStyle != null)
+ {
+ // so we have an style from the predefined collection.
+ // copy it an add it to the current stylescollection
+ final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
+ copyStyleInternal(predefAutoStyle, autoStyles, stylesCollection,
+ commonCollection, predefCollection, styleFamily, inheritanceTracker);
+ return;
+ }
+
+ // There is no automatic style either. Now this means that someone
+ // messed up the fileformat. Lets create a new empty style for this.
+ final OfficeStyle autostyle = new OfficeStyle();
+ autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ autostyle.setType("style");
+ autostyle.setStyleFamily(styleFamily);
+ autostyle.setStyleName(styleName);
+
+ final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
+ autoStyles.addStyle(autostyle);
+ }
+
+ private static OfficeStyle copyStyleInternal(
+ final OfficeStyle predefCommonStyle,
+ final OfficeStyles styles,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection,
+ final String styleFamily,
+ final HashSet inheritanceTracker)
+ throws ReportProcessingException
+ {
+ try
+ {
+ final OfficeStyle preStyle = (OfficeStyle) predefCommonStyle.clone();
+ styles.addStyle(preStyle);
+ performFontFaceProcessing(preStyle, stylesCollection, predefCollection);
+ performDataStyleProcessing(preStyle, stylesCollection, predefCollection);
+
+ // Lookup the parent style ..
+ final String styleParent = preStyle.getStyleParent();
+ final OfficeStyle inherited =
+ stylesCollection.getStyle(styleFamily, styleParent);
+ if (inherited != null)
+ {
+ // OK, recurse (and hope that we dont run into an infinite loop) ..
+ copyStyle(styleFamily, styleParent, stylesCollection,
+ commonCollection, predefCollection, inheritanceTracker);
+ }
+ else if (styleParent != null)
+ {
+ Log.warn("Inconsistent styles: " + styleFamily + ":" + styleParent + " does not exist.");
+ }
+ return preStyle;
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new ReportProcessingException
+ ("Failed to derive a stylesheet", e);
+ }
+ }
+
+
+ private static void performFontFaceProcessing
+ (final OfficeStyle style,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection predefCollection)
+ throws ReportProcessingException
+ {
+ final Element textProperties = style.getTextProperties();
+ if (textProperties == null)
+ {
+ return;
+ }
+
+ try
+ {
+ final FontFaceDeclsSection currentFonts = stylesCollection.getFontFaceDecls();
+ final FontFaceDeclsSection predefFonts = predefCollection.getFontFaceDecls();
+
+ final String fontName = (String)
+ textProperties.getAttribute(OfficeNamespaces.STYLE_NS, "font-name");
+ if (fontName != null)
+ {
+ if (currentFonts.containsFont(fontName) == false)
+ {
+ final FontFaceElement element = predefFonts.getFontFace(fontName);
+ if (element != null)
+ {
+ currentFonts.addFontFace((FontFaceElement) element.clone());
+ }
+ }
+ }
+
+ final String fontNameAsian = (String)
+ textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
+ "font-name-asian");
+ if (fontNameAsian != null)
+ {
+ if (currentFonts.containsFont(fontNameAsian) == false)
+ {
+ final FontFaceElement element = predefFonts.getFontFace(
+ fontNameAsian);
+ if (element != null)
+ {
+ currentFonts.addFontFace((FontFaceElement) element.clone());
+ }
+ }
+ }
+
+ final String fontNameComplex = (String)
+ textProperties.getAttribute(OfficeNamespaces.STYLE_NS,
+ "font-name-complex");
+ if (fontNameComplex != null)
+ {
+ if (currentFonts.containsFont(fontNameComplex) == false)
+ {
+ final FontFaceElement element = predefFonts.getFontFace(
+ fontNameComplex);
+ if (element != null)
+ {
+ currentFonts.addFontFace((FontFaceElement) element.clone());
+ }
+ }
+ }
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new ReportProcessingException("Failed to clone font-face element");
+ }
+ }
+
+ private static void performDataStyleProcessing
+ (final OfficeStyle style,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection predefCollection)
+ throws ReportProcessingException
+ {
+ final Object attribute = style.getAttribute(OfficeNamespaces.STYLE_NS, "data-style-name");
+ if (attribute == null)
+ {
+ // the easy case: It has no number style at all.
+ return;
+ }
+
+ final String styleName = String.valueOf(attribute);
+ if (stylesCollection.getAutomaticStyles().containsDataStyle(styleName))
+ {
+ return;
+ }
+ if (stylesCollection.getCommonStyles().containsDataStyle(styleName))
+ {
+ return;
+ }
+
+
+ try
+ {
+ final OfficeStyles automaticStyles = predefCollection.getAutomaticStyles();
+ final DataStyle autoDataStyle = automaticStyles.getDataStyle(styleName);
+ if (autoDataStyle != null)
+ {
+ final DataStyle derivedStyle = (DataStyle) autoDataStyle.clone();
+ stylesCollection.getAutomaticStyles().addDataStyle(derivedStyle);
+ return;
+ }
+ final OfficeStyles commonStyles = predefCollection.getCommonStyles();
+ final DataStyle commonDataStyle = commonStyles.getDataStyle(styleName);
+ if (commonDataStyle != null)
+ {
+ final DataStyle derivedStyle = (DataStyle) commonDataStyle.clone();
+ stylesCollection.getCommonStyles().addDataStyle(derivedStyle);
+ return;
+ }
+
+ Log.warn("Dangling data style: " + styleName);
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new ReportProcessingException("Failed to copy style. This should not have happened.");
+ }
+ }
+
+ /**
+ * Derives the named style. If the style is a common style, a new automatic style is generated and inserted into the
+ * given stylesCollection. If the named style is an automatic style, the style is copied and inserted as new automatic
+ * style.
+ * <p/>
+ * After the style has been created, the style's inheritance hierarchy will be copied as well.
+ * <p/>
+ * If there is no style with the given name and family, a new empty automatic style will be created.
+ *
+ * @param styleFamily the family of the style to copy
+ * @param styleName the unique name of the style.
+ * @param stylesCollection the current styles collection
+ * @param commonCollection the global styles collection
+ * @param predefCollection the predefined styles from where to copy the styles.
+ * @param generator the style-name-generator of the current report-target
+ * @return the derived style instance.
+ * @throws ReportProcessingException if the style copying failed.
+ */
+ public static OfficeStyle deriveStyle(final String styleFamily,
+ final String styleName,
+ final OfficeStylesCollection stylesCollection,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection,
+ final AttributeNameGenerator generator)
+ throws ReportProcessingException
+ {
+ if (styleFamily == null)
+ {
+ throw new NullPointerException("StyleFamily must not be null");
+ }
+ if (styleName != null)
+ {
+
+ final OfficeStyle currentAuto =
+ stylesCollection.getAutomaticStyles().getStyle(styleFamily,
+ styleName);
+ if (currentAuto != null)
+ {
+ // handle an automatic style ..
+ final OfficeStyle derivedStyle =
+ deriveAutomaticStyle(currentAuto, styleFamily, styleName,
+ generator, commonCollection, predefCollection);
+ stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+ return derivedStyle;
+ }
+
+ final OfficeStyle currentCommon =
+ stylesCollection.getCommonStyles().getStyle(styleFamily, styleName);
+ if (currentCommon != null)
+ {
+ // handle an common style ..
+ final OfficeStyle derivedStyle =
+ deriveCommonStyle(currentCommon, styleFamily, styleName,
+ generator, commonCollection, predefCollection);
+ stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+ return derivedStyle;
+ }
+
+// final OfficeStyle commonAuto =
+// commonCollection.getAutomaticStyles().getStyle(styleFamily,
+// styleName);
+// if (commonAuto != null)
+// {
+// // handle an automatic style ..
+// final OfficeStyle derivedStyle =
+// deriveAutomaticStyle(commonAuto, styleFamily, styleName,
+// generator, commonCollection, predefCollection);
+// stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+// return derivedStyle;
+// }
+
+ final OfficeStyle commonCommon =
+ commonCollection.getCommonStyles().getStyle(styleFamily, styleName);
+ if (commonCommon != null)
+ {
+ // handle an common style ..
+ final OfficeStyle derivedStyle =
+ deriveCommonStyle(commonCommon, styleFamily, styleName,
+ generator, commonCollection, predefCollection);
+ stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+ return derivedStyle;
+ }
+
+ final OfficeStyle predefAuto =
+ predefCollection.getAutomaticStyles().getStyle(styleFamily,
+ styleName);
+ if (predefAuto != null)
+ {
+ // handle an automatic style ..
+ final OfficeStyle derivedStyle =
+ deriveAutomaticStyle(predefAuto, styleFamily, styleName,
+ generator, commonCollection, predefCollection);
+ stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+ return derivedStyle;
+ }
+
+ final OfficeStyle predefCommon =
+ predefCollection.getCommonStyles().getStyle(styleFamily, styleName);
+ if (predefCommon != null)
+ {
+ // handle an common style ..
+ final OfficeStyle derivedStyle =
+ deriveCommonStyle(predefCommon, styleFamily, styleName,
+ generator, commonCollection, predefCollection);
+ stylesCollection.getAutomaticStyles().addStyle(derivedStyle);
+ return derivedStyle;
+ }
+ }
+
+ // No such style. Create a new one ..
+ final OfficeStyle autostyle = new OfficeStyle();
+ autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ autostyle.setType("style");
+ autostyle.setStyleFamily(styleFamily);
+ if (styleName != null)
+ {
+ autostyle.setStyleName(styleName);
+ }
+ else
+ {
+ autostyle.setStyleName(generator.generateName("derived_anonymous"));
+ }
+
+ final OfficeStyles autoStyles = stylesCollection.getAutomaticStyles();
+ autoStyles.addStyle(autostyle);
+ return autostyle;
+ }
+
+ private static OfficeStyle deriveCommonStyle(final OfficeStyle commonStyle,
+ final String styleFamily,
+ final String styleName,
+ final AttributeNameGenerator nameGenerator,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection)
+ throws ReportProcessingException
+ {
+ final OfficeStyle autostyle = new OfficeStyle();
+ autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ autostyle.setType("style");
+ autostyle.setStyleFamily(styleFamily);
+ autostyle.setStyleName(nameGenerator.generateName("derived_" + styleName));
+ autostyle.setStyleParent(styleName);
+
+ // now copy the common style ..
+ final OfficeStyles commonStyles = commonCollection.getCommonStyles();
+ if (commonStyles.containsStyle(styleFamily, styleName) == false)
+ {
+ copyStyleInternal(commonStyle, commonStyles,
+ commonCollection, commonCollection, predefCollection,
+ styleFamily, new HashSet());
+ }
+ return autostyle;
+ }
+
+ private static OfficeStyle deriveAutomaticStyle(final OfficeStyle commonStyle,
+ final String styleFamily,
+ final String styleName,
+ final AttributeNameGenerator nameGenerator,
+ final OfficeStylesCollection commonCollection,
+ final OfficeStylesCollection predefCollection)
+ throws ReportProcessingException
+ {
+ try
+ {
+ final OfficeStyle autostyle = (OfficeStyle) commonStyle.clone();
+ autostyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ autostyle.setType("style");
+ autostyle.setStyleFamily(styleFamily);
+ autostyle.setStyleName
+ (nameGenerator.generateName("derived_auto_" + styleName));
+
+
+ final String parent = autostyle.getStyleParent();
+ if (parent != null)
+ {
+ copyStyle(styleFamily, parent, commonCollection, commonCollection,
+ predefCollection);
+ }
+ return autostyle;
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new ReportProcessingException(
+ "Deriving the style failed. Clone error: ", e);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java
new file mode 100644
index 000000000000..541a1cacc22d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/StylesWriter.java
@@ -0,0 +1,380 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StylesWriter.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FontFaceDeclsSection;
+import com.sun.star.report.pentaho.model.FontFaceElement;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.model.OfficeMasterPage;
+import com.sun.star.report.pentaho.model.DataStyle;
+import com.sun.star.report.pentaho.model.PageLayout;
+import com.sun.star.report.pentaho.model.RawText;
+import org.jfree.layouting.namespace.Namespaces;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.JFreeReportBoot;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.StaticText;
+import org.jfree.xmlns.common.AttributeList;
+import org.jfree.xmlns.writer.DefaultTagDescription;
+import org.jfree.xmlns.writer.XmlWriter;
+import org.jfree.xmlns.writer.XmlWriterSupport;
+
+/**
+ * This class writes the style collection into a 'styles.xml' document.
+ *
+ * @author Thomas Morgner
+ * @since 09.03.2007
+ */
+public class StylesWriter
+{
+ private XmlWriter xmlWriter;
+ private boolean writeOpeningTag;
+
+ public StylesWriter(final Writer writer)
+ {
+ final DefaultTagDescription tagDescription = new DefaultTagDescription();
+ tagDescription.configure (JFreeReportBoot.getInstance().getGlobalConfig(),
+ OfficeDocumentReportTarget.TAG_DEF_PREFIX);
+
+ this.xmlWriter = new XmlWriter(writer, tagDescription);
+ this.xmlWriter.setAlwaysAddNamespace(true);
+ this.writeOpeningTag = true;
+ }
+
+ public StylesWriter(final XmlWriter xmlWriter)
+ {
+ this.xmlWriter = xmlWriter;
+ this.writeOpeningTag = false;
+ }
+
+ public void writeContentStyles (final OfficeStylesCollection predefined,
+ final OfficeStylesCollection globals)
+ throws IOException, ReportProcessingException
+ {
+ writeFontFaces(new OfficeStylesCollection[] { globals });
+ writeAutomaticStylesSection(new OfficeStylesCollection[] { globals });
+ }
+
+ public void writeGlobalStyles (final OfficeStylesCollection predefined,
+ final OfficeStylesCollection globals)
+ throws IOException, ReportProcessingException
+ {
+ if (writeOpeningTag)
+ {
+ performWriteRootTag();
+ }
+
+ writeFontFaces(new OfficeStylesCollection[] { globals });
+ writeAutomaticStylesSection(new OfficeStylesCollection[] { globals });
+ writeCommonStylesSection(new OfficeStylesCollection[] { globals });
+ writeMasterStylesSection(new OfficeStylesCollection[] { globals });
+
+ if (writeOpeningTag)
+ {
+ xmlWriter.writeCloseTag();
+ }
+ }
+
+ private void writeMasterStylesSection(final OfficeStylesCollection[] osc)
+ throws IOException
+ {
+ xmlWriter.writeTag
+ (OfficeNamespaces.OFFICE_NS, "master-styles", XmlWriterSupport.OPEN);
+ for (int sci = 0; sci < osc.length; sci++)
+ {
+ final OfficeStylesCollection collection = osc[sci];
+ final OfficeMasterStyles officeStyles = collection.getMasterStyles();
+ final OfficeMasterPage[] officeMasterPages = officeStyles.getAllMasterPages();
+ for (int i = 0; i < officeMasterPages.length; i++)
+ {
+ final OfficeMasterPage masterPage = officeMasterPages[i];
+ writeSection(masterPage);
+ }
+
+ writeSectionChilds(officeStyles.getOtherNodes().getNodeArray());
+ }
+
+ xmlWriter.writeCloseTag();
+ }
+
+ private void writeCommonStylesSection(final OfficeStylesCollection[] osc)
+ throws IOException
+ {
+ xmlWriter.writeTag
+ (OfficeNamespaces.OFFICE_NS, "styles", XmlWriterSupport.OPEN);
+
+ for (int sci = 0; sci < osc.length; sci++)
+ {
+ final OfficeStylesCollection collection = osc[sci];
+ final OfficeStyles officeStyles = collection.getCommonStyles();
+ writeStyles(officeStyles);
+ }
+
+ xmlWriter.writeCloseTag();
+ }
+
+ private void writeAutomaticStylesSection(final OfficeStylesCollection[] osc)
+ throws IOException
+ {
+ xmlWriter.writeTag
+ (OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN);
+ for (int sci = 0; sci < osc.length; sci++)
+ {
+ final OfficeStylesCollection collection = osc[sci];
+ final OfficeStyles officeStyles = collection.getAutomaticStyles();
+ writeStyles(officeStyles);
+ }
+
+ xmlWriter.writeCloseTag();
+ }
+
+ private void writeFontFaces(final OfficeStylesCollection[] osc)
+ throws IOException
+ {
+ xmlWriter.writeTag
+ (OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN);
+
+ final TreeMap fontFaces = new TreeMap();
+ for (int sci = 0; sci < osc.length; sci++)
+ {
+ final OfficeStylesCollection collection = osc[sci];
+ final FontFaceDeclsSection fontFaceDecls = collection.getFontFaceDecls();
+ final FontFaceElement[] fontFaceElements = fontFaceDecls.getAllFontFaces();
+ for (int i = 0; i < fontFaceElements.length; i++)
+ {
+ final FontFaceElement element = fontFaceElements[i];
+ fontFaces.put (element.getStyleName(), element);
+ }
+ }
+
+ final Iterator values = fontFaces.values().iterator();
+ while (values.hasNext())
+ {
+ final FontFaceElement element = (FontFaceElement) values.next();
+ writeElement(element);
+ }
+
+ xmlWriter.writeCloseTag();
+ }
+
+ private void writeStyles (final OfficeStyles styles)
+ throws IOException
+ {
+ final OfficeStyle[] allStyles = styles.getAllStyles();
+ for (int i = 0; i < allStyles.length; i++)
+ {
+ final OfficeStyle style = allStyles[i];
+ writeSection(style);
+ }
+
+ final DataStyle[] allDataStyles = styles.getAllDataStyles();
+ for (int i = 0; i < allDataStyles.length; i++)
+ {
+ final DataStyle style = allDataStyles[i];
+ writeSection(style);
+ }
+
+ final PageLayout[] allPageStyles = styles.getAllPageStyles();
+ for (int i = 0; i < allPageStyles.length; i++)
+ {
+ final PageLayout style = allPageStyles[i];
+ writeSection(style);
+ }
+
+ writeSectionChilds(styles.getOtherStyles());
+ }
+
+ private void writeElement (final Element element)
+ throws IOException
+ {
+ final String type = element.getType();
+ final String namespace = element.getNamespace();
+ final AttributeList attrList = buildAttributeList(element.getAttributeMap());
+ xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE);
+ }
+
+ private void writeSection (final Section section)
+ throws IOException
+ {
+ final String type = section.getType();
+ final String namespace = section.getNamespace();
+ final AttributeList attrList = buildAttributeList(section.getAttributeMap());
+ if (section.getNodeCount() == 0)
+ {
+ xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE);
+ return;
+ }
+
+ xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.OPEN);
+ writeSectionChilds(section.getNodeArray());
+
+ xmlWriter.writeCloseTag();
+ }
+
+ private void writeSectionChilds(final Node[] nodes)
+ throws IOException
+ {
+ for (int i = 0; i < nodes.length; i++)
+ {
+ final Node node = nodes[i];
+ if (node instanceof Section)
+ {
+ writeSection((Section) node);
+ }
+ else if (node instanceof Element)
+ {
+ writeElement((Element) node);
+ }
+ else if (node instanceof RawText)
+ {
+ final RawText text = (RawText) node;
+ xmlWriter.writeText(text.getText());
+ }
+ else if (node instanceof StaticText)
+ {
+ final StaticText text = (StaticText) node;
+ xmlWriter.writeText(XmlWriterSupport.normalize(text.getText(), false));
+ }
+ }
+ }
+
+ protected AttributeList buildAttributeList(final AttributeMap attrs)
+ {
+ final AttributeList attrList = new AttributeList();
+ final String[] namespaces = attrs.getNameSpaces();
+ for (int i = 0; i < namespaces.length; i++)
+ {
+ final String attrNamespace = namespaces[i];
+ if (isFilteredNamespace(attrNamespace))
+ {
+ continue;
+ }
+
+ final Map localAttributes = attrs.getAttributes(attrNamespace);
+ final Iterator entries = localAttributes.entrySet().iterator();
+ while (entries.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry) entries.next();
+ final String key = String.valueOf(entry.getKey());
+ attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue()));
+ }
+ }
+ return attrList;
+ }
+
+ protected boolean isFilteredNamespace(final String namespace)
+ {
+ if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace))
+ {
+ return true;
+ }
+ if (OfficeNamespaces.OOREPORT_NS.equals(namespace))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private void performWriteRootTag()
+ throws IOException
+ {
+ final AttributeList rootAttributes = new AttributeList();
+ rootAttributes.addNamespaceDeclaration("office",
+ OfficeNamespaces.OFFICE_NS);
+ rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS);
+ rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS);
+ rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS);
+ rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS);
+ rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS);
+ rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS);
+ rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS);
+ rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS);
+ rootAttributes.addNamespaceDeclaration("number",
+ OfficeNamespaces.DATASTYLE_NS);
+ rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS);
+ rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS);
+ rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS);
+ rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS);
+ rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS);
+ rootAttributes.addNamespaceDeclaration("script",
+ OfficeNamespaces.SCRIPT_NS);
+ rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS);
+ rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS);
+ rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS);
+ rootAttributes.addNamespaceDeclaration("dom",
+ OfficeNamespaces.XML_EVENT_NS);
+ rootAttributes.addNamespaceDeclaration("xforms",
+ OfficeNamespaces.XFORMS_NS);
+ rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS);
+ rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS);
+ rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");
+
+ this.xmlWriter.writeXmlDeclaration("UTF-8");
+ this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS,
+ "document-content", rootAttributes, XmlWriterSupport.OPEN);
+ }
+
+ public void close()
+ throws IOException
+ {
+ xmlWriter.close();
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java
new file mode 100644
index 000000000000..5b471c8f063b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SpreadsheetRawReportProcessor.java,v $
+ *
+<<<<<<< SpreadsheetRawReportProcessor.java
+ * $Revision: 1.2 $
+=======
+ * $Revision: 1.2 $
+>>>>>>> 1.1.2.3
+ *
+<<<<<<< SpreadsheetRawReportProcessor.java
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+=======
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+>>>>>>> 1.1.2.3
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.output.spreadsheet;
+
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportDataFactoryException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.AbstractReportProcessor;
+import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.resourceloader.ResourceManager;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.ImageService;
+
+/**
+ * @author Michael D'Amour
+ */
+public class SpreadsheetRawReportProcessor extends AbstractReportProcessor
+{
+ private OutputRepository outputRepository;
+
+ private String targetName;
+ private InputRepository inputRepository;
+ private ImageService imageService;
+
+ public SpreadsheetRawReportProcessor(final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final String targetName,
+ final ImageService imageService)
+ {
+ if (outputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ if (targetName == null)
+ {
+ throw new NullPointerException();
+ }
+ if (imageService == null)
+ {
+ throw new NullPointerException();
+ }
+ if (inputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ this.targetName = targetName;
+ this.inputRepository = inputRepository;
+ this.outputRepository = outputRepository;
+ this.imageService = imageService;
+ }
+
+ protected ReportTarget createReportTarget(final ReportJob job) throws ReportProcessingException
+ {
+ final ReportStructureRoot report = job.getReportStructureRoot();
+ final ResourceManager resourceManager = report.getResourceManager();
+ return new SpreadsheetRawReportTarget
+ (job, resourceManager, report.getBaseResource(), inputRepository, outputRepository, targetName, imageService);
+ }
+
+ public void processReport(final ReportJob job) throws ReportDataFactoryException, DataSourceException,
+ ReportProcessingException
+ {
+ final ReportTarget reportTarget = createReportTarget(job);
+ // first run: collect table cell sizes for all tables
+ processReportRun(job, reportTarget);
+ // second run: uses table cell data to output a single uniform table
+ processReportRun(job, reportTarget);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
new file mode 100644
index 000000000000..73b1db404cad
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java
@@ -0,0 +1,714 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SpreadsheetRawReportTarget.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:07 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.output.spreadsheet;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.ImageService;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.PentahoReportEngineMetaData;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.model.OfficeMasterPage;
+import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
+import com.sun.star.report.pentaho.output.text.MasterPageFactory;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.layouting.input.style.values.CSSNumericType;
+import org.jfree.report.DataFlags;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
+import org.jfree.report.flow.ReportTargetUtil;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.util.IntegerCache;
+import org.jfree.report.util.TextUtilities;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.xmlns.common.AttributeList;
+import org.jfree.xmlns.writer.XmlWriter;
+import org.jfree.xmlns.writer.XmlWriterSupport;
+
+/**
+ * Creation-Date: 03.11.2007
+ *
+ * @author Michael D'Amour
+ */
+public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget
+{
+ private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[0];
+
+ private boolean elementBoundaryCollectionPass;
+
+ private List columnBoundaryList;
+
+ private float currentRowBoundaryMarker;
+
+ private ColumnBoundary[] sortedBoundaryArray;
+
+ private ColumnBoundary[] boundariesForTableArray;
+
+ private int tableCounter;
+
+ private int columnCounter;
+
+ private int columnSpanCounter;
+
+ private String unitsOfMeasure;
+
+ public SpreadsheetRawReportTarget(final ReportJob reportJob,
+ final ResourceManager resourceManager,
+ final ResourceKey baseResource,
+ final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final String target,
+ final ImageService imageService)
+ throws ReportProcessingException
+ {
+ super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService);
+ columnBoundaryList = new ArrayList();
+ elementBoundaryCollectionPass = true;
+ }
+
+ public void startOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException
+ {
+ final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
+ if (isRepeatingSection() || isFilteredNamespace(namespace))
+ {
+ return;
+ }
+ final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
+ // if this is the report namespace, write out a table definition ..
+ if (OfficeNamespaces.TABLE_NS.equals(namespace) && "table".equals(elementType))
+ {
+ // whenever we see a new table, we increment our tableCounter
+ // this is used to keep tracked of the boundary conditions per table
+ tableCounter++;
+ }
+ if (isElementBoundaryCollectionPass())
+ {
+ collectBoundaryForElement(attrs);
+ }
+ else
+ // if (!isElementBoundaryCollectionPass())
+ {
+ try
+ {
+ processElement(attrs, namespace, elementType);
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+ }
+
+ private void processElement(final AttributeMap attrs, final String namespace, final String elementType)
+ throws IOException, ReportProcessingException
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table", attrs))
+ {
+ // a new table means we must clear our "calculated" table boundary array cache
+ boundariesForTableArray = null;
+ return;
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-column", attrs)
+ || ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-columns", attrs))
+ {
+ return;
+ }
+
+ // covered-table-cell elements may appear in the input from row or column spans. In the event that we hit a
+ // column-span we simply ignore these elements because we are going to adjust the span to fit the uniform table.
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "covered-table-cell", attrs))
+ {
+ if (columnSpanCounter > 0)
+ {
+ columnSpanCounter--;
+ }
+
+ if (columnSpanCounter == 0)
+ {
+ // if we weren't expecting a covered-table-cell, let's use it, it's probably from a row-span
+ columnCounter++;
+ final int span = getColumnSpanForCell(tableCounter, columnCounter, 1);
+ // use the calculated span for the column in the uniform table to create any additional covered-table-cell
+ // elements
+ for (int i = 0; i < span; i++)
+ {
+ xmlWriter.writeTag(namespace, "covered-table-cell", null, XmlWriter.CLOSE);
+ }
+ }
+ return;
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-row", attrs))
+ {
+ // a new row means our column counter gets reset
+ columnCounter = 0;
+ }
+ else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs))
+ {
+ columnCounter++;
+ final String numColSpanStr = (String) attrs.getAttribute(namespace, "number-columns-spanned");
+ int initialColumnSpan = columnSpanCounter = 1;
+ if (numColSpanStr != null)
+ {
+ initialColumnSpan = Integer.parseInt(numColSpanStr);
+ columnSpanCounter = initialColumnSpan;
+ }
+ final int span = getColumnSpanForCell(tableCounter, columnCounter, initialColumnSpan);
+ if (initialColumnSpan > 1)
+ {
+ // add the initial column span to our column counter index (subtract 1, since it is counted by default)
+ columnCounter += initialColumnSpan - 1;
+ }
+
+ // if (span < initialColumnSpan)
+ // {
+ // // ColumnBoundary cbs[] = getBoundariesForTable(tableCounter);
+ // // for (int i = 0; i < cbs.length; i++)
+ // // {
+ // // System.out.print(cbs[i].getBoundary() + " ");
+ // // }
+ // // System.out.println();
+ //
+ // Log.error("A cell cannot span less than the declared columns: Declared=" + initialColumnSpan + " Computed="
+ // + span);
+ // }
+
+ // there's no point to create number-columns-spanned attributes if we only span 1 column
+ if (span > 1)
+ {
+ attrs.setAttribute(namespace, "number-columns-spanned", "" + span);
+ }
+ // we must also generate "covered-table-cell" elements for each column spanned
+ // but we'll do this in the endElement, after we close this "table-cell"
+ }
+
+ // All styles have to be processed or you will loose the paragraph-styles and inline text-styles.
+ // ..
+ performStyleProcessing(attrs);
+
+ final AttributeList attrList = buildAttributeList(attrs);
+ xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN);
+ // System.out.println("elementType = " + elementType);
+ }
+
+ private void collectBoundaryForElement(final AttributeMap attrs)
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-columns", attrs))
+ {
+ // A table row resets the column counter.
+ resetCurrentRowBoundaryMarker();
+ }
+ else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-column", attrs))
+ {
+ final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ if (styleName == null)
+ {
+ // This should not happen, but if it does, we will ignore that cell.
+ return;
+ }
+
+ final OfficeStyle style = getPredefinedStylesCollection().getStyle("table-column", styleName);
+ if (style == null)
+ {
+ // Now this is very bad. It means that there is no style defined with the given name.
+ return;
+ }
+
+ final Element tableColumnProperties = style.getTableColumnProperties();
+ String widthStr = (String) tableColumnProperties.getAttribute("column-width");
+ widthStr = widthStr.substring(0, widthStr.indexOf(getUnitsOfMeasure(widthStr)));
+ addColumnWidthToRowBoundaryMarker(Float.parseFloat(widthStr));
+ ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker());
+ final List columnBoundaryList = getColumnBoundaryList();
+ final int idx = columnBoundaryList.indexOf(currentRowBoundary);
+ if (idx == -1)
+ {
+ columnBoundaryList.add(currentRowBoundary);
+ }
+ else
+ {
+ currentRowBoundary = (ColumnBoundary) columnBoundaryList.get(idx);
+ }
+ currentRowBoundary.addTableIndex(tableCounter);
+ }
+ }
+
+ private String getUnitsOfMeasure(final String str)
+ {
+ if (unitsOfMeasure == null || "".equals(unitsOfMeasure))
+ {
+ if (str == null || "".equals(str))
+ {
+ unitsOfMeasure = "cm";
+ return unitsOfMeasure;
+ }
+
+ // build units of measure, set it
+ int i = str.length() - 1;
+ for (; i >= 0; i--)
+ {
+ final char c = str.charAt(i);
+ if (Character.isDigit(c) || c == '.' || c == ',')
+ {
+ break;
+ }
+ }
+ unitsOfMeasure = str.substring(i + 1);
+ }
+ return unitsOfMeasure;
+ }
+
+ private void createTableColumns() throws ReportProcessingException
+ {
+ try
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+ // at this point we need to generate the table-columns section based on our boundary table
+ // <table-columns>
+ // <table-column style-name="coX"/>
+ // ..
+ // </table-columns>
+ // the first boundary is '0' which is a placeholder so we will ignore it
+ xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "table-columns", null, XmlWriterSupport.OPEN);
+
+ // blow away current column styles
+ // start processing at i=1 because we added a boundary for "0" which is virtual
+ final ColumnBoundary[] cba = getSortedColumnBoundaryArray();
+ for (int i = 1; i < cba.length; i++)
+ {
+ final ColumnBoundary cb = cba[i];
+ float columnWidth = cb.getBoundary();
+ if (i > 1)
+ {
+ columnWidth -= cba[i - 1].getBoundary();
+ }
+ final OfficeStyle style = deriveStyle("table-column", ("co" + String.valueOf(i) + "_"));
+ final Section tableColumnProperties = new Section();
+ tableColumnProperties.setType("table-column-properties");
+ tableColumnProperties.setNamespace(style.getNamespace());
+ tableColumnProperties.setAttribute(style.getNamespace(), "column-width", String.valueOf(columnWidth)
+ + getUnitsOfMeasure(null));
+ style.addNode(tableColumnProperties);
+
+ final AttributeList myAttrList = new AttributeList();
+ myAttrList.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", style.getStyleName());
+ xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "table-column", myAttrList, XmlWriterSupport.CLOSE);
+ }
+ xmlWriter.writeCloseTag();
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+ protected void endOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException
+ {
+ if (isRepeatingSection() || isElementBoundaryCollectionPass())
+ {
+ return;
+ }
+
+ final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
+ if (isFilteredNamespace(namespace))
+ {
+ return;
+ }
+ final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
+ // if this is the report namespace, write out a table definition ..
+ if (OfficeNamespaces.TABLE_NS.equals(namespace)
+ && ("table".equals(elementType) || "covered-table-cell".equals(elementType)
+ || "table-column".equals(elementType) || "table-columns".equals(elementType)))
+ {
+ return;
+ }
+
+ try
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+ xmlWriter.writeCloseTag();
+ // table-cell elements may have a number-columns-spanned attribute which indicates how many
+ // 'covered-table-cell' elements we need to generate
+ generateCoveredTableCells(attrs);
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("Failed", e);
+ }
+ }
+
+ private void generateCoveredTableCells(final AttributeMap attrs) throws IOException
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs) == false)
+ {
+ return;
+ }
+
+ // do this after we close the tag
+ final XmlWriter xmlWriter = getXmlWriter();
+ final Object attribute = attrs.getAttribute(OfficeNamespaces.TABLE_NS, "number-columns-spanned");
+ final int span = TextUtilities.parseInt((String) attribute, 0);
+ for (int i = 1; i < span; i++)
+ {
+ xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "covered-table-cell", null, XmlWriter.CLOSE);
+ }
+ }
+
+ public String getExportDescriptor()
+ {
+ return "raw/" + PentahoReportEngineMetaData.OPENDOCUMENT_SPREADSHEET;
+ }
+
+ // /////////////////////////////////////////////////////////////////////////
+ public void processText(final String text) throws DataSourceException, ReportProcessingException
+ {
+ if (isRepeatingSection() || isElementBoundaryCollectionPass())
+ {
+ return;
+ }
+ super.processText(text);
+ }
+
+ public void processContent(final DataFlags value) throws DataSourceException, ReportProcessingException
+ {
+ if (isRepeatingSection() || isElementBoundaryCollectionPass())
+ {
+ return;
+ }
+ // System.out.println(value.getValue());
+ super.processContent(value);
+ }
+
+ protected void startContent(final AttributeMap attrs) throws IOException, DataSourceException,
+ ReportProcessingException
+ {
+ if (isElementBoundaryCollectionPass())
+ {
+ return;
+ }
+
+ final XmlWriter xmlWriter = getXmlWriter();
+ xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "spreadsheet", null, XmlWriterSupport.OPEN);
+
+ final AttributeMap tableAttributes = new AttributeMap();
+ tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TABLE_NS);
+ tableAttributes.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "table");
+ tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", generateInitialTableStyle());
+ tableAttributes.setAttribute(OfficeNamespaces.TABLE_NS, "name", "Report");
+
+ performStyleProcessing(tableAttributes);
+
+ xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, "table", buildAttributeList(tableAttributes), XmlWriterSupport.OPEN);
+ createTableColumns();
+ }
+
+ private String generateInitialTableStyle () throws ReportProcessingException
+ {
+ final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
+ final OfficeStyles commonStyles = predefStyles.getAutomaticStyles();
+ if (commonStyles.containsStyle("table", "Initial_Table") == false)
+ {
+ final String masterPageName = createMasterPage();
+
+ final OfficeStyle tableStyle = new OfficeStyle();
+ tableStyle.setStyleFamily("table");
+ tableStyle.setStyleName("Initial_Table");
+ tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
+ final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties");
+ tableProperties.setAttribute(OfficeNamespaces.FO_NS, "background-color", "transparent");
+ commonStyles.addStyle(tableStyle);
+ }
+ return "Initial_Table";
+ }
+
+ private String createMasterPage() throws ReportProcessingException
+ {
+ final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
+ final MasterPageFactory masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());
+ final OfficeMasterPage masterPage;
+ if (masterPageFactory.containsMasterPage("Standard", null, null) == false)
+ {
+ masterPage = masterPageFactory.createMasterPage("Standard", null, null);
+
+ final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0);
+ final String pageLayoutTemplate = masterPage.getPageLayout();
+ if (pageLayoutTemplate == null)
+ {
+ // there is no pagelayout. Create one ..
+ final String derivedLayout = masterPageFactory.createPageStyle
+ (getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
+ masterPage.setPageLayout(derivedLayout);
+ }
+ else
+ {
+ final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate,
+ getPredefinedStylesCollection().getAutomaticStyles(),
+ getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength);
+ masterPage.setPageLayout(derivedLayout);
+ }
+
+ final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
+ final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
+ officeMasterStyles.addMasterPage(masterPage);
+ }
+ else
+ {
+ masterPage = masterPageFactory.getMasterPage("Standard", null, null);
+ }
+ return masterPage.getStyleName();
+ }
+
+ protected void endContent(final AttributeMap attrs) throws IOException, DataSourceException,
+ ReportProcessingException
+ {
+ // todo
+ if (isElementBoundaryCollectionPass() == false)
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+ xmlWriter.writeCloseTag();
+ xmlWriter.writeCloseTag();
+ }
+ }
+
+ public void endReport(final ReportStructureRoot report) throws DataSourceException, ReportProcessingException
+ {
+ super.endReport(report);
+ setElementBoundaryCollectionPass(false);
+ resetTableCounter();
+ columnCounter = 0;
+ }
+
+ private boolean isElementBoundaryCollectionPass()
+ {
+ return elementBoundaryCollectionPass;
+ }
+
+ private void setElementBoundaryCollectionPass(final boolean elementBoundaryCollectionPass)
+ {
+ this.elementBoundaryCollectionPass = elementBoundaryCollectionPass;
+ }
+
+ private ColumnBoundary[] getSortedColumnBoundaryArray()
+ {
+ if (sortedBoundaryArray == null)
+ {
+ getColumnBoundaryList().add(new ColumnBoundary(0));
+ sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(EMPTY_COLBOUNDS);
+ Arrays.sort(sortedBoundaryArray);
+ }
+ return sortedBoundaryArray;
+ }
+
+ private List getColumnBoundaryList()
+ {
+ return columnBoundaryList;
+ }
+
+ private void addColumnWidthToRowBoundaryMarker(final float width)
+ {
+ currentRowBoundaryMarker += width;
+ }
+
+ private float getCurrentRowBoundaryMarker()
+ {
+ return currentRowBoundaryMarker;
+ }
+
+ private void resetTableCounter()
+ {
+ tableCounter = 0;
+ }
+
+ private void resetCurrentRowBoundaryMarker()
+ {
+ currentRowBoundaryMarker = 0;
+ }
+
+ private ColumnBoundary[] getBoundariesForTable(final int table)
+ {
+ if (boundariesForTableArray == null)
+ {
+ final List boundariesForTable = new ArrayList();
+ final List boundaryList = getColumnBoundaryList();
+ for (int i = 0; i < boundaryList.size(); i++)
+ {
+ final ColumnBoundary b = (ColumnBoundary) boundaryList.get(i);
+ if (b.isContainedByTable(table))
+ {
+ boundariesForTable.add(b);
+ }
+ }
+ boundariesForTableArray = (ColumnBoundary[]) boundariesForTable.toArray(EMPTY_COLBOUNDS);
+ Arrays.sort(boundariesForTableArray);
+ }
+ return boundariesForTableArray;
+ }
+
+ private int getColumnSpanForCell(final int table, final int col, final int initialColumnSpan)
+ {
+ final ColumnBoundary[] globalBoundaries = getSortedColumnBoundaryArray();
+ final ColumnBoundary[] tableBoundaries = getBoundariesForTable(table);
+ // how many column boundaries in the globalBoundaries list fall between the currentRowWidth and the next boundary
+ // for the current row
+
+ float cellBoundary = tableBoundaries[col - 1].getBoundary();
+ float cellWidth = tableBoundaries[col - 1].getBoundary();
+
+ if (col > 1)
+ {
+ cellWidth = cellWidth - tableBoundaries[col - 2].getBoundary();
+ }
+
+ if (initialColumnSpan > 1)
+ {
+ // ok we've got some additional spanning specified on the input
+ final int index = (col - 1) + (initialColumnSpan - 1);
+ cellWidth += tableBoundaries[index].getBoundary() - tableBoundaries[col - 1].getBoundary();
+ cellBoundary = tableBoundaries[index].getBoundary();
+ }
+
+ int beginBoundaryIndex = 0;
+ int endBoundaryIndex = globalBoundaries.length - 1;
+ for (int i = 0; i < globalBoundaries.length; i++)
+ {
+ // find beginning boundary
+ if (globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth)
+ {
+ beginBoundaryIndex = i;
+ }
+ if (globalBoundaries[i].getBoundary() <= cellBoundary)
+ {
+ endBoundaryIndex = i;
+ }
+ }
+ final int span = endBoundaryIndex - beginBoundaryIndex;
+ // span will be zero for the first column, so we adjust it to 1
+ if (span == 0)
+ {
+ return 1;
+ }
+ // System.out.println("table = " + table + " col = " + col + " rowBoundaries.length = " + tableBoundaries.length + "
+ // cellWidth = " + cellWidth + " span = " + span);
+ return span;
+ }
+
+ protected String getTargetMimeType()
+ {
+ return "application/vnd.oasis.opendocument.spreadsheet";
+ }
+
+ /**
+ * This class represents a column boundary, not in width, but it's actual boundary location. One of the motivations
+ * for creating this class was to be able to record the boundaries for each incoming table while consuming as few
+ * objects/memory as possible.
+ */
+ private static class ColumnBoundary implements Comparable
+ {
+ private HashSet tableIndices;
+
+ private float boundary;
+
+ private ColumnBoundary(final float boundary)
+ {
+ this.tableIndices = new HashSet();
+ this.boundary = boundary;
+ }
+
+ public void addTableIndex(final int table)
+ {
+ tableIndices.add(IntegerCache.getInteger(table));
+ }
+
+ public float getBoundary()
+ {
+ return boundary;
+ }
+
+ public boolean isContainedByTable(final int table)
+ {
+ final Integer index = IntegerCache.getInteger(table);
+ return tableIndices.contains(index);
+ }
+
+ public int compareTo(final Object arg0)
+ {
+ if (arg0.equals(this))
+ {
+ return 0;
+ }
+ if (arg0 instanceof ColumnBoundary)
+ {
+ if (boundary > ((ColumnBoundary) arg0).boundary)
+ {
+ return 1;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+ return 1;
+ }
+
+ public boolean equals(final Object obj)
+ {
+ if (obj instanceof ColumnBoundary)
+ {
+ return ((ColumnBoundary) obj).boundary == boundary;
+ }
+ return false;
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
new file mode 100644
index 000000000000..26d336df7cec
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java
@@ -0,0 +1,442 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: MasterPageFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output.text;
+
+import java.util.HashMap;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeMasterPage;
+import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.model.RawText;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.PageLayout;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Element;
+import org.jfree.report.util.AttributeNameGenerator;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.util.Log;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 14.03.2007
+ */
+public class MasterPageFactory
+{
+ private static class MasterPageFactoryKey
+ {
+ private String template;
+ private String pageHeader;
+ private String pageFooter;
+
+ public MasterPageFactoryKey(final String template,
+ final String pageHeader,
+ final String pageFooter)
+ {
+ this.template = template;
+ this.pageHeader = pageHeader;
+ this.pageFooter = pageFooter;
+ }
+
+
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final MasterPageFactoryKey that = (MasterPageFactoryKey) o;
+
+ if (pageFooter != null ? !pageFooter.equals(
+ that.pageFooter) : that.pageFooter != null)
+ {
+ return false;
+ }
+ if (pageHeader != null ? !pageHeader.equals(
+ that.pageHeader) : that.pageHeader != null)
+ {
+ return false;
+ }
+ if (template != null ? !template.equals(
+ that.template) : that.template != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result = (template != null ? template.hashCode() : 0);
+ result = 31 * result + (pageHeader != null ? pageHeader.hashCode() : 0);
+ result = 31 * result + (pageFooter != null ? pageFooter.hashCode() : 0);
+ return result;
+ }
+
+ public String getTemplate()
+ {
+ return template;
+ }
+
+ public String getPageHeader()
+ {
+ return pageHeader;
+ }
+
+ public String getPageFooter()
+ {
+ return pageFooter;
+ }
+ }
+
+ private static class PageLayoutKey
+ {
+ private String templateName;
+ private CSSNumericValue headerHeight;
+ private CSSNumericValue footerHeight;
+
+
+ public PageLayoutKey(final String templateName,
+ final CSSNumericValue headerHeight,
+ final CSSNumericValue footerHeight)
+ {
+ this.templateName = templateName;
+ this.headerHeight = headerHeight;
+ this.footerHeight = footerHeight;
+ }
+
+
+ public String getTemplateName()
+ {
+ return templateName;
+ }
+
+ public CSSNumericValue getHeaderHeight()
+ {
+ return headerHeight;
+ }
+
+ public CSSNumericValue getFooterHeight()
+ {
+ return footerHeight;
+ }
+
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final PageLayoutKey key = (PageLayoutKey) o;
+
+ if (footerHeight != null ? !footerHeight.equals(
+ key.footerHeight) : key.footerHeight != null)
+ {
+ return false;
+ }
+ if (headerHeight != null ? !headerHeight.equals(
+ key.headerHeight) : key.headerHeight != null)
+ {
+ return false;
+ }
+ if (templateName != null ? !templateName.equals(
+ key.templateName) : key.templateName != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (templateName != null ? templateName.hashCode() : 0);
+ result = 31 * result + (headerHeight != null ? headerHeight.hashCode() : 0);
+ result = 31 * result + (footerHeight != null ? footerHeight.hashCode() : 0);
+ return result;
+ }
+ }
+
+ // todo: Patch the page-layout ...
+ private static final String DEFAULT_PAGE_NAME = "Default";
+
+ private OfficeMasterStyles predefinedStyles;
+ private AttributeNameGenerator masterPageNameGenerator;
+ private HashMap masterPages;
+ private AttributeNameGenerator pageLayoutNameGenerator;
+ private HashMap pageLayouts;
+
+ public MasterPageFactory(final OfficeMasterStyles predefinedStyles)
+ {
+ this.predefinedStyles = predefinedStyles;
+ this.masterPages = new HashMap();
+ this.masterPageNameGenerator = new AttributeNameGenerator();
+ this.pageLayouts = new HashMap();
+ this.pageLayoutNameGenerator = new AttributeNameGenerator();
+ }
+
+ public OfficeMasterPage getMasterPage(final String template,
+ final String pageHeader,
+ final String pageFooter)
+ {
+ final MasterPageFactoryKey key =
+ new MasterPageFactoryKey(template, pageHeader, pageFooter);
+ return (OfficeMasterPage) masterPages.get(key);
+ }
+
+ public boolean containsMasterPage(final String template,
+ final String pageHeader,
+ final String pageFooter)
+ {
+ final MasterPageFactoryKey key =
+ new MasterPageFactoryKey(template, pageHeader, pageFooter);
+ return masterPages.containsKey(key);
+ }
+
+ public OfficeMasterPage createMasterPage(final String template,
+ final String pageHeader,
+ final String pageFooter)
+ {
+ final MasterPageFactoryKey key =
+ new MasterPageFactoryKey(template, pageHeader, pageFooter);
+ final OfficeMasterPage cached = (OfficeMasterPage) masterPages.get(key);
+ if (cached != null)
+ {
+ return cached;
+ }
+
+ final String targetName = (masterPages.isEmpty()) ? "Standard" : template;
+
+ OfficeMasterPage predef = predefinedStyles.getMasterPage(template);
+ if (predef == null)
+ {
+ // This is a 'magic' name ..
+ // todo: It could be that this should be called 'Standard' instead
+ predef = predefinedStyles.getMasterPage
+ (MasterPageFactory.DEFAULT_PAGE_NAME);
+ }
+
+ if (predef != null)
+ {
+ try
+ {
+ // derive
+ final OfficeMasterPage derived = (OfficeMasterPage) predef.clone();
+ return setupMasterPage(derived, targetName, pageHeader, pageFooter,
+ key);
+ }
+ catch (CloneNotSupportedException cne)
+ {
+ throw new IllegalStateException
+ ("Implementation error: Unable to derive page");
+ }
+ }
+
+ final OfficeMasterPage masterPage = new OfficeMasterPage();
+ masterPage.setNamespace(OfficeNamespaces.STYLE_NS);
+ masterPage.setType("master-page");
+ return setupMasterPage(masterPage, targetName, pageHeader, pageFooter, key);
+ }
+
+ private OfficeMasterPage setupMasterPage(final OfficeMasterPage derived,
+ final String targetName,
+ final String pageHeader,
+ final String pageFooter,
+ final MasterPageFactoryKey key)
+ {
+ derived.setStyleName(masterPageNameGenerator.generateName(targetName));
+ masterPages.put(key, derived);
+
+ if (pageHeader != null)
+ {
+ final Section header = new Section();
+ header.setNamespace(OfficeNamespaces.STYLE_NS);
+ header.setType("header");
+ header.addNode(new RawText(pageHeader));
+ derived.addNode(header);
+ }
+
+ if (pageFooter != null)
+ {
+ final Section footer = new Section();
+ footer.setNamespace(OfficeNamespaces.STYLE_NS);
+ footer.setType("footer");
+ footer.addNode(new RawText(pageFooter));
+ derived.addNode(footer);
+ }
+
+ return derived;
+ }
+
+ public String createPageStyle(final OfficeStyles commonStyles,
+ final CSSNumericValue headerHeight,
+ final CSSNumericValue footerHeight)
+ {
+ final PageLayoutKey key =
+ new PageLayoutKey(null, headerHeight, footerHeight);
+ final PageLayout derived = new PageLayout();
+ final String name = pageLayoutNameGenerator.generateName
+ ("autogenerated");
+ derived.setStyleName(name);
+ commonStyles.addPageStyle(derived);
+
+ if (headerHeight != null)
+ {
+ final Section headerStyle = new Section();
+ headerStyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ headerStyle.setType("header-style");
+ derived.addNode(headerStyle);
+ MasterPageFactory.applyHeaderFooterHeight(headerStyle, headerHeight);
+ }
+
+ if (footerHeight != null)
+ {
+ final Section footerStyle = new Section();
+ footerStyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ footerStyle.setType("footer-style");
+ derived.addNode(footerStyle);
+ MasterPageFactory.applyHeaderFooterHeight(footerStyle, footerHeight);
+ }
+ pageLayouts.put(key, name);
+ return name;
+ }
+
+ public String derivePageStyle(final String pageStyleTemplate,
+ final OfficeStyles predefined,
+ final OfficeStyles commonStyles,
+ final CSSNumericValue headerHeight,
+ final CSSNumericValue footerHeight)
+ throws ReportProcessingException
+ {
+ if (pageStyleTemplate == null)
+ {
+ throw new NullPointerException("A style-name must be given");
+ }
+
+ final PageLayoutKey key =
+ new PageLayoutKey(pageStyleTemplate, headerHeight, footerHeight);
+ final String pageLayoutName = (String) pageLayouts.get(key);
+ if (pageLayoutName != null)
+ {
+ // there's already a suitable version included.
+ return pageLayoutName;
+ }
+
+ final PageLayout original = predefined.getPageStyle(pageStyleTemplate);
+ if (original == null)
+ {
+ throw new ReportProcessingException
+ ("Invalid page-layout '" + pageStyleTemplate + "', will not continue.");
+ }
+
+ try
+ {
+ final PageLayout derived = (PageLayout) original.clone();
+ final String name = pageLayoutNameGenerator.generateName(
+ pageStyleTemplate);
+ derived.setStyleName(name);
+ commonStyles.addPageStyle(derived);
+
+ if (headerHeight != null)
+ {
+ Section headerStyle = derived.getHeaderStyle();
+ if (headerStyle == null)
+ {
+ headerStyle = new Section();
+ headerStyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ headerStyle.setType("header-style");
+ derived.addNode(headerStyle);
+ }
+ MasterPageFactory.applyHeaderFooterHeight(headerStyle, headerHeight);
+ }
+
+ if (footerHeight != null)
+ {
+ Section footerStyle = derived.getFooterStyle();
+ if (footerStyle == null)
+ {
+ footerStyle = new Section();
+ footerStyle.setNamespace(OfficeNamespaces.STYLE_NS);
+ footerStyle.setType("footer-style");
+ derived.addNode(footerStyle);
+ }
+
+ MasterPageFactory.applyHeaderFooterHeight(footerStyle, footerHeight);
+ }
+ pageLayouts.put(key, name);
+ return name;
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new IllegalStateException("Clone failed.");
+ }
+ }
+
+ private static void applyHeaderFooterHeight(final Section headerFooterStyle,
+ final CSSNumericValue style)
+ {
+ Element headerFooterProps = headerFooterStyle.findFirstChild
+ (OfficeNamespaces.STYLE_NS, "header-footer-properties");
+ if (headerFooterProps == null)
+ {
+ headerFooterProps = new Section();
+ headerFooterProps.setNamespace(OfficeNamespaces.STYLE_NS);
+ headerFooterProps.setType("header-footer-properties");
+ headerFooterStyle.addNode(headerFooterProps);
+ }
+ headerFooterProps.setAttribute
+ (OfficeNamespaces.SVG_NS, "height", String.valueOf(style.getValue()) +
+ style.getType().getType());
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java
new file mode 100644
index 000000000000..4898bf26d23b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageBreakDefinition.java
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageBreakDefinition.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output.text;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 24.03.2007
+ */
+public class PageBreakDefinition
+{
+ private boolean resetPageNumber;
+
+
+ public PageBreakDefinition(final boolean resetPageNumber)
+ {
+ this.resetPageNumber = resetPageNumber;
+ }
+
+ public boolean isResetPageNumber()
+ {
+ return resetPageNumber;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java
new file mode 100644
index 000000000000..ba7c1f9852c2
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/PageContext.java
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageContext.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output.text;
+
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import com.sun.star.report.pentaho.styles.LengthCalculator;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 24.03.2007
+ */
+public class PageContext
+{
+ public static final int KEEP_TOGETHER_OFF = 0;
+ public static final int KEEP_TOGETHER_GROUP = 1;
+ public static final int KEEP_TOGETHER_FIRST_DETAIL = 2;
+
+ private PageContext parent;
+
+ private String header;
+ private CSSNumericValue headerHeight;
+ private String footer;
+ private CSSNumericValue footerHeight;
+ private int keepTogether;
+ private Integer columnCount;
+ private boolean sectionOpen;
+
+ public PageContext()
+ {
+ this(null);
+ }
+
+ public PageContext(final PageContext parent)
+ {
+ this.parent = parent;
+ this.columnCount = null;
+ if (parent != null)
+ {
+ this.keepTogether = parent.getKeepTogether();
+ }
+ }
+
+ public int getActiveColumns()
+ {
+ PageContext pc = this;
+ while (pc != null)
+ {
+ if (columnCount != null)
+ {
+ return columnCount.intValue();
+ }
+ pc = pc.getParent();
+ }
+ return 1;
+ }
+
+ public void setColumnCount(final Integer columnCount)
+ {
+ this.columnCount = columnCount;
+ }
+
+ public Integer getColumnCount()
+ {
+ return columnCount;
+ }
+
+ public String getHeader()
+ {
+ return header;
+ }
+
+ public void setHeader(final String header, final CSSNumericValue height)
+ {
+ this.header = header;
+ this.headerHeight = height;
+ }
+
+ public String getFooter()
+ {
+ return footer;
+ }
+
+
+ public CSSNumericValue getHeaderHeight()
+ {
+ return headerHeight;
+ }
+
+ public CSSNumericValue getFooterHeight()
+ {
+ return footerHeight;
+ }
+
+ public void setFooter(final String footer, final CSSNumericValue height)
+ {
+ this.footer = footer;
+ this.footerHeight = height;
+ }
+
+ public int getKeepTogether()
+ {
+ return keepTogether;
+ }
+
+ public void setKeepTogether(final int keepTogether)
+ {
+ this.keepTogether = keepTogether;
+ }
+
+ public PageContext getParent()
+ {
+ return parent;
+ }
+
+ public CSSNumericValue getAllFooterSize()
+ {
+ if (parent == null)
+ {
+ return footerHeight;
+ }
+
+ final LengthCalculator lnc = new LengthCalculator();
+ PageContext pc = this;
+ while (pc != null)
+ {
+ lnc.add(pc.getFooterHeight());
+ pc = pc.getParent();
+ }
+ return lnc.getResult();
+ }
+
+ public CSSNumericValue getAllHeaderSize()
+ {
+ if (parent == null)
+ {
+ return headerHeight;
+ }
+
+ final LengthCalculator lnc = new LengthCalculator();
+ PageContext pc = this;
+ while (pc != null)
+ {
+ lnc.add(pc.getHeaderHeight());
+ pc = pc.getParent();
+ }
+ return lnc.getResult();
+ }
+
+
+ public String getPageFooterContent()
+ {
+ if (parent == null)
+ {
+ return getFooter();
+ }
+
+ final StringBuffer b = new StringBuffer();
+
+ PageContext pc = this;
+ while (pc != null)
+ {
+ final String footer = pc.getFooter();
+ if (footer != null)
+ {
+ b.append(footer);
+ }
+ pc = pc.getParent();
+ }
+
+ if (b.length() != 0)
+ {
+ return b.toString();
+ }
+ return null;
+ }
+
+ public String getPageHeaderContent()
+ {
+ if (parent == null)
+ {
+ return getHeader();
+ }
+
+ final StringBuffer b = new StringBuffer();
+
+ PageContext pc = this;
+ while (pc != null)
+ {
+ final String header = pc.getHeader();
+ if (header != null)
+ {
+ b.append(header);
+ }
+ pc = pc.getParent();
+ }
+
+ if (b.length() != 0)
+ {
+ return b.toString();
+ }
+ return null;
+ }
+
+
+ public boolean isSectionOpen()
+ {
+ return sectionOpen;
+ }
+
+ public void setSectionOpen(final boolean sectionOpen)
+ {
+ this.sectionOpen = sectionOpen;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java
new file mode 100644
index 000000000000..9da55ff6f8a7
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextRawReportProcessor.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.output.text;
+
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.ImageService;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
+import org.jfree.report.flow.ReportTarget;
+import org.jfree.report.flow.SinglePassReportProcessor;
+import org.jfree.resourceloader.ResourceManager;
+
+/**
+ * Creation-Date: 03.07.2006, 17:08:25
+ *
+ * @author Thomas Morgner
+ */
+public class TextRawReportProcessor extends SinglePassReportProcessor
+{
+ private OutputRepository outputRepository;
+ private String targetName;
+ private InputRepository inputRepository;
+ private ImageService imageService;
+
+ public TextRawReportProcessor(final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final String targetName,
+ final ImageService imageService)
+ {
+ if (inputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ if (outputRepository == null)
+ {
+ throw new NullPointerException();
+ }
+ if (targetName == null)
+ {
+ throw new NullPointerException();
+ }
+ if (imageService == null)
+ {
+ throw new NullPointerException();
+ }
+ this.targetName = targetName;
+ this.inputRepository = inputRepository;
+ this.outputRepository = outputRepository;
+ this.imageService = imageService;
+ }
+
+ protected ReportTarget createReportTarget(final ReportJob job)
+ throws ReportProcessingException
+ {
+ final ReportStructureRoot report = job.getReportStructureRoot();
+ final ResourceManager resourceManager = report.getResourceManager();
+
+ return new TextRawReportTarget (job, resourceManager, report.getBaseResource(),
+ inputRepository, outputRepository, targetName, imageService);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
new file mode 100644
index 000000000000..7d3e39a2cd14
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java
@@ -0,0 +1,1380 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextRawReportTarget.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.output.text;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.util.Iterator;
+import java.util.Map;
+
+import com.sun.star.report.ImageService;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.PentahoReportEngineMetaData;
+import com.sun.star.report.pentaho.model.OfficeMasterPage;
+import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.model.PageSection;
+import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
+import com.sun.star.report.pentaho.output.StyleUtilities;
+import com.sun.star.report.pentaho.styles.LengthCalculator;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.layouting.util.AttributeMap;
+import org.jfree.report.DataSourceException;
+import org.jfree.report.ReportProcessingException;
+import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
+import org.jfree.report.flow.ReportTargetUtil;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.util.AttributeNameGenerator;
+import org.jfree.report.util.IntegerCache;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.util.FastStack;
+import org.jfree.util.ObjectUtilities;
+import org.jfree.xmlns.common.AttributeList;
+import org.jfree.xmlns.writer.XmlWriter;
+import org.jfree.xmlns.writer.XmlWriterSupport;
+
+/**
+ * Creation-Date: 03.07.2006, 16:28:00
+ *
+ * @author Thomas Morgner
+ */
+public class TextRawReportTarget extends OfficeDocumentReportTarget
+{
+ private static final String VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT = "variables_paragraph_with_next";
+ private static final String VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT = "variables_paragraph_without_next";
+
+ private static final int TABLE_LAYOUT_VARIABLES_PARAGRAPH = 0;
+ private static final int TABLE_LAYOUT_VARIABLES_IN_FIRST_CELL = 1;
+ private static final int TABLE_LAYOUT_SINGLE_DETAIL_TABLE = 2;
+
+ private static final int CP_SETUP = 0;
+ private static final int CP_FIRST_TABLE = 1;
+ private static final int CP_NEXT_TABLE = 2;
+
+ // This is the initial state of the detail-band processing. It states, that we are now waiting for a
+ // detail-band to be printed.
+ private static final int DETAIL_SECTION_WAIT = 0;
+ // The first detail section has started.
+ private static final int DETAIL_SECTION_FIRST_STARTED = 1;
+ // The first detail section has been printed.
+ private static final int DETAIL_SECTION_FIRST_PRINTED = 2;
+ // An other detail section has started
+ private static final int DETAIL_SECTION_OTHER_STARTED = 3;
+ // The other detail section has been printed.
+ private static final int DETAIL_SECTION_OTHER_PRINTED = 4;
+
+
+ private boolean pageFooterOnReportFooter;
+ private boolean pageFooterOnReportHeader;
+ private boolean pageHeaderOnReportFooter;
+ private boolean pageHeaderOnReportHeader;
+ private int contentProcessingState;
+ private OfficeMasterPage currentMasterPage;
+
+ private FastStack activePageContext;
+ private MasterPageFactory masterPageFactory;
+ private LengthCalculator sectionHeight;
+ private String variables;
+ private PageBreakDefinition pageBreakDefinition;
+ private VariablesDeclarations variablesDeclarations;
+ private boolean columnBreakPending;
+ private boolean sectionKeepTogether;
+ private AttributeNameGenerator sectionNames;
+
+ private int detailBandProcessingState;
+
+ private int tableLayoutConfig;
+ private int expectedTableRowCount;
+ private boolean firstCellSeen;
+
+ public TextRawReportTarget(final ReportJob reportJob,
+ final ResourceManager resourceManager,
+ final ResourceKey baseResource,
+ final InputRepository inputRepository,
+ final OutputRepository outputRepository,
+ final String target,
+ final ImageService imageService)
+ throws ReportProcessingException
+ {
+ super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService);
+ activePageContext = new FastStack();
+ this.sectionNames = new AttributeNameGenerator();
+
+ this.tableLayoutConfig = TABLE_LAYOUT_SINGLE_DETAIL_TABLE;
+ }
+
+ protected String getTargetMimeType()
+ {
+ return "application/vnd.oasis.opendocument.text";
+ }
+
+ /**
+ * Checks, whether a manual page break should be inserted at the next possible location.
+ *
+ * @return true, if a pagebreak is pending, false otherwise.
+ */
+ private boolean isPagebreakPending()
+ {
+ return pageBreakDefinition != null;
+ }
+
+ private boolean isResetPageNumber()
+ {
+ if (pageBreakDefinition == null)
+ {
+ return false;
+ }
+ return pageBreakDefinition.isResetPageNumber();
+ }
+
+ /**
+ * Defines, whether a manual pagebreak should be inserted at the next possible location.
+ *
+ * @param pageBreakDefinition the new flag value.
+ */
+ private void setPagebreakDefinition(final PageBreakDefinition pageBreakDefinition)
+ {
+ this.pageBreakDefinition = pageBreakDefinition;
+ }
+
+
+ private PageBreakDefinition getPagebreakDefinition()
+ {
+ return pageBreakDefinition;
+ }
+
+ // todo
+ private boolean isKeepTableWithNext()
+ {
+ final int keepTogetherState = getCurrentContext().getKeepTogether();
+ if (keepTogetherState == PageContext.KEEP_TOGETHER_GROUP)
+ {
+ return true;
+ }
+
+ final boolean keepWithNext;
+ if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL)
+ {
+ keepWithNext = (detailBandProcessingState == DETAIL_SECTION_WAIT);
+ }
+ else
+ {
+ keepWithNext = false;
+ }
+ return keepWithNext;
+ }
+
+ private boolean isSectionPagebreakAfter(final AttributeMap attrs)
+ {
+ final Object forceNewPage =
+ attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "force-new-page");
+ if ("after-section".equals(forceNewPage))
+ {
+ return true;
+ }
+ if ("before-after-section".equals(forceNewPage))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isSectionPagebreakBefore(final AttributeMap attrs)
+ {
+ final Object forceNewPage =
+ attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "force-new-page");
+ if ("before-section".equals(forceNewPage))
+ {
+ return true;
+ }
+ if ("before-after-section".equals(forceNewPage))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private PageContext getCurrentContext()
+ {
+ return (PageContext) activePageContext.peek();
+ }
+
+ private String createMasterPage(final boolean printHeader,
+ final boolean printFooter)
+ throws ReportProcessingException
+ {
+ // create the master page for the report-header.
+ // If there is a page-header or footer in the report that gets
+ // surpressed on the report-header, we have to insert a pagebreak
+ // afterwards.
+
+ String activePageFooter = null;
+ // Check, whether the report header can have a page-header
+ final PageContext context = getCurrentContext();
+ if (printFooter)
+ {
+ activePageFooter = context.getPageFooterContent();
+ }
+ String activePageHeader = null;
+ if (printHeader)
+ {
+ // we have to insert a manual pagebreak after the report header.
+ activePageHeader = context.getPageHeaderContent();
+ }
+
+ final String masterPageName;
+ if (currentMasterPage == null ||
+ masterPageFactory.containsMasterPage("Standard", activePageHeader, activePageFooter) == false)
+ {
+
+ final CSSNumericValue headerSize = context.getAllHeaderSize();
+ final CSSNumericValue footerSize = context.getAllFooterSize();
+
+
+ currentMasterPage = masterPageFactory.createMasterPage("Standard", activePageHeader, activePageFooter);
+
+// Log.debug("Created a new master-page: " + currentMasterPage.getStyleName());
+
+ // todo: Store the page-layouts as well.
+ // The page layouts are derived from a common template, but as the
+ // header-heights differ, we have to derive these beasts instead
+ // of copying them
+
+ final OfficeStylesCollection officeStylesCollection = getGlobalStylesCollection();
+ final OfficeMasterStyles officeMasterStyles = officeStylesCollection.getMasterStyles();
+ final String pageLayoutTemplate = currentMasterPage.getPageLayout();
+ if (pageLayoutTemplate == null)
+ {
+ // there is no pagelayout. Create one ..
+ final String derivedLayout = masterPageFactory.createPageStyle
+ (getGlobalStylesCollection().getAutomaticStyles(), headerSize, footerSize);
+ currentMasterPage.setPageLayout(derivedLayout);
+ }
+ else
+ {
+ final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate,
+ getPredefinedStylesCollection().getAutomaticStyles(),
+ getGlobalStylesCollection().getAutomaticStyles(), headerSize, footerSize);
+ currentMasterPage.setPageLayout(derivedLayout);
+ }
+ officeMasterStyles.addMasterPage(currentMasterPage);
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ else
+ {
+ // retrieve the master-page.
+ final OfficeMasterPage masterPage = masterPageFactory.getMasterPage("Standard", activePageHeader, activePageFooter);
+ if (ObjectUtilities.equal(masterPage.getStyleName(), currentMasterPage.getStyleName()))
+ {
+ // They are the same,
+ masterPageName = null;
+ }
+ else
+ {
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ }
+
+ // if either the pageheader or footer are *not* printed with the
+ // report header, then this implies that we have to insert a manual
+ // pagebreak at the end of the section.
+
+ if ((printHeader == false && context.getHeader() != null) ||
+ (printFooter == false && context.getFooter() != null))
+ {
+ setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
+ }
+
+ return masterPageName;
+ }
+
+ private boolean isColumnBreakPending()
+ {
+ return columnBreakPending;
+ }
+
+ private void setColumnBreakPending(final boolean columnBreakPending)
+ {
+ this.columnBreakPending = columnBreakPending;
+ }
+
+ private Integer parseInt(final Object value)
+ {
+ if (value instanceof Number)
+ {
+ final Number n = (Number) value;
+ return IntegerCache.getInteger(n.intValue());
+ }
+ if (value instanceof String)
+ {
+ try
+ {
+ return IntegerCache.getInteger(Integer.parseInt((String) value));
+ }
+ catch (NumberFormatException nfe)
+ {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ private BufferState applyColumnsToPageBand(final BufferState contents,
+ final int numberOfColumns)
+ throws IOException, ReportProcessingException
+ {
+ if (numberOfColumns <= 1)
+ {
+ return contents;
+ }
+ startBuffering(getGlobalStylesCollection(), true);
+ // derive section style ..
+
+ // This is a rather cheap solution to the problem. In a sane world, we would have to feed the
+ // footer multiple times. Right now, we simply rely on the balacing, which should make sure that
+ // the column's content are evenly distributed.
+ final XmlWriter writer = getXmlWriter();
+ final AttributeList attrs = new AttributeList();
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "style-name", generateSectionStyle(numberOfColumns));
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "name", sectionNames.generateName("Section"));
+ writer.writeTag(OfficeNamespaces.TEXT_NS, "section", attrs, XmlWriterSupport.OPEN);
+ for (int i = 0; i < numberOfColumns; i++)
+ {
+ writer.writeStream(contents.getXmlAsReader());
+ }
+
+ writer.writeCloseTag();
+ return finishBuffering();
+ }
+
+ private String generateSectionStyle(final int columnCount)
+ {
+ final OfficeStyles automaticStyles = getStylesCollection().getAutomaticStyles();
+ final String styleName = getAutoStyleNameGenerator().generateName("auto_section_style");
+
+ final Section sectionProperties = new Section();
+ sectionProperties.setNamespace(OfficeNamespaces.STYLE_NS);
+ sectionProperties.setType("section-properties");
+ sectionProperties.setAttribute(OfficeNamespaces.FO_NS, "background-color", "transparent");
+ sectionProperties.setAttribute(OfficeNamespaces.TEXT_NS, "dont-balance-text-columns", "false");
+ sectionProperties.setAttribute(OfficeNamespaces.STYLE_NS, "editable", "false");
+
+ if (columnCount > 1)
+ {
+ final Section columns = new Section();
+ columns.setNamespace(OfficeNamespaces.STYLE_NS);
+ columns.setType("columns");
+ columns.setAttribute(OfficeNamespaces.FO_NS, "column-count", String.valueOf(columnCount));
+ columns.setAttribute(OfficeNamespaces.STYLE_NS, "column-gap", "0cm");
+ sectionProperties.addNode(columns);
+
+// final Section columnSep = new Section();
+// columnSep.setNamespace(OfficeNamespaces.STYLE_NS);
+// columnSep.setType("column-sep");
+// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "width", "0.035cm");
+// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "color", "#000000");
+// columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "height", "100%");
+// columns.addNode(columnSep);
+
+ for (int i = 0; i < columnCount; i++)
+ {
+ final Section column = new Section();
+ column.setNamespace(OfficeNamespaces.STYLE_NS);
+ column.setType("column");
+ column.setAttribute(OfficeNamespaces.STYLE_NS, "rel-width", "1*");
+ column.setAttribute(OfficeNamespaces.FO_NS, "start-indent", "0cm");
+ column.setAttribute(OfficeNamespaces.FO_NS, "end-indent", "0cm");
+ columns.addNode(column);
+ }
+ }
+
+ final OfficeStyle style = new OfficeStyle();
+ style.setNamespace(OfficeNamespaces.STYLE_NS);
+ style.setType("style");
+ style.setAttribute(OfficeNamespaces.STYLE_NS, "name", styleName);
+ style.setAttribute(OfficeNamespaces.STYLE_NS, "family", "section");
+ style.addNode(sectionProperties);
+
+ automaticStyles.addStyle(style);
+ return styleName;
+ }
+
+
+ /**
+ * Starts the output of a new office document. This method writes the generic 'office:document-content' tag along with
+ * all known namespace declarations.
+ *
+ * @param report the report object.
+ * @throws org.jfree.report.DataSourceException
+ * if there was an error accessing the datasource
+ * @throws org.jfree.report.ReportProcessingException
+ * if some other error occured.
+ */
+ public void startReport(final ReportStructureRoot report)
+ throws DataSourceException, ReportProcessingException
+ {
+ super.startReport(report);
+ variablesDeclarations = new VariablesDeclarations();
+ detailBandProcessingState = DETAIL_SECTION_WAIT;
+ sectionNames.reset();
+
+ pageFooterOnReportFooter = false;
+ pageFooterOnReportHeader = false;
+ pageHeaderOnReportFooter = false;
+ pageHeaderOnReportHeader = false;
+ contentProcessingState = TextRawReportTarget.CP_SETUP;
+
+ activePageContext.clear();
+ activePageContext.push(new PageContext());
+
+ final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
+ masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles());
+
+ predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(true));
+ predefStyles.getAutomaticStyles().addStyle(createVariablesStyle(false));
+ }
+
+ private OfficeStyle createVariablesStyle(final boolean keepWithNext)
+ {
+ final OfficeStyle variablesSectionStyle = new OfficeStyle();
+ variablesSectionStyle.setStyleFamily("paragraph");
+ if (keepWithNext)
+ {
+ variablesSectionStyle.setStyleName(TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
+ }
+ else
+ {
+ variablesSectionStyle.setStyleName(TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT);
+ }
+
+ final Section paragraphProps = new Section();
+ paragraphProps.setNamespace(OfficeNamespaces.STYLE_NS);
+ paragraphProps.setType("paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "background-color", "transparent");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "text-align", "start");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "keep-with-next", "always");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "keep-together", "always");
+ paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-align", "top");
+ variablesSectionStyle.addNode(paragraphProps);
+
+ final Section textProps = new Section();
+ textProps.setNamespace(OfficeNamespaces.STYLE_NS);
+ textProps.setType("text-properties");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "font-variant", "normal");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "text-transform", "none");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "color", "#ffffff");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-outline", "false");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", "false");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-style", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-mode", "continuous");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-position", "0% 100%");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-name", "Tahoma");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "font-size", "1pt");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "letter-spacing", "normal");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "letter-kerning", "false");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "font-style", "normal");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "text-shadow", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-style", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-mode", "continuous");
+ textProps.setAttribute(OfficeNamespaces.FO_NS, "font-weight", "normal");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-rotation-angle", "0");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-emphasize", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-start-char", "");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-end-char", "");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", "false");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-scale", "100%");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-relief", "none");
+ textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-display", "none");
+ variablesSectionStyle.addNode(textProps);
+ return variablesSectionStyle;
+ }
+
+ protected void startContent(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ final XmlWriter xmlWriter = getXmlWriter();
+ xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "text", null, XmlWriterSupport.OPEN);
+
+ // now start the buffering. We have to insert the variables declaration
+ // later ..
+ startBuffering(getStylesCollection(), true);
+
+ final PageContext pageContext = getCurrentContext();
+ final Object columnCountRaw = attrs.getAttribute(OfficeNamespaces.FO_NS, "column-count");
+ final Integer colCount = parseInt(columnCountRaw);
+ if (colCount != null)
+ {
+ pageContext.setColumnCount(colCount);
+ }
+
+ }
+
+ protected void startOther(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
+ final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "image", attrs))
+ {
+ startImageProcessing(attrs);
+ return;
+ }
+
+ if (isFilteredNamespace(namespace))
+ {
+ throw new IllegalStateException("This element should be hidden: " +
+ namespace + ", " + elementType);
+ }
+
+ if (isTableMergeActive() && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
+ {
+ // Skip the columns section if the tables get merged..
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-columns", attrs))
+ {
+ startBuffering(getStylesCollection(), true);
+ return;
+ }
+ }
+
+ openSection();
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table", attrs))
+ {
+ startTable(attrs);
+ return;
+ }
+
+ final XmlWriter xmlWriter = getXmlWriter();
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-row", attrs))
+ {
+ startRow(attrs);
+ return;
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "variable-set", attrs))
+ {
+ // update the variables-declaration thingie ..
+ final String varName = (String) attrs.getAttribute(OfficeNamespaces.TEXT_NS, "name");
+ final String varType = (String) attrs.getAttribute(OfficeNamespaces.OFFICE_NS, "value-type");
+ final String newVarName = variablesDeclarations.produceVariable(varName, varType);
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "name", newVarName);
+ }
+ else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "variable-get", attrs))
+ {
+ final String varName = (String) attrs.getAttribute(OfficeNamespaces.TEXT_NS, "name");
+ final String varType = (String) attrs.getAttribute(OfficeNamespaces.OFFICE_NS, "value-type");
+ final String newVarName = variablesDeclarations.produceVariable(varName, varType);
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "name", newVarName);
+ // this one must not be written, as the DTD does not declare it.
+ // attrs.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", null);
+ }
+
+ if (tableLayoutConfig == TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
+ {
+ // This cannot happen as long as the report sections only contain tables. But at some point in the
+ // future they will be made of paragraphs, and then we are prepared ..
+// Log.debug("Variables-Section in own paragraph " + variables);
+
+ StyleUtilities.copyStyle("paragraph",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
+ getGlobalStylesCollection(), getPredefinedStylesCollection());
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ }
+
+ // todo: If keep-together is active and the modify the paragraph's style ..
+
+ // process the styles as usual
+ performStyleProcessing(attrs);
+
+ final AttributeList attrList = buildAttributeList(attrs);
+ xmlWriter.writeTag(namespace, elementType, attrList,
+ XmlWriterSupport.OPEN);
+
+ if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
+ ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, "p", attrs))
+ {
+ if (variables != null)
+ {
+// Log.debug("Variables-Section in existing cell " + variables);
+ xmlWriter.writeText(variables);
+ variables = null;
+ }
+ }
+
+ }
+
+ private void startRow(final AttributeMap attrs)
+ throws IOException, ReportProcessingException
+ {
+ firstCellSeen = false;
+ expectedTableRowCount -= 1;
+ final String rowStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ final CSSNumericValue rowHeight = computeRowHeight(rowStyle);
+ // Log.debug("Adding row-Style: " + rowStyle + " " + rowHeight);
+ sectionHeight.add(rowHeight);
+
+ if (expectedTableRowCount > 0)
+ {
+ // Some other row. Create a keep-together
+
+ }
+ else
+ {
+ // This is the last row before the section will end.
+ // or (in some weird cases) There is no information when the row will end.
+ // Anyway, if we are here, we do not create a keep-together style on the table-row ..
+ }
+ // process the styles as usual
+ performStyleProcessing(attrs);
+
+ final AttributeList attrList = buildAttributeList(attrs);
+ getXmlWriter().writeTag(OfficeNamespaces.TABLE_NS, "table-row", attrList, XmlWriterSupport.OPEN);
+ }
+
+ private void startTable(final AttributeMap attrs)
+ throws ReportProcessingException, IOException
+ {
+ final Integer trc = (Integer) attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "table-row-count");
+ if (trc == null)
+ {
+ expectedTableRowCount = -1;
+ }
+ else
+ {
+ expectedTableRowCount = trc.intValue();
+ }
+
+ if (isSectionPagebreakBefore(attrs))
+ {
+ // force a pagebreak ..
+ setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber()));
+ }
+
+ // its a table. This means, it is a root-level element
+ PageBreakDefinition breakDefinition = null;
+ String masterPageName = null;
+ final int currentRole = getCurrentRole();
+ if (contentProcessingState == TextRawReportTarget.CP_FIRST_TABLE)
+ {
+ contentProcessingState = TextRawReportTarget.CP_NEXT_TABLE;
+
+ // Processing the report header now.
+ if (currentRole == OfficeDocumentReportTarget.ROLE_REPORT_HEADER)
+ {
+ breakDefinition = new PageBreakDefinition(isResetPageNumber());
+ masterPageName = createMasterPage(pageHeaderOnReportHeader, pageFooterOnReportHeader);
+ if (masterPageName == null)
+ {
+ // we should always have a master-page ...
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ }
+ else if (currentRole == OfficeDocumentReportTarget.ROLE_REPORT_FOOTER)
+ {
+ breakDefinition = new PageBreakDefinition(isResetPageNumber());
+ masterPageName = createMasterPage (pageHeaderOnReportFooter, pageFooterOnReportFooter);
+ if (masterPageName == null && isSectionPagebreakBefore(attrs))
+ {
+ // If we have a manual pagebreak, then activate the current master-page again.
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ // But we skip this (and therefore the resulting pagebreak) if there is no manual break
+ // and no other condition that would force an break.
+ }
+ else if (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER)
+ {
+ // no pagebreaks ..
+ }
+ else if (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
+ {
+ // no pagebreaks ..
+ }
+ else if (currentMasterPage == null)
+ {
+ // Must be the first table, as we have no master-page yet.
+ masterPageName = createMasterPage(true, true);
+ if (masterPageName == null)
+ {
+ // we should always have a master-page ...
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ breakDefinition = new PageBreakDefinition(isResetPageNumber());
+ }
+ else if (isPagebreakPending())
+ {
+ // Derive an automatic style for the pagebreak.
+// Log.debug("Manual pagebreak at begin of section: " + getCurrentRole());
+ breakDefinition = getPagebreakDefinition();
+ setPagebreakDefinition(null);
+ masterPageName = createMasterPage(true, true);
+ if (masterPageName == null)
+ {
+ // we should always have a master-page ...
+ masterPageName = currentMasterPage.getStyleName();
+ }
+
+ }
+ }
+ else if (isPagebreakPending() &&
+ currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER &&
+ currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
+ {
+ // Derive an automatic style for the pagebreak.
+// Log.debug("Manual pagebreak (within the section): " + getCurrentRole());
+ breakDefinition = getPagebreakDefinition();
+ setPagebreakDefinition(null);
+ masterPageName = createMasterPage(true, true);
+ if (masterPageName == null || isSectionPagebreakBefore(attrs))
+ {
+ // If we have a manual pagebreak, then activate the current master-page again.
+ masterPageName = currentMasterPage.getStyleName();
+ }
+ }
+
+ final XmlWriter xmlWriter = getXmlWriter();
+ if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED &&
+ masterPageName != null)
+ {
+ // close the last table-tag, we will open a new one
+ xmlWriter.writeCloseTag();
+ // Reset the detail-state to 'started' so that the table's columns get printed now.
+ detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
+ }
+
+ if (tableLayoutConfig == TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null)
+ {
+ if (masterPageName != null)
+ {
+ // write a paragraph that uses the VARIABLES_HIDDEN_STYLE as
+ // primary style. Derive that one and add the manual pagebreak.
+ // The predefined style already has the 'keep-together' flags set.
+// Log.debug("Variables-Section with new Master-Page " + variables + " " + masterPageName);
+
+ final OfficeStyle style = deriveStyle("paragraph", TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
+ style.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
+ if (breakDefinition.isResetPageNumber())
+ {
+ final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
+ }
+ if (isColumnBreakPending())
+ {
+ final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "break-before", "column");
+ setColumnBreakPending(false);
+ }
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name", style.getStyleName(), XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ masterPageName = null;
+ breakDefinition = null;
+ }
+ else if (isColumnBreakPending())
+ {
+ setColumnBreakPending(false);
+
+ final OfficeStyle style = deriveStyle("paragraph", TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT);
+ final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
+
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name", style.getStyleName(), XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ }
+ else
+ {
+ // Write a paragraph without adding the pagebreak. We can reuse the global style, but we have to make
+ // sure that the style is part of the current 'auto-style' collection.
+// Log.debug("Variables-Section " + variables);
+
+ StyleUtilities.copyStyle("paragraph",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
+ getGlobalStylesCollection(), getPredefinedStylesCollection());
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ }
+ }
+
+ final boolean keepWithNext = isKeepTableWithNext();
+ final boolean localKeepTogether = "true".equals
+ (attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "keep-together"));
+ final boolean tableMergeActive = isTableMergeActive();
+ if (tableMergeActive == false)
+ {
+ this.sectionKeepTogether = false;
+ }
+ else
+ {
+ this.sectionKeepTogether = localKeepTogether;
+ }
+
+ // Check, whether we have a reason to derive a style...
+ if (masterPageName != null ||
+ (tableMergeActive == false && (localKeepTogether || keepWithNext)) || isColumnBreakPending())
+ {
+ final String styleName = (String)
+ attrs.getAttribute(OfficeNamespaces.TABLE_NS, "style-name");
+ final OfficeStyle style = deriveStyle("table", styleName);
+
+ if (masterPageName != null)
+ {
+// Log.debug("Starting a new MasterPage: " + masterPageName);
+ // Patch the current styles.
+ // This usually only happens on Table-Styles or Paragraph-Styles
+ style.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName);
+ if (breakDefinition.isResetPageNumber())
+ {
+ final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "page-number", "1");
+ }
+ }
+ if (isColumnBreakPending())
+ {
+ final Element paragraphProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "paragraph-properties");
+ paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "break-before", "column");
+ setColumnBreakPending(false);
+ }
+
+ // Inhibit breaks inside the table only if it has been defined and if we do not create one single
+ // big detail section. In that case, this flag would be invalid and would cause layout-errors.
+ if (tableMergeActive == false)
+ {
+ if (localKeepTogether)
+ {
+ final Element tableProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "table-properties");
+ tableProps.setAttribute(OfficeNamespaces.STYLE_NS, "may-break-between-rows", "false");
+ }
+ }
+ else
+ {
+ if (detailBandProcessingState == DETAIL_SECTION_WAIT)
+ {
+ detailBandProcessingState = DETAIL_SECTION_FIRST_STARTED;
+ }
+ else if (detailBandProcessingState == DETAIL_SECTION_FIRST_PRINTED)
+ {
+ detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
+ }
+ }
+ if (keepWithNext)
+ {
+ final Element tableProps = produceFirstChild(style, OfficeNamespaces.STYLE_NS, "table-properties");
+ tableProps.setAttribute(OfficeNamespaces.FO_NS, "keep-with-next", "always");
+ // A keep-with-next does not work, if the may-break-betweek rows is not set to false ..
+ tableProps.setAttribute(OfficeNamespaces.STYLE_NS, "may-break-between-rows", "false");
+ }
+ attrs.setAttribute(OfficeNamespaces.TABLE_NS, "style-name", style.getStyleName());
+ // no need to copy the styles, this was done while deriving the
+ // style ..
+ }
+ else
+ {
+ // Check, whether we may be able to skip the table.
+ if (tableMergeActive)
+ {
+ if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
+ {
+ // Skip the whole thing ..
+ return;
+ }
+ else if (detailBandProcessingState == DETAIL_SECTION_WAIT)
+ {
+ detailBandProcessingState = DETAIL_SECTION_FIRST_STARTED;
+ }
+ else if (detailBandProcessingState == DETAIL_SECTION_FIRST_PRINTED)
+ {
+ detailBandProcessingState = DETAIL_SECTION_OTHER_STARTED;
+ }
+ }
+
+ // process the styles as usual
+ performStyleProcessing(attrs);
+ }
+
+ final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs);
+ final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs);
+ final AttributeList attrList = buildAttributeList(attrs);
+ xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN);
+
+ }
+
+ private boolean isTableMergeActive()
+ {
+ return getCurrentRole() == ROLE_DETAIL &&
+ tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE;
+ }
+
+
+ private void openSection()
+ throws IOException
+ {
+ if (isRepeatingSection())
+ {
+ // repeating sections have other ways of defining columns ..
+ return;
+ }
+ if (getCurrentRole() == ROLE_TEMPLATE)
+ {
+ // the template section would break the multi-column stuff and we dont open up sections there
+ // anyway ..
+ return;
+ }
+
+ final PageContext pageContext = getCurrentContext();
+ final Integer columnCount = pageContext.getColumnCount();
+ if (columnCount != null)
+ {
+ if (pageContext.isSectionOpen() == false)
+ {
+ final AttributeList attrs = new AttributeList();
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "style-name", generateSectionStyle(columnCount.intValue()));
+ attrs.setAttribute(OfficeNamespaces.TEXT_NS, "name", sectionNames.generateName("Section"));
+ getXmlWriter().writeTag(OfficeNamespaces.TEXT_NS, "section", attrs, XmlWriterSupport.OPEN);
+
+ pageContext.setSectionOpen(true);
+ }
+ }
+
+ }
+
+ protected void startReportSection(final AttributeMap attrs, final int role)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ sectionHeight = new LengthCalculator();
+ if (role == OfficeDocumentReportTarget.ROLE_TEMPLATE)
+ {
+ // Start buffering with an dummy styles-collection, so that the global styles dont get polluted ..
+ startBuffering(new OfficeStylesCollection(), true);
+ return;
+ }
+
+ if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
+ {
+ startBuffering(getGlobalStylesCollection(), true);
+ pageHeaderOnReportHeader = PageSection.isPrintWithReportHeader(attrs);
+ pageHeaderOnReportFooter = PageSection.isPrintWithReportFooter(attrs);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER)
+ {
+ startBuffering(getGlobalStylesCollection(), true);
+ pageFooterOnReportHeader = PageSection.isPrintWithReportHeader(attrs);
+ pageFooterOnReportFooter = PageSection.isPrintWithReportFooter(attrs);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER)
+ {
+ startBuffering(getGlobalStylesCollection(), true);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
+ {
+ startBuffering(getGlobalStylesCollection(), true);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_VARIABLES)
+ {
+ startBuffering(getGlobalStylesCollection(), false);
+ }
+ else
+ {
+ contentProcessingState = TextRawReportTarget.CP_FIRST_TABLE;
+ if (role == OfficeDocumentReportTarget.ROLE_GROUP_HEADER)
+ {
+ // if we have a repeating header, then skip the first one ..
+ startBuffering(getContentStylesCollection(), true);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_GROUP_FOOTER)
+ {
+ // if this is a repeating footer, skip the last one. This means,
+ // we have to buffer all group footers and wait for the next section..
+ startBuffering(getContentStylesCollection(), true);
+ }
+
+ if (role != OfficeDocumentReportTarget.ROLE_DETAIL)
+ {
+ // reset the detail-state. The flag will be updated on startTable and endOther(Table) if the
+ // current role is ROLE_DETAIL
+ detailBandProcessingState = DETAIL_SECTION_WAIT;
+ }
+ }
+ }
+
+
+ protected void startGroup(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ super.startGroup(attrs);
+ final PageContext pageContext = new PageContext(getCurrentContext());
+ activePageContext.push(pageContext);
+
+ final Object resetPageNumber = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number");
+ if ("true".equals(resetPageNumber))
+ {
+ setPagebreakDefinition(new PageBreakDefinition(true));
+ }
+
+ final Object keepTogether = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "keep-together");
+ if ("whole-group".equals(keepTogether))
+ {
+ pageContext.setKeepTogether(PageContext.KEEP_TOGETHER_GROUP);
+ }
+ else if ("with-first-detail".equals(keepTogether))
+ {
+ if (pageContext.getKeepTogether() != PageContext.KEEP_TOGETHER_GROUP)
+ {
+ pageContext.setKeepTogether(PageContext.KEEP_TOGETHER_FIRST_DETAIL);
+ }
+ }
+
+ final Object columnCountRaw = attrs.getAttribute(OfficeNamespaces.FO_NS, "column-count");
+ final Integer colCount = parseInt(columnCountRaw);
+ if (colCount != null)
+ {
+ pageContext.setColumnCount(colCount);
+ }
+
+ final Object newColumn = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column");
+ if ("true".equals(newColumn))
+ {
+ setColumnBreakPending(true);
+ }
+ }
+
+
+ protected void endGroup(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ super.endGroup(attrs);
+ finishSection();
+
+ activePageContext.pop();
+ }
+
+ private void finishSection()
+ throws ReportProcessingException
+ {
+ final PageContext pageContext = getCurrentContext();
+ if (pageContext.isSectionOpen())
+ {
+ pageContext.setSectionOpen(false);
+ try
+ {
+ getXmlWriter().writeCloseTag();
+ }
+ catch (IOException e)
+ {
+ throw new ReportProcessingException("IOError", e);
+ }
+ }
+ }
+
+ protected void endReportSection(final AttributeMap attrs, final int role)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ if (role == ROLE_TEMPLATE)
+ {
+ finishBuffering();
+ return;
+ }
+
+ final CSSNumericValue result = sectionHeight.getResult();
+ if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
+ {
+ final PageContext pageContext = getCurrentContext();
+ pageContext.setHeader(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER)
+ {
+ final PageContext pageContext = getCurrentContext();
+ pageContext.setFooter(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER)
+ {
+ final PageContext pageContext = getCurrentContext();
+ pageContext.setHeader(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER)
+ {
+ final PageContext pageContext = getCurrentContext();
+ pageContext.setFooter(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_VARIABLES)
+ {
+ if (variables == null)
+ {
+ variables = finishBuffering().getXmlBuffer();
+ }
+ else
+ {
+ variables += finishBuffering().getXmlBuffer();
+ }
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_GROUP_HEADER)
+ {
+ final String headerText = finishBuffering().getXmlBuffer();
+ final int iterationCount = getGroupContext().getParent().getIterationCount();
+ final boolean repeat = "true".equals(attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "repeat-section"));
+ if (repeat == false || iterationCount > 0)
+ {
+ getXmlWriter().writeText(headerText);
+ }
+ }
+ else if (role == OfficeDocumentReportTarget.ROLE_GROUP_FOOTER)
+ {
+ final String footerText = finishBuffering().getXmlBuffer();
+ // how do we detect whether this is the last group footer?
+ getXmlWriter().writeText(footerText);
+ }
+
+ }
+
+ public void endReport(final ReportStructureRoot report)
+ throws DataSourceException, ReportProcessingException
+ {
+ super.endReport(report);
+ variablesDeclarations = null;
+
+ try
+ {
+ // Write the settings ..
+ final AttributeList rootAttributes = new AttributeList();
+ rootAttributes.addNamespaceDeclaration("office", OfficeNamespaces.OFFICE_NS);
+ rootAttributes.addNamespaceDeclaration("config", OfficeNamespaces.CONFIG);
+ rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0");
+ final OutputStream outputStream = getOutputRepository().createOutputStream("settings.xml","text/xml");
+ final XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outputStream, "UTF-8"), createTagDescription());
+ xmlWriter.writeXmlDeclaration("UTF-8");
+ xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "document-settings", rootAttributes, XmlWriterSupport.OPEN);
+ xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "settings", XmlWriterSupport.OPEN);
+ xmlWriter.writeTag(OfficeNamespaces.CONFIG, "config-item-set", "name", "ooo:configuration-settings", XmlWriterSupport.OPEN);
+
+ final AttributeList configAttributes = new AttributeList();
+ configAttributes.setAttribute(OfficeNamespaces.CONFIG, "name", "TableRowKeep");
+ configAttributes.setAttribute(OfficeNamespaces.CONFIG, "type", "boolean");
+ xmlWriter.writeTag(OfficeNamespaces.CONFIG, "config-item", configAttributes, XmlWriterSupport.OPEN);
+ xmlWriter.writeText("true");
+ xmlWriter.writeCloseTag();
+
+ xmlWriter.writeCloseTag();
+ xmlWriter.writeCloseTag();
+ xmlWriter.writeCloseTag();
+ xmlWriter.close();
+ }
+ catch (IOException ioe)
+ {
+ throw new ReportProcessingException("Failed to write settings document");
+ }
+ }
+
+ protected void endOther(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ if (isTableMergeActive() && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
+ {
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-columns", attrs))
+ {
+ finishBuffering();
+ return;
+ }
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.INTERNAL_NS, "image", attrs))
+ {
+ return;
+ }
+
+ final XmlWriter xmlWriter = getXmlWriter();
+ if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH &&
+ ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs))
+ {
+ if (variables != null)
+ {
+ // This cannot happen as long as the report sections only contain tables. But at some point in the
+ // future they will be made of paragraphs, and then we are prepared ..
+// Log.debug("Variables-Section " + variables);
+ if (sectionKeepTogether == true && expectedTableRowCount > 0)
+ {
+ StyleUtilities.copyStyle("paragraph",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
+ getGlobalStylesCollection(), getPredefinedStylesCollection());
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ }
+ else
+ {
+ StyleUtilities.copyStyle("paragraph",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT, getStylesCollection(),
+ getGlobalStylesCollection(), getPredefinedStylesCollection());
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT, XmlWriterSupport.OPEN);
+ xmlWriter.writeText(variables);
+ xmlWriter.writeCloseTag();
+ variables = null;
+ }
+ }
+ // Only generate the empty paragraph, if we have to add the keep-together ..
+ else if (expectedTableRowCount > 0 && sectionKeepTogether == true && firstCellSeen == false)
+ {
+ // we have no variables ..
+ StyleUtilities.copyStyle("paragraph",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(),
+ getGlobalStylesCollection(), getPredefinedStylesCollection());
+ xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "p", "style-name",
+ TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.CLOSE);
+ }
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table-cell", attrs))
+ {
+ firstCellSeen = true;
+ }
+ else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "covered-table-cell", attrs))
+ {
+ firstCellSeen = true;
+ }
+
+ if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, "table", attrs))
+ {
+ if (getCurrentRole() == ROLE_DETAIL)
+ {
+ if (isTableMergeActive() == false)
+ {
+ // We do not merge the detail bands, so an ordinary close will do.
+ xmlWriter.writeCloseTag();
+ }
+ else if (detailBandProcessingState == DETAIL_SECTION_FIRST_STARTED)
+ {
+ final int keepTogetherState = getCurrentContext().getKeepTogether();
+ if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL)
+ {
+ xmlWriter.writeCloseTag();
+ detailBandProcessingState = DETAIL_SECTION_FIRST_PRINTED;
+ }
+ else
+ {
+ detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
+ }
+ }
+ else if (detailBandProcessingState == DETAIL_SECTION_OTHER_STARTED)
+ {
+ detailBandProcessingState = DETAIL_SECTION_OTHER_PRINTED;
+ }
+ }
+ else
+ {
+ xmlWriter.writeCloseTag();
+ }
+ if (isSectionPagebreakAfter(attrs))
+ {
+ setPagebreakDefinition(new PageBreakDefinition(false));
+ }
+ }
+ else
+ {
+ xmlWriter.writeCloseTag();
+ }
+ }
+
+ protected void endGroupBody(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ if (tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE)
+ {
+ if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED)
+ {
+ // closes the table ..
+ final XmlWriter xmlWriter = getXmlWriter();
+ xmlWriter.writeCloseTag();
+ detailBandProcessingState = DETAIL_SECTION_WAIT;
+ }
+ }
+
+ }
+
+ protected void endContent(final AttributeMap attrs)
+ throws IOException, DataSourceException, ReportProcessingException
+ {
+ finishSection();
+ final BufferState bodyText = finishBuffering();
+ final XmlWriter writer = getXmlWriter();
+
+ final Map definedMappings = variablesDeclarations.getDefinedMappings();
+ if (definedMappings.isEmpty() == false)
+ {
+ writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decls", XmlWriterSupport.OPEN);
+ final Iterator mappingsIt = definedMappings.entrySet().iterator();
+ while (mappingsIt.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry) mappingsIt.next();
+ final AttributeList entryList = new AttributeList();
+ entryList.setAttribute(OfficeNamespaces.TEXT_NS, "name", (String) entry.getKey());
+ entryList.setAttribute(OfficeNamespaces.OFFICE_NS, "value-type", (String) entry.getValue());
+ writer.writeTag(OfficeNamespaces.TEXT_NS, "variable-decl", entryList, XmlWriterSupport.CLOSE);
+ }
+ writer.writeCloseTag();
+ }
+
+ writer.writeStream(bodyText.getXmlAsReader());
+ writer.setLineEmpty(true);
+ writer.writeCloseTag();
+ }
+
+ public String getExportDescriptor()
+ {
+ return "raw/" + PentahoReportEngineMetaData.OPENDOCUMENT_TEXT;
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java b/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java
new file mode 100644
index 000000000000..1e01e2404895
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/output/text/VariablesDeclarations.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VariablesDeclarations.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.output.text;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
+
+import org.jfree.report.util.AttributeNameGenerator;
+
+/**
+ * A collection that holds all used variables. A variable is primarily keyed by
+ * its original name. If a variable contains more than one type, it is also
+ * keyed by the type.
+ *
+ * @author Thomas Morgner
+ * @since 26.03.2007
+ */
+public class VariablesDeclarations
+{
+ private AttributeNameGenerator nameGenerator;
+ private HashMap variables;
+
+ public VariablesDeclarations()
+ {
+ variables = new HashMap();
+ nameGenerator = new AttributeNameGenerator();
+ }
+
+ public String produceVariable(final String name,
+ final String type)
+ {
+ HashMap holder = (HashMap) variables.get(name);
+ if (holder == null)
+ {
+ holder = new HashMap();
+ variables.put(name, holder);
+ }
+
+ final String mapping = (String) holder.get(type);
+ if (mapping != null)
+ {
+ return mapping;
+ }
+ final String result = nameGenerator.generateName(name);
+ if (holder.isEmpty())
+ {
+ // create the default mapping as well..
+ holder.put (null, name);
+ }
+ holder.put (type, name);
+ return result;
+ }
+
+ public Map getDefinedMappings ()
+ {
+ final HashMap mappings = new HashMap();
+ final Iterator vars = variables.values().iterator();
+ while (vars.hasNext())
+ {
+ final HashMap types = (HashMap) vars.next();
+ final Iterator varsByType = types.entrySet().iterator();
+ while (varsByType.hasNext())
+ {
+ final Map.Entry entry = (Map.Entry) varsByType.next();
+ final String varName = (String) entry.getValue();
+ final String type = (String) entry.getKey();
+ if (type != null)
+ {
+ mappings.put (varName, type);
+ }
+ }
+ }
+ return mappings;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java b/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java
new file mode 100644
index 000000000000..ee12d790f60d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AttributeSpecification.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+public final class AttributeSpecification
+{
+ private String namespaceUrl;
+ private String attributName;
+ private String mapperImplementation;
+
+ public AttributeSpecification (String namespaceUrl, String attributName, String mapperImplementation)
+ {
+ this.namespaceUrl = namespaceUrl;
+ this.attributName = attributName;
+ this.mapperImplementation = mapperImplementation;
+ }
+
+ public String getAttributName ()
+ {
+ return attributName;
+ }
+
+ public String getMapperImplementation ()
+ {
+ return mapperImplementation;
+ }
+
+ public String getNamespaceUrl ()
+ {
+ return namespaceUrl;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java
new file mode 100644
index 000000000000..4c550bdc2833
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/ElementReadHandler.java
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ElementReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser;
+
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Creation-Date: 03.07.2006, 14:22:34
+ *
+ * @author Thomas Morgner
+ */
+public abstract class ElementReadHandler extends AbstractXmlReadHandler
+{
+ public ElementReadHandler()
+ {
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ final Element element = getElement();
+ copyElementType(element);
+ copyAttributes(attrs, element);
+ }
+
+ protected void copyElementType(final Element element)
+ {
+ element.setType(getTagName());
+ element.setNamespace(getUri());
+ }
+
+ protected void copyAttributes(final Attributes attrs, final Element element)
+ {
+ final int length = attrs.getLength();
+ for (int i = 0; i < length; i++)
+ {
+ final String value = attrs.getValue(i);
+ final String namespace = attrs.getURI(i);
+ final String attr = attrs.getLocalName(i);
+ element.setAttribute(namespace, attr, value);
+ }
+ }
+
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject() throws SAXException
+ {
+ return getElement();
+ }
+
+ public abstract Element getElement ();
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java
new file mode 100644
index 000000000000..92ddfb19961f
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeDocumentXmlResourceFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import com.sun.star.report.pentaho.model.OfficeDocument;
+import org.jfree.report.modules.factories.report.base.JFreeReportXmlResourceFactory;
+
+/**
+ * A LibLoader resource factory for OfficeDocument objects. OfficeDocuments are
+ * JFreeReport instances which have some additional properties.
+ *
+ * @author Thomas Morgner
+ * @since 09.03.2007
+ */
+public class OfficeDocumentXmlResourceFactory extends JFreeReportXmlResourceFactory
+{
+
+ public OfficeDocumentXmlResourceFactory()
+ {
+ }
+
+ public Class getFactoryType()
+ {
+ return OfficeDocument.class;
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java
new file mode 100644
index 000000000000..0b87ec8a9695
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeParserUtil.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jfree.resourceloader.Resource;
+import org.jfree.resourceloader.ResourceException;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.util.DefaultConfiguration;
+import org.jfree.util.Log;
+import org.jfree.report.JFreeReportBoot;
+import org.jfree.layouting.namespace.NamespaceDefinition;
+import org.jfree.layouting.namespace.Namespaces;
+
+public class OfficeParserUtil
+{
+ private static OfficeParserUtil instance;
+ private static final String NAMESPACES_PREFIX = "namespaces.";
+
+ public static synchronized OfficeParserUtil getInstance ()
+ {
+ if (instance == null)
+ {
+ instance = new OfficeParserUtil();
+ }
+ return instance;
+ }
+
+ private DefaultConfiguration props;
+ private NamespaceDefinition[] namespaces;
+
+ private OfficeParserUtil ()
+ {
+ props = new DefaultConfiguration();
+
+ ResourceManager resourceManager = new ResourceManager();
+ resourceManager.registerDefaults();
+ try
+ {
+ final Resource res = resourceManager.createDirectly
+ ("res://com/sun/star/report/pentaho/parser/selectors.properties", Properties.class);
+ final Properties resProps = (Properties) res.getResource();
+ props.putAll(resProps);
+ }
+ catch (ResourceException e)
+ {
+ Log.warn("Unable to load mapping rules. Parsing services may not be available.", e);
+ }
+
+ namespaces = Namespaces.createFromConfig
+ (JFreeReportBoot.getInstance().getGlobalConfig(),
+ "org.jfree.report.namespaces.", resourceManager);
+ }
+
+ public NamespaceDefinition getNamespaceDeclaration (String uri)
+ {
+ if (uri == null) throw new NullPointerException("URI must not be null");
+
+ for (int i = 0; i < namespaces.length; i++)
+ {
+ final NamespaceDefinition definition = namespaces[i];
+ if (uri.equals(definition.getURI()))
+ {
+ return definition;
+ }
+ }
+ return null;
+ }
+
+ public String getGenericFont (String officeFont)
+ {
+ return props.getProperty
+ ("font-family." + officeFont.toLowerCase(), officeFont);
+ }
+
+ public String getNamespaceURI (String namespacePrefix)
+ {
+ return props.getProperty(NAMESPACES_PREFIX + namespacePrefix);
+ }
+
+ public String getNamespaceForStyleFamily (String styleFamily)
+ {
+ return props.getProperty("style-family." + styleFamily);
+ }
+
+ public Map getNamespaces ()
+ {
+ Map map = new HashMap();
+ Iterator keys = props.findPropertyKeys(NAMESPACES_PREFIX);
+ while (keys.hasNext())
+ {
+ String key = (String) keys.next();
+ String value = props.getConfigProperty(key);
+ map.put (key.substring(NAMESPACES_PREFIX.length()), value);
+ }
+ return map;
+ }
+
+ public String getNamespacePrefix (String namespaceURI)
+ {
+ Iterator keys = props.findPropertyKeys(NAMESPACES_PREFIX);
+ while (keys.hasNext())
+ {
+ String key = (String) keys.next();
+ String value = props.getConfigProperty(key);
+ if (namespaceURI.equals(value))
+ {
+ return key.substring(NAMESPACES_PREFIX.length());
+ }
+ }
+ return null;
+ }
+
+ public AttributeSpecification parseStyleAttrDefinition
+ (final String key, final String prefix, final String tagname)
+ {
+ final String configPrefix = "attr." + prefix + "." + tagname + ".";
+ final String configSuffix = key.substring(configPrefix.length());
+ final int dotPosition = configSuffix.indexOf('.');
+ if (dotPosition == -1)
+ {
+ return null;
+ }
+ final String namespaceUri = getNamespaceURI(configSuffix.substring(0, dotPosition));
+ final String attrName = configSuffix.substring(dotPosition + 1);
+ final String value = props.getProperty(key);
+ return new AttributeSpecification(namespaceUri, attrName, value);
+ }
+
+ public Iterator findStylesForElement (final String prefix,
+ final String tagname)
+ {
+ final String configPrefix = "attr." + prefix + "." + tagname + ".";
+ return props.findPropertyKeys(configPrefix);
+ }
+
+ public boolean isValidStyleElement (String uri, String tagName)
+ {
+ final String prefix = getNamespacePrefix(uri);
+ if (prefix == null)
+ {
+ return false;
+ }
+
+ final Iterator stylesForElement = findStylesForElement(prefix, tagName);
+ return stylesForElement.hasNext();
+ }
+
+ public String getSelectorPattern ()
+ {
+ return props.getConfigProperty("style-selector.pattern");
+ }
+
+ public static void main (String[] args)
+ {
+ JFreeReportBoot.getInstance().start();
+ System.out.print(OfficeParserUtil.getInstance().getNamespaces());
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java
new file mode 100644
index 000000000000..e3ad45e3508d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStylesXmlResourceFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import org.jfree.report.JFreeReportBoot;
+import org.jfree.util.Configuration;
+import org.jfree.xmlns.parser.AbstractXmlResourceFactory;
+
+/**
+ * A LibLoader resource factory for loading an OfficeStyles-collection. This
+ * implementation is meant to parse the 'styles.xml' file.
+ *
+ * @author Thomas Morgner
+ * @since 09.03.2007
+ */
+public class OfficeStylesXmlResourceFactory extends AbstractXmlResourceFactory
+{
+
+ public OfficeStylesXmlResourceFactory()
+ {
+ }
+
+
+ protected Configuration getConfiguration()
+ {
+ return JFreeReportBoot.getInstance().getGlobalConfig();
+ }
+
+ public Class getFactoryType()
+ {
+ return OfficeStylesCollection.class;
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java
new file mode 100644
index 000000000000..9eacced8d034
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StarStyleXmlFactoryModule.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.parser.office.DocumentStylesReadHandler;
+import org.jfree.xmlns.parser.XmlDocumentInfo;
+import org.jfree.xmlns.parser.XmlFactoryModule;
+import org.jfree.xmlns.parser.XmlReadHandler;
+
+public class StarStyleXmlFactoryModule implements XmlFactoryModule
+{
+ public StarStyleXmlFactoryModule()
+ {
+ }
+
+ public XmlReadHandler createReadHandler (final XmlDocumentInfo documentInfo)
+ {
+ return new DocumentStylesReadHandler();
+ }
+
+ public int getDocumentSupport (final XmlDocumentInfo documentInfo)
+ {
+ final String rootNamespace = documentInfo.getRootElementNameSpace();
+ if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) == false)
+ {
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+ else if ("document-styles".equals(documentInfo.getRootElement()))
+ {
+ return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE;
+ }
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+
+ public String getDefaultNamespace(final XmlDocumentInfo documentInfo)
+ {
+ return null;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java
new file mode 100644
index 000000000000..b5a31cec9b65
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StarXmlFactoryModule.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import org.jfree.xmlns.parser.XmlDocumentInfo;
+import org.jfree.xmlns.parser.XmlFactoryModule;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import com.sun.star.report.pentaho.parser.office.DocumentContentReadHandler;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+public class StarXmlFactoryModule implements XmlFactoryModule
+{
+ public StarXmlFactoryModule ()
+ {
+ }
+
+ public XmlReadHandler createReadHandler (final XmlDocumentInfo documentInfo)
+ {
+ return new DocumentContentReadHandler();
+ }
+
+ public int getDocumentSupport (final XmlDocumentInfo documentInfo)
+ {
+ final String rootNamespace = documentInfo.getRootElementNameSpace();
+ if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) == false)
+ {
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+
+ if ("document-content".equals(documentInfo.getRootElement()))
+ {
+ return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE;
+ }
+ if ("document".equals(documentInfo.getRootElement()))
+ {
+ return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE;
+ }
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+
+ public String getDefaultNamespace(final XmlDocumentInfo documentInfo)
+ {
+ return null;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java
new file mode 100644
index 000000000000..ffb3463885b6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/StyleMapper.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser;
+
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+
+public interface StyleMapper
+{
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule);
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java
new file mode 100644
index 000000000000..a0379a05e517
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/data/DataStyleReadHandler.java
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DataStyleReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.data;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.DataStyle;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.StaticText;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class DataStyleReadHandler extends ElementReadHandler
+{
+ private DataStyle dataStyle;
+ private ArrayList children;
+ private boolean hasCData;
+
+ public DataStyleReadHandler(final boolean hasCData)
+ {
+ this.hasCData = hasCData;
+ this.dataStyle = new DataStyle();
+ this.children = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.DATASTYLE_NS.equals(uri))
+ {
+ final DataStyleReadHandler xrh = new DataStyleReadHandler("text".equals(tagName));
+ children.add(xrh);
+ return xrh;
+ }
+
+ return null;
+ }
+
+ /**
+ * This method is called to process the character data between element tags.
+ *
+ * @param ch the character buffer.
+ * @param start the start index.
+ * @param length the length.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ public void characters(final char[] ch, final int start, final int length)
+ throws SAXException
+ {
+ if (hasCData)
+ {
+ children.add(new StaticText(new String(ch, start, length)));
+ }
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < children.size(); i++)
+ {
+ final Object o = children.get(i);
+ if (o instanceof ElementReadHandler)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) o;
+ dataStyle.addNode(handler.getElement());
+ }
+ else if (o instanceof StaticText)
+ {
+ dataStyle.addNode((StaticText) o);
+ }
+ }
+ }
+
+
+ public DataStyle getDataStyle()
+ {
+ return dataStyle;
+ }
+
+ public Element getElement()
+ {
+ return dataStyle;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java
new file mode 100644
index 000000000000..9ef4ed89ecf8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/office/BodyReadHandler.java
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: BodyReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.office;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.rpt.ReportReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class BodyReadHandler extends ElementReadHandler
+{
+ private ElementReadHandler reportReadHandler;
+ private Section body;
+
+ public BodyReadHandler ()
+ {
+ body = new Section();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild (final String uri, final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.OFFICE_NS.equals(uri) == false)
+ {
+ return null;
+ }
+ if ("report".equals(tagName))
+ {
+ reportReadHandler = new ReportReadHandler();
+ return reportReadHandler;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ if (reportReadHandler != null)
+ {
+ body.addNode(reportReadHandler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return body;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java
new file mode 100644
index 000000000000..96f3afa10c5b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java
@@ -0,0 +1,248 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DocumentContentReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.office;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeDocument;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.parser.style.OfficeStylesReadHandler;
+import org.jfree.report.JFreeReport;
+import org.jfree.resourceloader.Resource;
+import org.jfree.resourceloader.ResourceException;
+import org.jfree.resourceloader.ResourceKey;
+import org.jfree.resourceloader.ResourceKeyCreationException;
+import org.jfree.resourceloader.ResourceManager;
+import org.jfree.util.Log;
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * This is the root handler for the document context. The
+ * 'office:document-context' element is encountered, if the document is split
+ * into separate files.
+ * <p/>
+ * Alternativly, there is the option to keep everything in one file. The root
+ * element for that format is 'office:document'.
+ */
+public class DocumentContentReadHandler extends AbstractXmlReadHandler
+{
+ private OfficeDocument report;
+ private FontFaceDeclsReadHandler fontFaceReadHandler;
+ private BodyReadHandler bodyReadHandler;
+ private OfficeStylesCollection officeStylesCollection;
+
+ public DocumentContentReadHandler()
+ {
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
+ {
+ super.startParsing(attrs);
+ // parse the external 'styles.xml' if it exists
+ // parse the external 'meta.xml' if it exists
+ // parse the external 'settings.xml' if it exists
+ this.report = parseContentXml();
+ this.report.setVirtual(true);
+ this.report.setType("document-content");
+ this.report.setNamespace(OfficeNamespaces.OFFICE_NS);
+ this.report.setVirtual(true);
+ this.officeStylesCollection = parseStylesXml();
+ }
+
+ private OfficeStylesCollection parseStylesXml ()
+ {
+ final ResourceKey contextKey = getRootHandler().getContext();
+ final ResourceManager resourceManager = getRootHandler().getResourceManager();
+
+ try
+ {
+ final ResourceKey key =
+ resourceManager.deriveKey(contextKey, "styles.xml");
+ final Resource resource =
+ resourceManager.create(key, contextKey, OfficeStylesCollection.class);
+ final OfficeStylesCollection styles =
+ (OfficeStylesCollection) resource.getResource();
+ if (styles != null)
+ {
+ return styles;
+ }
+ }
+ catch (ResourceKeyCreationException e)
+ {
+ // ignore ..
+ Log.debug("Failed to create resource-key for 'styles.xml'. Ignoring.", e);
+ }
+ catch (ResourceException e)
+ {
+ // ignore ..
+ Log.debug("Failed to parse resource for 'styles.xml'. Ignoring.", e);
+ }
+
+ return new OfficeStylesCollection();
+ }
+
+ private OfficeDocument parseContentXml()
+ {
+ if (OfficeNamespaces.OFFICE_NS.equals(getUri()) == false)
+ {
+ return new OfficeDocument();
+ }
+
+ // Check whether this is a content.xml.
+ if ("document-content".equals(getTagName()) != false)
+ {
+ return new OfficeDocument();
+ }
+
+ // we may have to parse an existing content.xml.
+ final ResourceKey contextKey = getRootHandler().getContext();
+ final ResourceManager resourceManager = getRootHandler().getResourceManager();
+ try
+ {
+ final ResourceKey key =
+ resourceManager.deriveKey(contextKey, "content.xml");
+ final Resource resource =
+ resourceManager.create(key, contextKey, JFreeReport.class);
+ final OfficeDocument report = (OfficeDocument) resource.getResource();
+ if (report != null)
+ {
+ return report;
+ }
+ }
+ catch (ResourceKeyCreationException e)
+ {
+ // ignore ..
+ Log.debug("Failed to create resource-key for 'content.xml'. Ignoring.");
+ }
+ catch (ResourceException e)
+ {
+ // ignore ..
+ Log.debug("Failed to parse resource for 'content.xml'. Ignoring.");
+ }
+ return new OfficeDocument();
+
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (!OfficeNamespaces.OFFICE_NS.equals(uri))
+ {
+ return null;
+ }
+
+ if ("font-face-decls".equals(tagName))
+ {
+ if (fontFaceReadHandler == null)
+ {
+ fontFaceReadHandler = new FontFaceDeclsReadHandler
+ (officeStylesCollection.getFontFaceDecls());
+ }
+ return fontFaceReadHandler;
+ }
+ else if ("automatic-styles".equals(tagName))
+ {
+ return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles());
+ }
+ else if ("styles".equals(tagName))
+ {
+ return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles());
+ }
+ else if ("master-styles".equals(tagName))
+ {
+ return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles());
+ }
+ else if ("body".equals(tagName))
+ {
+ bodyReadHandler = new BodyReadHandler();
+ return bodyReadHandler;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ // The office-document is the only node of the report. It allows us to
+ // switch the layout-processing implementation later on.
+
+ report.setStylesCollection(officeStylesCollection);
+
+ if (bodyReadHandler != null)
+ {
+ report.addNode(bodyReadHandler.getElement());
+ }
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return report;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java
new file mode 100644
index 000000000000..6ab268e9cf32
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DocumentStylesReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.office;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeStylesCollection;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.style.OfficeStylesReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * The root parser for a 'styles.xml' document. This generates the global
+ * (or common) style collection. These styles contain the named common styles
+ * and the page layouts.
+ *
+ * @author Thomas Morgner
+ * @since 08.03.2007
+ */
+public class DocumentStylesReadHandler extends ElementReadHandler
+{
+ private OfficeStylesCollection officeStylesCollection;
+ private FontFaceDeclsReadHandler fontFaceReadHandler;
+
+ public DocumentStylesReadHandler()
+ {
+ officeStylesCollection = new OfficeStylesCollection();
+ }
+
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (!OfficeNamespaces.OFFICE_NS.equals(uri))
+ {
+ return null;
+ }
+
+ if ("font-face-decls".equals(tagName))
+ {
+ if (fontFaceReadHandler == null)
+ {
+ fontFaceReadHandler = new FontFaceDeclsReadHandler
+ (officeStylesCollection.getFontFaceDecls());
+ }
+ return fontFaceReadHandler;
+ }
+ else if ("automatic-styles".equals(tagName))
+ {
+ return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles());
+ }
+ else if ("styles".equals(tagName))
+ {
+ return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles());
+ }
+ else if ("master-styles".equals(tagName))
+ {
+ return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles());
+ }
+ return null;
+ }
+
+
+ public Element getElement()
+ {
+ return officeStylesCollection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java
new file mode 100644
index 000000000000..230932ab6cf1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFaceDeclsReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.office;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.FontFaceDeclsSection;
+import com.sun.star.report.pentaho.model.FontFaceElement;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.style.FontFaceReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Reads the font-face declarations section. This one can only contain
+ * font-face elements.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class FontFaceDeclsReadHandler extends ElementReadHandler
+{
+ private FontFaceDeclsSection fontFaceDecls;
+ private ArrayList fontFaceReadHandlers;
+
+ public FontFaceDeclsReadHandler(final FontFaceDeclsSection fontFaceDecls)
+ {
+ this.fontFaceDecls = fontFaceDecls;
+ this.fontFaceReadHandlers = new ArrayList();
+ }
+
+ public FontFaceDeclsSection getFontFaceDecls()
+ {
+ return fontFaceDecls;
+ }
+
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.STYLE_NS.equals(uri) == false)
+ {
+ return null;
+ }
+
+ if ("font-face".equals(tagName))
+ {
+ final FontFaceReadHandler frh = new FontFaceReadHandler();
+ fontFaceReadHandlers.add(frh);
+ return frh;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ for (int i = 0; i < fontFaceReadHandlers.size(); i++)
+ {
+ final FontFaceReadHandler handler = (FontFaceReadHandler) fontFaceReadHandlers.get(i);
+ fontFaceDecls.addFontFace((FontFaceElement) handler.getElement());
+ }
+ }
+
+ public Element getElement()
+ {
+ return fontFaceDecls;
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java
new file mode 100644
index 000000000000..ae746a441f14
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/office/MasterStylesReadHandler.java
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: MasterStylesReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.office;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.style.StyleDefinitionReadHandler;
+import com.sun.star.report.pentaho.parser.style.MasterPageReadHandler;
+import com.sun.star.report.pentaho.model.OfficeMasterStyles;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class MasterStylesReadHandler extends ElementReadHandler
+{
+ private OfficeMasterStyles masterStyles;
+ private ArrayList otherHandlers;
+ private ArrayList masterPageHandlers;
+
+ public MasterStylesReadHandler(final OfficeMasterStyles masterStyles)
+ {
+ this.masterStyles = masterStyles;
+ this.masterPageHandlers = new ArrayList();
+ this.otherHandlers = new ArrayList();
+ }
+
+ public OfficeMasterStyles getMasterStyles()
+ {
+ return masterStyles;
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.STYLE_NS.equals(uri))
+ {
+ if ("master-page".equals(tagName))
+ {
+ final MasterPageReadHandler mrh = new MasterPageReadHandler();
+ masterPageHandlers.add(mrh);
+ return mrh;
+ }
+ }
+
+ final StyleDefinitionReadHandler readHandler =
+ new StyleDefinitionReadHandler();
+ otherHandlers.add(readHandler);
+ return readHandler;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ for (int i = 0; i < otherHandlers.size(); i++)
+ {
+ final ElementReadHandler handler =
+ (ElementReadHandler) otherHandlers.get(i);
+ masterStyles.getOtherNodes().addNode(handler.getElement());
+ }
+
+ for (int i = 0; i < masterPageHandlers.size(); i++)
+ {
+ final MasterPageReadHandler handler =
+ (MasterPageReadHandler) masterPageHandlers.get(i);
+ masterStyles.addMasterPage(handler.getMasterPage());
+ }
+ }
+
+ public Element getElement()
+ {
+ return masterStyles;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd
new file mode 100644
index 000000000000..da1f4a809fc6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd
@@ -0,0 +1,422 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ OpenOffice.org - a multi-platform office productivity suite
+
+ $RCSfile: rpt-schema-v1.0-os.xsd,v $
+
+ $Revision: 1.2 $
+
+ last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+
+ The Contents of this file are made available subject to
+ the terms of GNU Lesser General Public License Version 2.1.
+
+
+ GNU Lesser General Public License Version 2.1
+ =============================================
+ Copyright 2007 by Sun Microsystems, Inc.
+ 901 San Antonio Road, Palo Alto, CA 94303, USA
+ Copyright 2007 by Pentaho Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1, as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+ -->
+
+<!---->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="urn:oasis:names:tc:opendocument:xmlns:report:1.0"
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ xmlns:rpt="urn:oasis:names:tc:opendocument:xmlns:report:1.0"
+ xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
+ xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
+ xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
+ xmlns:xforms="http://www.w3.org/2002/xforms"
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+ xmlns:ns1="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <xs:import namespace="http://purl.org/dc/elements/1.1/" schemaLocation="dc.xsd"/>
+ <xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="math.xsd"/>
+ <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+ <xs:import namespace="http://www.w3.org/2002/xforms" schemaLocation="xforms.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" schemaLocation="anim.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" schemaLocation="chart.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:config:1.0" schemaLocation="config.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" schemaLocation="ns1.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" schemaLocation="dr3d.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" schemaLocation="draw.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:form:1.0" schemaLocation="form.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" schemaLocation="meta.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:office:1.0" schemaLocation="office.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" schemaLocation="presentation.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:script:1.0" schemaLocation="script.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" schemaLocation="smil.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0" schemaLocation="style.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" schemaLocation="svg.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0" schemaLocation="table.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0" schemaLocation="OpenDocument-schema-v1.0-os.xsd"/>
+ <xs:import namespace="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" schemaLocation="fo.xsd"/>
+ <xs:attributeGroup name="office-report-attlist">
+ <xs:attribute name="command-type" default="command" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="table"/>
+ <xs:enumeration value="query"/>
+ <xs:enumeration value="command"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="command" form="qualified" type="text:string"/>
+ <xs:attribute name="escape-processing" default="true" form="qualified" type="text:boolean"/>
+ <xs:attribute name="filter" form="qualified" type="text:string"/>
+ <xs:attribute name="caption" form="qualified" type="text:string"/>
+ </xs:attributeGroup>
+ <xs:element name="report-component">
+ <xs:complexType>
+ <xs:attributeGroup ref="text:common-draw-name-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="group">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:function"/>
+ <xs:element minOccurs="0" ref="rpt:group-header"/>
+ <xs:choice>
+ <xs:element ref="rpt:group"/>
+ <xs:element ref="rpt:detail"/>
+ </xs:choice>
+ <xs:element minOccurs="0" ref="rpt:group-footer"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-group-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-group-attlist">
+ <xs:attribute name="sort-ascending" use="required" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="start-new-column" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="reset-page-number" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="print-header-on-each-page" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="group-expression" use="required" form="qualified" type="text:string"/>
+ <xs:attribute name="keep-together" default="no" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="no"/>
+ <xs:enumeration value="whole-group"/>
+ <xs:enumeration value="with-first-detail"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:element name="group-header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-group-section-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="group-footer">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-group-section-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="report-header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="page-header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-page-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="column-header">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="detail">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="column-footer">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="page-footer">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-page-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="report-footer">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="table:table"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-page-attlist">
+ <xs:attribute name="page-print-option" default="all-pages" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="all-pages"/>
+ <xs:enumeration value="not-with-report-header"/>
+ <xs:enumeration value="not-with-report-footer"/>
+ <xs:enumeration value="not-with-report-header-nor-footer"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:attributeGroup name="rpt-section-attlist">
+ <xs:attribute name="visible" default="true" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="force-new-page" default="none" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="none"/>
+ <xs:enumeration value="before-section"/>
+ <xs:enumeration value="after-section"/>
+ <xs:enumeration value="before-after-section"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="new-row-or-column" default="none" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="none"/>
+ <xs:enumeration value="before-section"/>
+ <xs:enumeration value="after-section"/>
+ <xs:enumeration value="before-after-section"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="keep-together" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:attributeGroup name="rpt-group-section-attlist">
+ <xs:attribute name="repeat-section" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:element name="sub-document">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:group ref="rpt:report-master-detail-fields"/>
+ <xs:element ref="rpt:report-element"/>
+ <xs:choice minOccurs="0">
+ <xs:element ref="office:document"/>
+ <xs:element ref="math:math"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:report-sub-document-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="report-sub-document-attlist">
+ <xs:attribute ref="xlink:href"/>
+ <xs:attribute ref="xlink:type"/>
+ <xs:attributeGroup ref="xlink:show"/>
+ <xs:attributeGroup ref="xlink:actuate"/>
+ </xs:attributeGroup>
+ <xs:group name="report-master-detail-fields">
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="rpt:master-detail-fields"/>
+ </xs:sequence>
+ </xs:group>
+ <xs:element name="master-detail-fields">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:master-detail-field"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="master-detail-field">
+ <xs:complexType>
+ <xs:attribute name="master" use="required" form="qualified" type="text:string"/>
+ <xs:attribute name="detail" form="qualified" type="text:string"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="function">
+ <xs:complexType>
+ <xs:attribute name="formula" use="required" form="qualified" type="text:formula"/>
+ <xs:attribute name="name" use="required" form="qualified" type="text:string"/>
+ <xs:attribute name="pre-evaluated" use="required" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="report-element">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" ref="rpt:conditional-print-expression"/>
+ <xs:element minOccurs="0" ref="rpt:report-component"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="rpt:format-condition"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="rpt:rpt-report-element-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-report-element-attlist">
+ <xs:attribute name="print-when-group-change" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="print-repeated-values" default="true" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+ <xs:element name="conditional-print-expression" type="xs:string"/>
+ <xs:element name="format-condition">
+ <xs:complexType>
+ <xs:attributeGroup ref="rpt:rpt-format-condition-attlist"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-format-condition-attlist">
+ <xs:attribute name="enabled" default="false" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="formula" form="qualified" type="text:formula"/>
+ </xs:attributeGroup>
+ <xs:element name="fixed-content">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="rpt:report-element"/>
+ <xs:element ref="text:p"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="formatted-text">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="rpt:report-element"/>
+ <xs:group ref="text:common-form-control-content"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-formatted-text-attlist">
+ <xs:attributeGroup ref="text:common-data-field-attlist"/>
+ </xs:attributeGroup>
+ <xs:element name="image">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref="rpt:report-element"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="rpt-image-attlist">
+ <xs:attributeGroup ref="text:common-data-field-attlist"/>
+ <xs:attributeGroup ref="text:image-data"/>
+ <xs:attribute name="scale" use="required" form="qualified">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:attributeGroup>
+</xs:schema>
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java
new file mode 100644
index 000000000000..36855e6713b9
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ConditionalPrintExpressionReadHandler.java
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ConditionalPrintExpressionReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.expressions.FormulaFunction;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Handles the 'report:conditional-print-expression' element that can appear
+ * in all report elements and all root-level sections.
+ *
+ * @author Thomas Morgner
+ * @since 02.03.2007
+ */
+public class ConditionalPrintExpressionReadHandler
+ extends AbstractXmlReadHandler
+{
+ private Element element;
+
+ public ConditionalPrintExpressionReadHandler(final Element element)
+ {
+ if (element == null)
+ {
+ throw new NullPointerException();
+ }
+ this.element = element;
+ }
+
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+ final String formula = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula");
+ if (formula != null)
+ {
+ final FormulaFunction valueExpression = new FormulaFunction();
+ valueExpression.setFormula(formula);
+ element.setDisplayCondition(valueExpression);
+ }
+
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return element;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java
new file mode 100644
index 000000000000..ab1e63273de7
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/DetailRootTableReadHandler.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DetailRootTableReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.OfficeDetailSection;
+
+public class DetailRootTableReadHandler extends RootTableReadHandler
+{
+
+ public DetailRootTableReadHandler()
+ {
+ super(new OfficeDetailSection());
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java
new file mode 100644
index 000000000000..55644bf562dc
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FixedContentReadHandler.java
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedContentReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.FixedTextElement;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.parser.text.TextContentReadHandler;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Creation-Date: 01.10.2006, 18:48:11
+ *
+ * @author Thomas Morgner
+ */
+public class FixedContentReadHandler extends ElementReadHandler
+{
+ private FixedTextElement element;
+
+ public FixedContentReadHandler()
+ {
+ element = new FixedTextElement();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.TEXT_NS.equals(uri))
+ {
+ // expect a paragraph (which will be ignored; it is a structural
+ // component that needs not to be printed at all.
+ if ("p".equals(tagName))
+ {
+
+ return new TextContentReadHandler(element.getContent());
+ }
+ }
+
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ // expect a report control. The control will modifiy the current
+ // element (as we do not separate the elements that strictly ..)
+ if ("report-control".equals(tagName))
+ {
+ return new IgnoreAnyChildReadHandler();
+ }
+ if ("report-element".equals(tagName))
+ {
+ return new ReportElementReadHandler(element);
+ }
+ }
+ return null;
+ }
+
+
+ public Element getElement()
+ {
+ return element;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java
new file mode 100644
index 000000000000..a81b037bb656
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormatConditionReadHandler.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormatConditionReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.FormatCondition;
+import com.sun.star.report.pentaho.model.ReportElement;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.jfree.xmlns.parser.ParseException;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * I'm quite sure I should parse something here. But what?
+ *
+ * @author Ocke Janssen
+ */
+public class FormatConditionReadHandler extends AbstractXmlReadHandler
+{
+ private ReportElement element;
+
+ public FormatConditionReadHandler(final ReportElement element)
+ {
+ if (element == null)
+ {
+ throw new NullPointerException();
+ }
+ this.element = element;
+ }
+
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+ final String enabledText = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "enabled");
+ final boolean enabled = (enabledText == null || "true".equals(enabledText));
+
+ final String formula =
+ attrs.getValue(OfficeNamespaces.OOREPORT_NS, "formula");
+ if (formula == null)
+ {
+ throw new ParseException
+ ("Required attribute 'formula' is missing.", getLocator());
+ }
+ final String stylename =
+ attrs.getValue(OfficeNamespaces.OOREPORT_NS, "style-name");
+ if (stylename == null)
+ {
+ throw new ParseException
+ ("Required attribute 'style-name' is missing.", getLocator());
+ }
+ final FormulaExpression valueExpression = new FormulaExpression();
+ valueExpression.setFormula(formula);
+
+ final FormatCondition formatCondition =
+ new FormatCondition(valueExpression, stylename, enabled);
+ element.addFormatCondition(formatCondition);
+
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return element;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java
new file mode 100644
index 000000000000..4f8107cb2227
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormattedTextReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.FormattedTextElement;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Creation-Date: 01.10.2006, 19:06:45
+ *
+ * @author Thomas Morgner
+ */
+public class FormattedTextReadHandler extends ElementReadHandler
+{
+ private FormattedTextElement element;
+
+ public FormattedTextReadHandler()
+ {
+ element = new FormattedTextElement();
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+
+ String formula = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "formula");
+ if (formula != null)
+ {
+ final FormulaExpression valueExpression = new FormulaExpression();
+ valueExpression.setFormula(formula);
+ element.setValueExpression(valueExpression);
+ }
+
+ // * Print-Repeated-Values
+ // * Print-In-First-New-Section
+ // * Print-When-Group-Changes
+
+ // * Print-When-Section-Overflows
+ // That property cannot be evaluated yet, as this would require us to
+ // have a clue about pagebreaking. We dont have that - not yet and never
+ // in the future, as pagebreaks are computed by OpenOffice instead
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ // expect a report control. The control will modifiy the current
+ // element (as we do not separate the elements that strictly ..)
+ if ("report-control".equals(tagName))
+ {
+ return new IgnoreAnyChildReadHandler();
+ }
+ if ("report-element".equals(tagName))
+ {
+ return new ReportElementReadHandler(element);
+ }
+ }
+ return null;
+ }
+
+
+ public Element getElement()
+ {
+ return element;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java
new file mode 100644
index 000000000000..8312952b5a23
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/FunctionReadHandler.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FunctionReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.jfree.xmlns.parser.ParseException;
+import org.jfree.report.expressions.Expression;
+import org.jfree.report.expressions.FormulaFunction;
+import org.jfree.report.expressions.FormulaExpression;
+import org.xml.sax.SAXException;
+import org.xml.sax.Attributes;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Parses a named expression. These expressions are encountered on reports and
+ * groups and compute global values. Expressions must have an unique name.
+ *
+ * @author Thomas Morgner
+ */
+public class FunctionReadHandler extends AbstractXmlReadHandler
+{
+ private Expression expression;
+
+ public FunctionReadHandler()
+ {
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
+ {
+ final String formula = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "formula");
+ if (formula == null)
+ {
+ throw new ParseException
+ ("Required attribute 'formula' is missing", getLocator());
+ }
+ final String initialFormula = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "initial-formula");
+ final String name = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "name");
+ if (name == null)
+ {
+ throw new ParseException
+ ("Required attribute 'name' is missing", getLocator());
+ }
+ final String preEvaluated = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "pre-evaluated");
+ final String deepTraversing = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "deep-traversing");
+
+ if (initialFormula != null)
+ {
+ final FormulaFunction function = new FormulaFunction();
+ function.setInitial(initialFormula);
+ function.setFormula(formula);
+ this.expression = function;
+ }
+ else
+ {
+ final FormulaExpression expression = new FormulaExpression();
+ expression.setFormula(formula);
+ this.expression = expression;
+ }
+
+ expression.setName(name);
+ expression.setDeepTraversing("true".equals(deepTraversing));
+ expression.setPrecompute("true".equals(preEvaluated));
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return getExpression();
+ }
+
+ public Expression getExpression()
+ {
+ return expression;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java
new file mode 100644
index 000000000000..23ff236ec798
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.model.OfficeGroup;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.structure.Group;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class GroupReadHandler extends ElementReadHandler
+{
+ private GroupSectionReadHandler groupHeader;
+ private GroupSectionReadHandler groupFooter;
+ private GroupReadHandler childGroup;
+ private RootTableReadHandler detailSection;
+ private Group group;
+ private ArrayList functionHandlers;
+
+ public GroupReadHandler()
+ {
+ group = new OfficeGroup();
+ functionHandlers = new ArrayList();
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+
+ final String groupExpr = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "group-expression");
+ if (groupExpr != null)
+ {
+ final FormulaExpression function = new FormulaExpression();
+ function.setFormula(groupExpr);
+ group.setGroupingExpression(function);
+ }
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (!OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ return null;
+ }
+ if ("function".equals(tagName))
+ {
+ final FunctionReadHandler erh = new FunctionReadHandler();
+ functionHandlers.add(erh);
+ return erh;
+ }
+ if ("group-header".equals(tagName))
+ {
+ groupHeader = new GroupSectionReadHandler();
+ return groupHeader;
+ }
+ if ("group".equals(tagName))
+ {
+ childGroup = new GroupReadHandler();
+ return childGroup;
+ }
+ if ("detail".equals(tagName))
+ {
+ detailSection = new DetailRootTableReadHandler();
+ return detailSection;
+ }
+ if ("group-footer".equals(tagName))
+ {
+ groupFooter = new GroupSectionReadHandler();
+ return groupFooter;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < functionHandlers.size(); i++)
+ {
+ final FunctionReadHandler handler =
+ (FunctionReadHandler) functionHandlers.get(i);
+ group.addExpression(handler.getExpression());
+ }
+
+ if (groupHeader != null)
+ {
+ group.addNode(groupHeader.getElement());
+ }
+
+ final Section groupBody = new Section();
+ groupBody.setNamespace(OfficeNamespaces.INTERNAL_NS);
+ groupBody.setType("group-body");
+ group.addNode(groupBody);
+ // XOR: Either the detail or the group section can be set ..
+ if (detailSection != null)
+ {
+ groupBody.addNode(detailSection.getElement());
+ }
+ else if (childGroup != null)
+ {
+ groupBody.addNode(childGroup.getElement());
+ }
+
+ if (groupFooter != null)
+ {
+ group.addNode(groupFooter.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return group;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java
new file mode 100644
index 000000000000..64b8afb0a910
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/GroupSectionReadHandler.java
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupSectionReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.OfficeGroupSection;
+
+public class GroupSectionReadHandler extends RootTableReadHandler
+{
+ public GroupSectionReadHandler ()
+ {
+ super(new OfficeGroupSection());
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java
new file mode 100644
index 000000000000..1668f911dc14
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ImageReadHandler.java
@@ -0,0 +1,151 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.ImageElement;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.xlink.XLinkReadHandler;
+import org.jfree.report.expressions.FormulaExpression;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Deals with Image-content. There are two ways to specify the image;
+ * as formula or as static image data.
+ *
+ * @author Thomas Morgner
+ */
+public class ImageReadHandler extends ElementReadHandler
+{
+ private ImageElement contentElement;
+ private XLinkReadHandler xLinkReadHandler;
+
+ public ImageReadHandler()
+ {
+ contentElement = new ImageElement();
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+ final String formula = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "formula");
+ if (formula != null && formula.length() != 0)
+ {
+ // now, the evaulated content ends up in the 'content' attribute of the
+ // element.
+ final FormulaExpression valueExpression = new FormulaExpression();
+ valueExpression.setFormula(formula);
+ contentElement.setFormula(valueExpression);
+ }
+
+ contentElement.setNamespace(OfficeNamespaces.FORM_NS);
+ contentElement.setType("image");
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.DRAWING_NS.equals(uri))
+ {
+ if ("image-data".equals(tagName))
+ {
+ xLinkReadHandler = new XLinkReadHandler();
+ return xLinkReadHandler;
+ }
+ }
+
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ // expect a report control. The control will modifiy the current
+ // element (as we do not separate the elements that strictly ..)
+ if ("report-control".equals(tagName))
+ {
+ return new IgnoreAnyChildReadHandler();
+ }
+ if ("report-element".equals(tagName))
+ {
+ return new ReportElementReadHandler(contentElement);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ // if we have static content (as well or only), that one goes into the
+ // alternate-content attribute right now. It is part of the output target
+ // and style rules to deal with them properly ..
+ if (xLinkReadHandler != null)
+ {
+ contentElement.setAttribute(OfficeNamespaces.OOREPORT_NS,
+ "alternate-content", xLinkReadHandler.getUri());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return contentElement;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java
new file mode 100644
index 000000000000..61d893fa5d42
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportElementReadHandler.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportElementReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.model.ReportElement;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class ReportElementReadHandler extends ElementReadHandler
+{
+ private ReportElement element;
+
+ public ReportElementReadHandler(final ReportElement element)
+ {
+ if (element == null)
+ {
+ throw new NullPointerException();
+ }
+
+ this.element = element;
+ }
+
+ public Element getElement()
+ {
+ return element;
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
+ {
+ super.startParsing(attrs);
+ final String printWhenGroupChanges = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "print-when-group-changes");
+ element.setPrintWhenGroupChanges("true".equals(printWhenGroupChanges));
+ final String printRepeatingValues = attrs.getValue
+ (OfficeNamespaces.OOREPORT_NS, "print-repeated-values");
+ element.setPrintRepeatedValues
+ (printRepeatingValues == null || "true".equals(printRepeatingValues));
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (!OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ return null;
+ }
+ if ("conditional-print-expression".equals(tagName))
+ {
+ return new ConditionalPrintExpressionReadHandler(element);
+ }
+ if ("format-condition".equals(tagName))
+ {
+ return new FormatConditionReadHandler(element);
+ }
+ if ("report-component".equals(tagName))
+ {
+ return new IgnoreAnyChildReadHandler();
+ }
+ return null;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java
new file mode 100644
index 000000000000..b1692f7bae79
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeReport;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.JFreeReportInfo;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class ReportReadHandler extends ElementReadHandler
+{
+ private RootTableReadHandler pageHeader;
+ private RootTableReadHandler pageFooter;
+ private RootTableReadHandler reportHeader;
+ private RootTableReadHandler reportFooter;
+ private RootTableReadHandler detail;
+ private GroupReadHandler groups;
+ private OfficeReport rootSection;
+ private ArrayList functionHandlers;
+
+ public ReportReadHandler()
+ {
+ rootSection = new OfficeReport();
+ rootSection.setAttribute(OfficeNamespaces.INTERNAL_NS, "simple-report-structure", Boolean.TRUE);
+ functionHandlers = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri) == false)
+ {
+ return null;
+ }
+ if ("function".equals(tagName))
+ {
+ final FunctionReadHandler erh = new FunctionReadHandler();
+ functionHandlers.add(erh);
+ return erh;
+ }
+ if ("page-header".equals(tagName))
+ {
+ pageHeader = new RootTableReadHandler();
+ return pageHeader;
+ }
+ if ("report-header".equals(tagName))
+ {
+ reportHeader = new RootTableReadHandler();
+ return reportHeader;
+ }
+ if ("report-footer".equals(tagName))
+ {
+ reportFooter = new RootTableReadHandler();
+ return reportFooter;
+ }
+ if ("page-footer".equals(tagName))
+ {
+ pageFooter = new RootTableReadHandler();
+ return pageFooter;
+ }
+ if ("detail".equals(tagName))
+ {
+ detail = new DetailRootTableReadHandler();
+ return detail;
+ }
+ if ("group".equals(tagName))
+ {
+ groups = new GroupReadHandler();
+ return groups;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ if (pageHeader != null)
+ {
+ rootSection.setPageHeader(pageHeader.getElement());
+ }
+ if (pageFooter != null)
+ {
+ rootSection.setPageFooter(pageFooter.getElement());
+ }
+ if (reportHeader != null)
+ {
+ rootSection.setReportHeader(reportHeader.getElement());
+ }
+
+ final Section groupBody = new Section();
+ groupBody.setNamespace(OfficeNamespaces.INTERNAL_NS);
+ groupBody.setType("report-body");
+ rootSection.setBodySection(groupBody);
+
+ // XOR: Either the detail or the group section can be set ..
+ if (groups != null)
+ {
+ groupBody.addNode(groups.getElement());
+ }
+ else if (detail != null)
+ {
+ groupBody.addNode(detail.getElement());
+ }
+
+ if (reportFooter != null)
+ {
+ rootSection.setReportFooter(reportFooter.getElement());
+ }
+
+ for (int i = 0; i < functionHandlers.size(); i++)
+ {
+ final FunctionReadHandler handler =
+ (FunctionReadHandler) functionHandlers.get(i);
+ rootSection.addExpression(handler.getExpression());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return rootSection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java
new file mode 100644
index 000000000000..ac4a00041261
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/rpt/RootTableReadHandler.java
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RootTableReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.rpt;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.table.TableReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+public class RootTableReadHandler extends ElementReadHandler
+{
+ private TableReadHandler sectionTableReadHandler;
+ private Section section;
+
+ public RootTableReadHandler()
+ {
+ section = new Section();
+ }
+
+ protected RootTableReadHandler(final Section section)
+ {
+ if (section == null)
+ {
+ throw new NullPointerException();
+ }
+ this.section = section;
+ }
+
+
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.TABLE_NS.equals(uri))
+ {
+ if ("table".equals(tagName))
+ {
+ sectionTableReadHandler = new TableReadHandler();
+ return sectionTableReadHandler;
+ }
+ }
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ if ("conditional-print-expression".equals(tagName))
+ {
+ return new ConditionalPrintExpressionReadHandler(section);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ if (sectionTableReadHandler != null)
+ {
+ section.addNode(sectionTableReadHandler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return section;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties b/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties
new file mode 100644
index 000000000000..03465ac0ebd4
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties
@@ -0,0 +1,119 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: selectors.properties,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:08 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+# <style:style style:name="S1" style:family="graphics">
+# <style:section-properties fo:background-color="#ffffff"/>
+# </style:style>
+#
+# gets translated into:
+#
+# *[draw|style-name~="S1"]
+
+namespaces.draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0
+namespaces.fo=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0
+namespaces.style=urn:oasis:names:tc:opendocument:xmlns:style:1.0
+namespaces.table=urn:oasis:names:tc:opendocument:xmlns:table:1.0
+namespaces.rpt=http://openoffice.org/2005/report
+
+#
+# maps the style family type (graphics) into a style rule of the
+# common form: *[<namespace>|<style-name>~="<classname>"]
+#
+style-family.graphic=draw
+style-family.graphics=draw
+style-family.control=control
+style-family.report-element=rpt
+style-family.table-column=table
+style-family.table-row=table
+style-family.table-cell=table
+style-family.table=table
+
+# Builds the selector pattern for a star-office stylesheet
+#
+# 0: Namespace prefix
+# 1: Style-class attribute name (from the global namespace definition)
+# 2: Style-class value
+style-selector.pattern=*[{0}|{1}~="{2}"]
+
+#
+# The following properties map the OpenOffice-generic font names
+# into their CSS counterparts. As I dont have a clue, whats the difference
+# between modern and swiss typeface, I am ignorant for now and ignore
+# them. Blame me for that :)
+font-family.roman=serif
+font-family.swiss=sans-serif
+font-family.modern=sans-serif
+font-family.decorative=fantasy
+font-family.script=cursive
+font-family.system=monospace
+
+
+#
+# Defines the style property mapping for the resolve process from the
+# OpenOffice report format into the internal LibLayout format
+#
+# attr.style.<group>.<namespace>.<attr-name>=<class>
+#
+# Group is an selector, which corresponds to one of the sub-elements of
+# the style element of the OpenDocument format. (It must match the element
+# name for which the attributes are defined.)
+#
+# Namespace is a defined namespace prefix from this file as defined in the
+# namespaces.<prefix> section above
+#
+# AttrName is the defined attribute name for this namespace as defined by the
+# opendocument standard.
+attr.style.graphic-properties.draw.textarea-vertical-align=com.sun.star.report.pentaho.parser.stylemapper.draw.TextAreaVerticalAlignMapper
+attr.style.section-properties.fo.background-color=com.sun.star.report.pentaho.parser.stylemapper.fo.BackgroundColorMapper
+attr.style.paragraph-properties.fo.text-align=com.sun.star.report.pentaho.parser.stylemapper.fo.TextAlignMapper
+attr.style.paragraph-properties.style.vertical-align=com.sun.star.report.pentaho.parser.stylemapper.style.VerticalAlignMapper
+attr.style.text-properties.fo.color=com.sun.star.report.pentaho.parser.stylemapper.fo.ColorMapper
+attr.style.text-properties.style.font-name=com.sun.star.report.pentaho.parser.stylemapper.style.FontNameMapper
+attr.style.text-properties.fo.font-family=com.sun.star.report.pentaho.parser.stylemapper.style.FontFamilyMapper
+attr.style.table-properties.fo.background-color=com.sun.star.report.pentaho.parser.stylemapper.fo.BackgroundColorMapper
+#attr.style.text-properties.style.font-style-name=
+attr.style.text-properties.style.font-family-generic=com.sun.star.report.pentaho.parser.stylemapper.style.FontFamilyGenericMapper
+attr.style.text-properties.style.font-pitch=com.sun.star.report.pentaho.parser.stylemapper.style.FontPitchMapper
+attr.style.text-properties.fo.font-size=com.sun.star.report.pentaho.parser.stylemapper.fo.FontSizeMapper
+attr.style.text-properties.fo.font-style=com.sun.star.report.pentaho.parser.stylemapper.fo.FontStyleMapper
+attr.style.text-properties.style.text-underline-style=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineStyleMapper
+attr.style.text-properties.style.text-underline-width=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineWidthMapper
+attr.style.text-properties.style.text-underline-color=com.sun.star.report.pentaho.parser.stylemapper.style.TextUnderlineColorMapper
+attr.style.text-properties.fo.font-weight=com.sun.star.report.pentaho.parser.stylemapper.fo.FontWeightMapper
+attr.style.text-properties.style.text-emphasize=com.sun.star.report.pentaho.parser.stylemapper.style.TextEmphasizeMapper
+attr.style.text-properties.style.font-relief=com.sun.star.report.pentaho.parser.stylemapper.style.FontReliefMapper
+attr.style.table-column-properties.table.column-width=com.sun.star.report.pentaho.parser.stylemapper.table.ColumnWidthMapper
+attr.style.table-row-properties.table.row-height=com.sun.star.report.pentaho.parser.stylemapper.table.RowHeightMapper
+attr.style.table-cell-properties.fo.border-right=com.sun.star.report.pentaho.parser.stylemapper.fo.BorderRightMapper
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt b/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt
new file mode 100644
index 000000000000..6b1ede5d98cf
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style-mapping.txt
@@ -0,0 +1,8 @@
+ <style:style style:name="S1" style:family="graphics">
+ <style:section-properties fo:background-color="#ffffff"/>
+ </style:style>
+
+gets translated into:
+
+*[draw|style-name~="S1"]
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java
new file mode 100644
index 000000000000..a707306a34a1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFaceReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.model.FontFaceElement;
+import org.jfree.report.structure.Element;
+
+/**
+ * Reads a single font-face declaration. This is equal to the @font rule of
+ * the CSS standard. We do not interpret the attributes of the element in
+ * any way yet.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class FontFaceReadHandler extends ElementReadHandler
+{
+ private FontFaceElement fontFaceElement;
+
+ public FontFaceReadHandler()
+ {
+ this.fontFaceElement = new FontFaceElement();
+ }
+
+ public Element getElement()
+ {
+ return fontFaceElement;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java
new file mode 100644
index 000000000000..fa85bc238fda
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: MasterPageReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.model.OfficeMasterPage;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class MasterPageReadHandler extends ElementReadHandler
+{
+ private OfficeMasterPage masterPage;
+ private ArrayList otherHandlers;
+
+ public MasterPageReadHandler()
+ {
+ masterPage = new OfficeMasterPage();
+ this.otherHandlers = new ArrayList();
+ }
+
+ public OfficeMasterPage getMasterPage()
+ {
+ return masterPage;
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ final StyleDefinitionReadHandler readHandler =
+ new StyleDefinitionReadHandler();
+ otherHandlers.add(readHandler);
+ return readHandler;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ for (int i = 0; i < otherHandlers.size(); i++)
+ {
+ final ElementReadHandler handler =
+ (ElementReadHandler) otherHandlers.get(i);
+ masterPage.addNode(handler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return masterPage;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java
new file mode 100644
index 000000000000..1e523f7cd975
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStyleReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.OfficeParserUtil;
+import com.sun.star.report.pentaho.model.OfficeStyle;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * This class reads a single style rule. The resulting 'office-style' element
+ * is added to an 'office-styles' set.
+ */
+public class OfficeStyleReadHandler extends ElementReadHandler
+{
+ private OfficeStyle officeStyle;
+ private ArrayList childs;
+
+ public OfficeStyleReadHandler()
+ {
+ this.officeStyle = new OfficeStyle();
+ this.childs = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild (final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+// if (OfficeParserUtil.getInstance().isValidStyleElement(uri, tagName))
+// {
+// }
+ final StyleDefinitionReadHandler readHandler =
+ new StyleDefinitionReadHandler();
+ childs.add(readHandler);
+ return readHandler;
+ }
+
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < childs.size(); i++)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) childs.get(i);
+ officeStyle.addNode(handler.getElement());
+ }
+ }
+
+ public OfficeStyle getOfficeStyle()
+ {
+ return officeStyle;
+ }
+
+ public Element getElement()
+ {
+ return officeStyle;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java
new file mode 100644
index 000000000000..8c335bec26a6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OfficeStylesReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import java.util.ArrayList;
+import org.jfree.report.modules.factories.report.flow.SectionReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeStyles;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.data.DataStyleReadHandler;
+
+public class OfficeStylesReadHandler extends ElementReadHandler
+{
+ private ArrayList textStyleChilds;
+ private ArrayList dataStyleChilds;
+ private ArrayList otherStyleChilds;
+ private ArrayList pageLayoutChilds;
+ private OfficeStyles officeStyles;
+
+ public OfficeStylesReadHandler(final OfficeStyles officeStyles)
+ {
+ this.officeStyles = officeStyles;
+ this.pageLayoutChilds = new ArrayList();
+ this.dataStyleChilds = new ArrayList();
+ this.textStyleChilds = new ArrayList();
+ this.otherStyleChilds = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild (final String uri, final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.STYLE_NS.equals(uri))
+ {
+ if ("style".equals(tagName))
+ {
+ final OfficeStyleReadHandler xrh = new OfficeStyleReadHandler();
+ textStyleChilds.add(xrh);
+ return xrh;
+ }
+ else if ("page-layout".equals(tagName))
+ {
+ final PageLayoutReadHandler prh = new PageLayoutReadHandler();
+ pageLayoutChilds.add(prh);
+ return prh;
+ }
+ }
+ else if (OfficeNamespaces.DATASTYLE_NS.equals(uri))
+ {
+ final DataStyleReadHandler xrh = new DataStyleReadHandler(false);
+ dataStyleChilds.add(xrh);
+ return xrh;
+ }
+
+ final SectionReadHandler genericReadHander = new SectionReadHandler();
+ otherStyleChilds.add(genericReadHander);
+ return genericReadHander;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < textStyleChilds.size(); i++)
+ {
+ final OfficeStyleReadHandler handler =
+ (OfficeStyleReadHandler) textStyleChilds.get(i);
+ officeStyles.addStyle(handler.getOfficeStyle());
+ }
+
+ for (int i = 0; i < pageLayoutChilds.size(); i++)
+ {
+ final PageLayoutReadHandler handler =
+ (PageLayoutReadHandler) pageLayoutChilds.get(i);
+ officeStyles.addPageStyle(handler.getPageLayout());
+ }
+
+ for (int i = 0; i < dataStyleChilds.size(); i++)
+ {
+ final DataStyleReadHandler handler =
+ (DataStyleReadHandler) dataStyleChilds.get(i);
+ officeStyles.addDataStyle(handler.getDataStyle());
+ }
+
+ for (int i = 0; i < otherStyleChilds.size(); i++)
+ {
+ final SectionReadHandler handler =
+ (SectionReadHandler) otherStyleChilds.get(i);
+ officeStyles.addOtherNode((Element) handler.getNode());
+ }
+ }
+
+ public Element getElement()
+ {
+ return officeStyles;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java
new file mode 100644
index 000000000000..84dbd908b717
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageLayoutReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:09 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.model.PageLayout;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Reads a page-layout element.
+ *
+ * @author Thomas Morgner
+ * @since 13.03.2007
+ */
+public class PageLayoutReadHandler extends ElementReadHandler
+{
+ private PageLayout pageLayout;
+ private ArrayList childs;
+
+ public PageLayoutReadHandler()
+ {
+ this.pageLayout = new PageLayout();
+ this.childs = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild (final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ final StyleDefinitionReadHandler readHandler =
+ new StyleDefinitionReadHandler();
+ childs.add(readHandler);
+ return readHandler;
+ }
+
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < childs.size(); i++)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) childs.get(i);
+ pageLayout.addNode(handler.getElement());
+ }
+ }
+
+ public PageLayout getPageLayout()
+ {
+ return pageLayout;
+ }
+
+ public Element getElement()
+ {
+ return pageLayout;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java
new file mode 100644
index 000000000000..cf5d6bc6ebf2
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleDefinitionReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.style;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Reads all childs of a style-definition. This simply copies everything that
+ * is contained in the source-file into a generic structure that can be
+ * written out later.
+ */
+public class StyleDefinitionReadHandler extends ElementReadHandler
+{
+ private Section rawSection;
+ private ArrayList childs;
+
+ public StyleDefinitionReadHandler()
+ {
+ this.rawSection = new Section();
+ this.childs = new ArrayList();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ final StyleDefinitionReadHandler readHandler =
+ new StyleDefinitionReadHandler();
+ childs.add(readHandler);
+ return readHandler;
+ }
+
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ for (int i = 0; i < childs.size(); i++)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) childs.get(i);
+ rawSection.addNode(handler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return rawSection;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java
new file mode 100644
index 000000000000..64d328fb996f
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: OneOfConstantsMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper;
+
+import java.util.HashMap;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.StyleKey;
+import org.jfree.layouting.input.style.values.CSSValue;
+
+public abstract class OneOfConstantsMapper implements StyleMapper
+{
+ private StyleKey styleKey;
+ private HashMap mappings;
+
+ protected OneOfConstantsMapper (StyleKey styleKey)
+ {
+ this.styleKey = styleKey;
+ this.mappings = new HashMap();
+ }
+
+ public void addMapping (String value, CSSValue target)
+ {
+ mappings.put(value, target);
+ }
+
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSValue value = lookupMapping(attrValue);
+ if (value != null)
+ {
+ targetRule.setPropertyValue(styleKey, value);
+ }
+ }
+
+ public StyleKey getStyleKey ()
+ {
+ return styleKey;
+ }
+
+ protected CSSValue lookupMapping (String attrValue)
+ {
+ return (CSSValue) mappings.get(attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java
new file mode 100644
index 000000000000..2c026242bb52
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextAreaVerticalAlignMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.draw;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.box.BoxStyleKeys;
+import org.jfree.layouting.input.style.values.CSSAutoValue;
+import org.jfree.layouting.input.style.values.CSSConstant;
+
+public class TextAreaVerticalAlignMapper extends OneOfConstantsMapper
+{
+ public TextAreaVerticalAlignMapper ()
+ {
+ super (BoxStyleKeys.BOX_VERTICAL_ALIGN);
+ addMapping("top", new CSSConstant("top"));
+ addMapping("bottom", new CSSConstant("bottom"));
+ addMapping("middle", new CSSConstant("middle"));
+ addMapping("justify", new CSSConstant("justify"));
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java
new file mode 100644
index 000000000000..64e05b0b68c5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: BackgroundColorMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.border.BorderStyleKeys;
+import org.jfree.layouting.input.style.values.CSSColorValue;
+import org.jfree.layouting.util.ColorUtil;
+
+public class BackgroundColorMapper implements StyleMapper
+{
+ public BackgroundColorMapper ()
+ {
+ }
+
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
+ if (cv != null)
+ {
+ targetRule.setPropertyValue(BorderStyleKeys.BACKGROUND_COLOR, cv);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java
new file mode 100644
index 000000000000..e8594c939dc6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: BorderRightMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+/*
+ * BorderRightMapper.java
+ *
+ * Created on 16. Februar 2007, 13:00
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+/**
+ *
+ * @author oj93728
+ */
+public class BorderRightMapper implements StyleMapper
+{
+
+ /** Creates a new instance of BorderRightMapper */
+ public BorderRightMapper()
+ {
+ }
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(attrName, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java
new file mode 100644
index 000000000000..64596d05306d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ColorMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.color.ColorStyleKeys;
+import org.jfree.layouting.input.style.values.CSSColorValue;
+import org.jfree.layouting.util.ColorUtil;
+
+public class ColorMapper implements StyleMapper
+{
+ public ColorMapper ()
+ {
+ }
+
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
+ if (cv != null)
+ {
+ targetRule.setPropertyValue(ColorStyleKeys.COLOR, cv);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java
new file mode 100644
index 000000000000..ceafc23a99b6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontSizeMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontSizeMapper implements StyleMapper
+{
+ public FontSizeMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(FontStyleKeys.FONT_SIZE, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java
new file mode 100644
index 000000000000..279256213a21
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontStyleMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontStyleMapper implements StyleMapper
+{
+ public FontStyleMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(FontStyleKeys.FONT_STYLE, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java
new file mode 100644
index 000000000000..2f5043deb4c5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontWeightMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontWeightMapper implements StyleMapper
+{
+ public FontWeightMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(FontStyleKeys.FONT_WEIGHT, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java
new file mode 100644
index 000000000000..02d8c4b9a6e0
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextAlignMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.fo;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.text.TextAlign;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+
+public class TextAlignMapper extends OneOfConstantsMapper
+{
+ public TextAlignMapper ()
+ {
+ super(TextStyleKeys.TEXT_ALIGN);
+ addMapping("start", TextAlign.START);
+ addMapping("end", TextAlign.END);
+ addMapping("left", TextAlign.LEFT);
+ addMapping("center", TextAlign.CENTER);
+ addMapping("right", TextAlign.RIGHT);
+ addMapping("justify", TextAlign.JUSTIFY);
+ }
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java
new file mode 100644
index 000000000000..c131fdc78eeb
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFamilyGenericMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+import org.jfree.layouting.input.style.values.CSSStringValue;
+import org.jfree.layouting.input.style.values.CSSStringType;
+import org.jfree.layouting.input.style.values.CSSValue;
+import org.jfree.layouting.input.style.values.CSSValueList;
+
+public class FontFamilyGenericMapper implements StyleMapper
+{
+ public FontFamilyGenericMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue);
+
+ final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY);
+ if (value instanceof CSSValueList == false)
+ {
+ targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY,
+ new CSSValueList(new CSSValue[]{ cssVal }));
+ }
+ else
+ {
+ CSSValueList list = (CSSValueList) value;
+ targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY,
+ CSSValueList.insertLast(list, value));
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java
new file mode 100644
index 000000000000..0f959b960863
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontFamilyMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.values.CSSStringValue;
+import org.jfree.layouting.input.style.values.CSSStringType;
+import org.jfree.layouting.input.style.values.CSSValue;
+import org.jfree.layouting.input.style.values.CSSValueList;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontFamilyMapper implements StyleMapper
+{
+ public FontFamilyMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue);
+
+ final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY);
+ if (value instanceof CSSValueList == false)
+ {
+ targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY,
+ new CSSValueList(new CSSValue[]{ cssVal }));
+ }
+ else
+ {
+ CSSValueList list = (CSSValueList) value;
+ targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY,
+ CSSValueList.insertFirst(list, value));
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java
new file mode 100644
index 000000000000..362908afdb5a
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontNameMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.values.CSSStringValue;
+import org.jfree.layouting.input.style.values.CSSStringType;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontNameMapper implements StyleMapper
+{
+ public FontNameMapper ()
+ {
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValue(FontStyleKeys.FONT_NAME,
+ new CSSStringValue(CSSStringType.STRING, attrValue));
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java
new file mode 100644
index 000000000000..7a98313a9697
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontPitchMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+import org.jfree.layouting.input.style.values.CSSConstant;
+
+public class FontPitchMapper extends OneOfConstantsMapper
+{
+ public FontPitchMapper ()
+ {
+ super (FontStyleKeys.FONT_PITCH);
+ addMapping("variable", new CSSConstant("variable"));
+ addMapping("fixed", new CSSConstant("fixed"));
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java
new file mode 100644
index 000000000000..8b6623ae5f54
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FontReliefMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.font.FontStyleKeys;
+
+public class FontReliefMapper implements StyleMapper
+{
+ public FontReliefMapper ()
+ {
+
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java
new file mode 100644
index 000000000000..714fe62e8dd8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextEmphasizeMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+
+public class TextEmphasizeMapper implements StyleMapper
+{
+ public TextEmphasizeMapper ()
+ {
+
+ }
+
+ public void updateStyle (String uri, String attrName, String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString("font-emphasize", attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java
new file mode 100644
index 000000000000..85c0e7d5f71b
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextUnderlineColorMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+import org.jfree.layouting.input.style.values.CSSColorValue;
+import org.jfree.layouting.util.ColorUtil;
+
+public class TextUnderlineColorMapper implements StyleMapper
+{
+ public TextUnderlineColorMapper ()
+ {
+ }
+
+ public void updateStyle (String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue);
+ if (cv != null)
+ {
+ targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv);
+ }
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java
new file mode 100644
index 000000000000..ded28f73eb8c
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextUnderlineStyleMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+import org.jfree.layouting.input.style.keys.text.TextDecorationStyle;
+
+public class TextUnderlineStyleMapper extends OneOfConstantsMapper
+{
+ public TextUnderlineStyleMapper ()
+ {
+ super(TextStyleKeys.TEXT_UNDERLINE_STYLE);
+ addMapping("none", TextDecorationStyle.NONE);
+ addMapping("solid", TextDecorationStyle.SOLID);
+ addMapping("dotted", TextDecorationStyle.DOTTED);
+ addMapping("dash", TextDecorationStyle.DASHED);
+ addMapping("long-dash", TextDecorationStyle.LONG_DASH);
+ addMapping("dot-dash", TextDecorationStyle.DOT_DASH);
+ addMapping("dot-dot-dash", TextDecorationStyle.DOT_DOT_DASH);
+ addMapping("wave", TextDecorationStyle.WAVE);
+ }
+
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java
new file mode 100644
index 000000000000..a6506fabec8a
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextUnderlineWidthMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.border.BorderWidth;
+import org.jfree.layouting.input.style.keys.text.TextDecorationWidth;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+import org.jfree.layouting.input.style.values.CSSAutoValue;
+import org.jfree.layouting.input.style.values.CSSValue;
+
+public class TextUnderlineWidthMapper extends OneOfConstantsMapper
+{
+ public TextUnderlineWidthMapper ()
+ {
+ super(TextStyleKeys.TEXT_UNDERLINE_WIDTH);
+ addMapping("auto", CSSAutoValue.getInstance());
+ addMapping("normal", BorderWidth.MEDIUM);
+ addMapping("bold", TextDecorationWidth.BOLD);
+ addMapping("thin", BorderWidth.THIN);
+ addMapping("dash", TextDecorationWidth.DASH);
+ addMapping("medium", BorderWidth.MEDIUM);
+ addMapping("thick", BorderWidth.THICK);
+ }
+
+ public void updateStyle (final String uri,
+ final String attrName,
+ final String attrValue,
+ final CSSDeclarationRule targetRule)
+ {
+ if (attrName == null) throw new NullPointerException();
+
+ final CSSValue value = lookupMapping(attrValue);
+ if (value != null)
+ {
+ targetRule.setPropertyValue(getStyleKey(), value);
+ return;
+ }
+
+ // percent
+ // positive integer
+ // positive length
+ targetRule.setPropertyValueAsString(getStyleKey(), attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java
new file mode 100644
index 000000000000..ccd87d775be5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextUnderlineWordMode.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.text.TextDecorationMode;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+
+public class TextUnderlineWordMode extends OneOfConstantsMapper
+{
+ public TextUnderlineWordMode ()
+ {
+ super(TextStyleKeys.TEXT_UNDERLINE_MODE);
+ addMapping("continuous", TextDecorationMode.CONTINUOUS);
+ addMapping("skip-white-space", TextDecorationMode.SKIP_WHITE_SPACE);
+ }
+
+
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java
new file mode 100644
index 000000000000..7735aa881de5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VerticalAlignMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.stylemapper.style;
+
+import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper;
+import org.jfree.layouting.input.style.keys.box.BoxStyleKeys;
+import org.jfree.layouting.input.style.keys.text.TextStyleKeys;
+import org.jfree.layouting.input.style.keys.line.LineStyleKeys;
+import org.jfree.layouting.input.style.values.CSSConstant;
+import org.jfree.layouting.input.style.values.CSSAutoValue;
+
+public class VerticalAlignMapper extends OneOfConstantsMapper
+{
+ public VerticalAlignMapper ()
+ {
+ super (LineStyleKeys.VERTICAL_ALIGN);
+ addMapping("top", new CSSConstant("top"));
+ addMapping("bottom", new CSSConstant("bottom"));
+ addMapping("middle", new CSSConstant("middle"));
+ addMapping("baseline", new CSSConstant("baseline"));
+ addMapping("auto", CSSAutoValue.getInstance());
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java
new file mode 100644
index 000000000000..40a0ec5373cd
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ColumnWidthMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.stylemapper.table;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.box.BoxStyleKeys;
+
+/**
+ * Creation-Date: 03.07.2006, 13:08:27
+ *
+ * @author Thomas Morgner
+ */
+public class ColumnWidthMapper implements StyleMapper
+{
+ public ColumnWidthMapper()
+ {
+ }
+
+ public void updateStyle(String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(BoxStyleKeys.WIDTH, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java
new file mode 100644
index 000000000000..62760c6c4258
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RowHeightMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.stylemapper.table;
+
+import com.sun.star.report.pentaho.parser.StyleMapper;
+import org.jfree.layouting.input.style.CSSDeclarationRule;
+import org.jfree.layouting.input.style.keys.box.BoxStyleKeys;
+
+/**
+ * Creation-Date: 03.07.2006, 13:08:27
+ *
+ * @author Thomas Morgner
+ */
+public class RowHeightMapper implements StyleMapper
+{
+ public RowHeightMapper()
+ {
+ }
+
+ public void updateStyle(String uri,
+ String attrName,
+ String attrValue,
+ CSSDeclarationRule targetRule)
+ {
+ targetRule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, attrValue);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java
new file mode 100644
index 000000000000..1c5ce6331e73
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/CoveredCellReadHandler.java
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: CoveredCellReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.table;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 14.03.2007
+ */
+public class CoveredCellReadHandler extends ElementReadHandler
+{
+ private Element coveredCell;
+
+ public CoveredCellReadHandler()
+ {
+ coveredCell = new Section();
+ }
+
+
+ public Element getElement()
+ {
+ return coveredCell;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java
new file mode 100644
index 000000000000..c09bccfee878
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableCellReadHandler.java
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableCellReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.table;
+
+import com.sun.star.report.pentaho.model.TableCellElement;
+import com.sun.star.report.pentaho.parser.text.TextContentReadHandler;
+
+/**
+ * A read handler for table-cell contents. This is basicly a text-content
+ * read handler; we may extend this implementation later.
+ *
+ * @author Thomas Morgner
+ * @since 05.03.2007
+ */
+public class TableCellReadHandler extends TextContentReadHandler
+{
+ public TableCellReadHandler()
+ {
+ super(new TableCellElement(), true);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java
new file mode 100644
index 000000000000..a7e77b41babb
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableColumnReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.table;
+
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Element;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+
+/**
+ * Creation-Date: 03.07.2006, 14:26:55
+ *
+ * @author Thomas Morgner
+ */
+public class TableColumnReadHandler extends ElementReadHandler
+{
+ private Section tableColumn;
+
+ public TableColumnReadHandler()
+ {
+ tableColumn = new Section();
+ }
+
+
+ public Element getElement()
+ {
+ return tableColumn;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java
new file mode 100644
index 000000000000..c5b0a12f3ebf
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableColumnsReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.table;
+
+import java.util.ArrayList;
+
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import com.sun.star.report.pentaho.parser.table.TableColumnReadHandler;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Creation-Date: 03.07.2006, 13:50:41
+ *
+ * @author Thomas Morgner
+ */
+public class TableColumnsReadHandler extends ElementReadHandler
+{
+ private ArrayList columns;
+ private Section tableColumns;
+
+ public TableColumnsReadHandler()
+ {
+ columns = new ArrayList();
+ tableColumns = new Section();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.TABLE_NS.equals(uri) == false)
+ {
+ return null;
+ }
+
+ if ("table-column".equals(tagName))
+ {
+ final TableColumnReadHandler readHandler = new TableColumnReadHandler();
+ columns.add(readHandler);
+ return readHandler;
+ }
+
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < columns.size(); i++)
+ {
+ final TableColumnReadHandler handler = (TableColumnReadHandler) columns.get(i);
+ tableColumns.addNode(handler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return tableColumns;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java
new file mode 100644
index 000000000000..21f5169ab767
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableReadHandler.java
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.table;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import com.sun.star.report.pentaho.model.OfficeTableSection;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.rpt.ConditionalPrintExpressionReadHandler;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Creation-Date: 03.07.2006, 13:47:47
+ *
+ * @author Thomas Morgner
+ */
+public class TableReadHandler extends ElementReadHandler
+{
+ private TableColumnsReadHandler columns;
+ private ArrayList tableRows;
+ private Section table;
+
+ public TableReadHandler()
+ {
+ tableRows = new ArrayList();
+ table = new OfficeTableSection();
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
+ {
+ super.startParsing(attrs);
+ final String enabled = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "visible");
+ if (enabled == null || "true".equals(enabled))
+ {
+ table.setEnabled(true);
+ }
+ else
+ {
+ table.setEnabled(false);
+ }
+
+ }
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ if ("conditional-print-expression".equals(tagName))
+ {
+ return new ConditionalPrintExpressionReadHandler(table);
+ }
+ return null;
+ }
+
+ if (OfficeNamespaces.TABLE_NS.equals(uri) == false)
+ {
+ return null;
+ }
+ if ("table-columns".equals(tagName))
+ {
+ columns = new TableColumnsReadHandler();
+ return columns;
+ }
+ if ("table-row".equals(tagName))
+ {
+ final TableRowReadHandler rowHandler = new TableRowReadHandler();
+ tableRows.add(rowHandler);
+ return rowHandler;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ if (columns != null)
+ {
+ table.addNode(columns.getElement());
+ }
+
+ for (int i = 0; i < tableRows.size(); i++)
+ {
+ final TableRowReadHandler handler = (TableRowReadHandler) tableRows.get(i);
+ table.addNode(handler.getElement());
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return table;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java
new file mode 100644
index 000000000000..fb3a1e0a8307
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/table/TableRowReadHandler.java
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TableRowReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.table;
+
+import java.util.ArrayList;
+
+import org.jfree.report.structure.Node;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.Element;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.jfree.xmlns.parser.IgnoreAnyChildReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import com.sun.star.report.pentaho.parser.text.TextContentReadHandler;
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+
+/**
+ * Creation-Date: 03.07.2006, 13:51:47
+ *
+ * @author Thomas Morgner
+ */
+public class TableRowReadHandler extends ElementReadHandler
+{
+ private ArrayList tableCells;
+ private Section tableRow;
+
+ public TableRowReadHandler()
+ {
+ tableCells = new ArrayList();
+ tableRow = new Section();
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.TABLE_NS.equals(uri) == false)
+ {
+ return null;
+ }
+
+ if ("table-cell".equals(tagName))
+ {
+ final TableCellReadHandler readHandler = new TableCellReadHandler();
+ tableCells.add(readHandler);
+ return readHandler;
+ }
+ if ("covered-table-cell".equals(tagName))
+ {
+
+ final CoveredCellReadHandler readHandler = new CoveredCellReadHandler();
+ tableCells.add(readHandler);
+ return readHandler;
+ }
+ return null;
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < tableCells.size(); i++)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) tableCells.get(i);
+ tableRow.addNode(handler.getElement());
+ }
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Element getElement()
+ {
+ return tableRow;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java
new file mode 100644
index 000000000000..8541f96c5d93
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/text/TextContentReadHandler.java
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: TextContentReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+package com.sun.star.report.pentaho.parser.text;
+
+import java.util.ArrayList;
+
+import com.sun.star.report.pentaho.parser.ElementReadHandler;
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.parser.rpt.FixedContentReadHandler;
+import com.sun.star.report.pentaho.parser.rpt.FormattedTextReadHandler;
+import com.sun.star.report.pentaho.parser.rpt.ImageReadHandler;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.report.structure.Element;
+import org.jfree.report.structure.Section;
+import org.jfree.report.structure.StaticText;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * This is a generic implementation that accepts all input and adds special
+ * handlers for the report-elements.
+ *
+ * @author Thomas Morgner
+ */
+public class TextContentReadHandler extends ElementReadHandler
+{
+ private Section section;
+ private ArrayList children;
+ private boolean copyType;
+
+ public TextContentReadHandler(final Section section,
+ final boolean copyType)
+ {
+ this.children = new ArrayList();
+ this.section = section;
+ this.copyType = copyType;
+ }
+
+ public TextContentReadHandler(final Section section)
+ {
+ this (section, false);
+ }
+
+ public TextContentReadHandler()
+ {
+ this(new Section(), true);
+ }
+
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ super.startParsing(attrs);
+ final Element element = getElement();
+ if (copyType)
+ {
+ copyElementType(element);
+ }
+ copyAttributes(attrs, element);
+ }
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (OfficeNamespaces.OOREPORT_NS.equals(uri))
+ {
+ if ("fixed-content".equals(tagName))
+ {
+ final FixedContentReadHandler fixedContentReadHandler = new FixedContentReadHandler();
+ children.add(fixedContentReadHandler);
+ return fixedContentReadHandler;
+ }
+ if ("formatted-text".equals(tagName))
+ {
+ final FormattedTextReadHandler formattedTextReadHandler = new FormattedTextReadHandler();
+ children.add(formattedTextReadHandler);
+ return formattedTextReadHandler;
+ }
+ if ("image".equals(tagName))
+ {
+ final ImageReadHandler imageReadHandler = new ImageReadHandler();
+ children.add(imageReadHandler);
+ return imageReadHandler;
+ }
+ if ("sub-document".equals(tagName))
+ {
+ return null;
+ }
+ }
+
+ final TextContentReadHandler readHandler = new TextContentReadHandler();
+ children.add(readHandler);
+ return readHandler;
+ }
+
+ /**
+ * This method is called to process the character data between element tags.
+ *
+ * @param ch the character buffer.
+ * @param start the start index.
+ * @param length the length.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ public void characters(final char[] ch, final int start, final int length)
+ throws SAXException
+ {
+ children.add(new StaticText(new String(ch, start, length)));
+ }
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing() throws SAXException
+ {
+ for (int i = 0; i < children.size(); i++)
+ {
+ final Object o = children.get(i);
+ if (o instanceof ElementReadHandler)
+ {
+ final ElementReadHandler handler = (ElementReadHandler) o;
+ section.addNode(handler.getElement());
+ }
+ else if (o instanceof StaticText)
+ {
+ section.addNode((StaticText) o);
+ }
+ }
+ }
+
+
+ public Element getElement()
+ {
+ return section;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java
new file mode 100644
index 000000000000..799a3d7972f8
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/parser/xlink/XLinkReadHandler.java
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XLinkReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.parser.xlink;
+
+import com.sun.star.report.pentaho.parser.StarXmlFactoryModule;
+import com.sun.star.report.pentaho.OfficeNamespaces;
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * An image reference.
+ *
+ * @author Thomas Morgner
+ */
+public class XLinkReadHandler extends AbstractXmlReadHandler
+{
+ private String uri;
+ private String type;
+ private String show;
+ private String actuate;
+
+ public XLinkReadHandler()
+ {
+ }
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs) throws SAXException
+ {
+ uri = attrs.getValue(OfficeNamespaces.XLINK_NS, "uri");
+ type = attrs.getValue(OfficeNamespaces.XLINK_NS, "type");
+ show = attrs.getValue(OfficeNamespaces.XLINK_NS, "show");
+ actuate = attrs.getValue(OfficeNamespaces.XLINK_NS, "actuate");
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject() throws SAXException
+ {
+ return uri;
+ }
+
+ public String getUri()
+ {
+ return uri;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public String getShow()
+ {
+ return show;
+ }
+
+ public String getActuate()
+ {
+ return actuate;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/smil.css b/reportdesign/java/com/sun/star/report/pentaho/smil.css
new file mode 100644
index 000000000000..b01076ff30ae
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/smil.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
+
+/**
+ * All default styles for formating-objects elements (if there are any).
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-office.css b/reportdesign/java/com/sun/star/report/pentaho/star-office.css
new file mode 100644
index 000000000000..da515eb88df9
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/star-office.css
@@ -0,0 +1,5 @@
+@namespace url("http://openoffice.org/2004/office");
+
+/**
+ * All default styles for office elements.
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-report.css b/reportdesign/java/com/sun/star/report/pentaho/star-report.css
new file mode 100644
index 000000000000..34e82f117a02
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/star-report.css
@@ -0,0 +1,73 @@
+@namespace table url("urn:oasis:names:tc:opendocument:xmlns:table:1.0");
+@namespace text url("urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+@namespace report url("http://openoffice.org/2005/report");
+
+table|table {
+ display: table;
+}
+
+table|table-columns {
+ display: table-column-group;
+}
+
+table|table-column {
+ display: table-column;
+}
+
+table|table-row {
+ display: table-row;
+}
+
+table|table-cell {
+ display: table-cell;
+}
+
+table|table-cell[number-cols-spanned],
+table|table-cell[number-cols-spanned],
+table|table-columns[number-cols-spanned],
+table|table-column[number-cols-spanned] {
+ -x-liblayout-colspan: attr("table|number-cols-spanned");
+}
+
+table|table-cell[number-rows-spanned],
+table|table-cell[number-rows-spanned] {
+ -x-liblayout-rowspan: attr("table|number-rows-spanned");
+}
+
+
+/**
+ * Style definitions for star report.
+ */
+* {
+ vertical-align: baseline;
+}
+
+/**
+ * A standard number format declaration. The number of decimal places
+ * and whether there is grouping is defined by the format string.
+ *
+ * The position and content of embedded text is also derived directly from
+ * the given format string text.
+
+ number
+ scientific
+ text
+ boolean
+ date
+ currency
+ percentage
+ fraction
+
+ */
+@format number myname {
+ -x-liblayout-decimal-replacement: "-";
+ -x-liblayout-display-factor: 1000;
+ content: "'Prefix'#,##0.00'postfix'";
+}
+
+@format scientific anothername {
+ /* to be filled */
+}
+
+
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css b/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css
new file mode 100644
index 000000000000..6da26872b28e
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/star-rpt.css
@@ -0,0 +1,5 @@
+@namespace url("http://openoffice.org/2005/report");
+
+/**
+ * All default styles for report elements.
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java b/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java
new file mode 100644
index 000000000000..d8c8e20ab902
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/LengthCalculator.java
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: LengthCalculator.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import org.jfree.layouting.input.style.values.CSSNumericType;
+import org.jfree.layouting.input.style.values.CSSNumericValue;
+import org.jfree.layouting.util.geom.StrictGeomUtility;
+import org.jfree.util.Log;
+
+/**
+ * A helper class that sums up various CSS-length. The various unit types are
+ * kept separate until the final result is computed to minimize the computation
+ * inaccuracy.
+ *
+ * @author Thomas Morgner
+ * @since 15.03.2007
+ */
+public class LengthCalculator
+{
+ // and centimeter (x10)
+ private double millimeter;
+
+ // and pica (x12) and inch(x72). Px is assumed to be in 96dpi.
+ private double point;
+
+ private double pixel;
+
+ public LengthCalculator()
+ {
+ }
+
+ public void add (final CSSNumericValue value)
+ {
+ if (value == null)
+ {
+ return;
+ }
+
+ final CSSNumericType numericType = value.getType();
+ if (numericType == CSSNumericType.CM)
+ {
+ millimeter += value.getValue() * 10;
+ }
+ else if (numericType == CSSNumericType.MM)
+ {
+ millimeter += value.getValue();
+ }
+ else if (numericType == CSSNumericType.PT)
+ {
+ point += value.getValue();
+ }
+ else if (numericType == CSSNumericType.PC)
+ {
+ point += 12 * value.getValue();
+ }
+ else if (numericType == CSSNumericType.INCH)
+ {
+ point += 72 * value.getValue();
+ }
+ else if (numericType == CSSNumericType.PX)
+ {
+ pixel += value.getValue();
+ }
+ // Log.debug ("Adding " + value + " [mm: " + millimeter + "] [pt: " + point + "] px: [" + pixel + "]");
+ }
+
+ public CSSNumericValue getResult ()
+ {
+ if (pixel == 0 && point == 0)
+ {
+ return CSSNumericValue.createValue(CSSNumericType.MM, millimeter);
+ }
+ if (pixel == 0 && millimeter == 0)
+ {
+ return CSSNumericValue.createValue(CSSNumericType.PT, point);
+ }
+ if (point == 0 && millimeter == 0)
+ {
+ return CSSNumericValue.createValue(CSSNumericType.PX, pixel);
+ }
+ // else convert it.
+
+ double result = point;
+ result += (millimeter * 10 * 72 / 254);
+ result += pixel * 72 / 96;
+
+ return CSSNumericValue.createValue(CSSNumericType.PT, result);
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java
new file mode 100644
index 000000000000..d986daea0fef
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapper.java
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMapper.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import java.util.HashMap;
+
+import org.jfree.resourceloader.Resource;
+import org.jfree.resourceloader.ResourceException;
+import org.jfree.resourceloader.ResourceManager;
+
+/**
+ * The style-mapper holds all information about the OpenOffice style mapping
+ * mechanism. OpenOffice references styles by their name and context, a style
+ * has a style-family assigned. The style family is determined by the element
+ * referencing the style, and there is no easily accessible information
+ * available on that.
+ * <p/>
+ * Therefore this mapper acts as gatekeeper for this information. The style
+ * mapping information is read from an external definition file and can be
+ * maintained externally.
+ *
+ * @author Thomas Morgner
+ * @since 11.03.2007
+ */
+public class StyleMapper
+{
+ private HashMap backend;
+
+ public StyleMapper()
+ {
+ this.backend = new HashMap();
+ }
+
+ public void addMapping(final StyleMappingRule rule)
+ {
+ backend.put(rule.getKey(), rule);
+ }
+
+ public boolean isListOfStyles(final String elementNamespace,
+ final String elementTagName,
+ final String attributeNamespace,
+ final String attributeName)
+ {
+ final StyleMapperKey key = new StyleMapperKey
+ (elementNamespace, elementTagName, attributeNamespace, attributeName);
+ final StyleMappingRule rule = (StyleMappingRule) backend.get(key);
+ if (rule == null)
+ {
+ return false;
+ }
+ return rule.isListOfValues();
+ }
+
+ public String getStyleFamilyFor(final String elementNamespace,
+ final String elementTagName,
+ final String attributeNamespace,
+ final String attributeName)
+ {
+ final StyleMapperKey key = new StyleMapperKey
+ (elementNamespace, elementTagName, attributeNamespace, attributeName);
+ final StyleMappingRule rule = (StyleMappingRule) backend.get(key);
+ if (rule == null)
+ {
+ return null;
+ }
+ return rule.getFamily();
+ }
+
+ public static StyleMapper loadInstance (final ResourceManager resourceManager)
+ throws ResourceException
+ {
+ final Resource resource = resourceManager.createDirectly
+ ("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class);
+ return (StyleMapper) resource.getResource();
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java
new file mode 100644
index 000000000000..be164b88e3bc
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMapperKey.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+/**
+ * A hash key for the stylemapper.
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public final class StyleMapperKey
+{
+ private String elementNamespace;
+ private String elementName;
+ private String attributeNamespace;
+ private String attributeName;
+ private int hashCode;
+
+ public StyleMapperKey(final String elementNamespace,
+ final String elementName,
+ final String attributeNamespace,
+ final String attributeName)
+ {
+ if (elementNamespace == null)
+ {
+ throw new NullPointerException();
+ }
+ if (elementName == null)
+ {
+ throw new NullPointerException();
+ }
+
+ this.elementNamespace = elementNamespace;
+ this.elementName = elementName;
+ this.attributeNamespace = attributeNamespace;
+ this.attributeName = attributeName;
+ this.hashCode = computeHashCode();
+ }
+
+ public String getElementNamespace()
+ {
+ return elementNamespace;
+ }
+
+ public String getElementName()
+ {
+ return elementName;
+ }
+
+ public String getAttributeNamespace()
+ {
+ return attributeNamespace;
+ }
+
+ public String getAttributeName()
+ {
+ return attributeName;
+ }
+
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final StyleMapperKey that = (StyleMapperKey) o;
+
+ if (attributeName != null ? !attributeName.equals(
+ that.attributeName) : that.attributeName != null)
+ {
+ return false;
+ }
+ if (attributeNamespace != null ? !attributeNamespace.equals(
+ that.attributeNamespace) : that.attributeNamespace != null)
+ {
+ return false;
+ }
+ if (!elementName.equals(that.elementName))
+ {
+ return false;
+ }
+ if (!elementNamespace.equals(that.elementNamespace))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private int computeHashCode()
+ {
+ int result;
+ result = elementNamespace.hashCode();
+ result = 31 * result + elementName.hashCode();
+ result = 31 * result + (attributeNamespace != null ? attributeNamespace.hashCode() : 0);
+ result = 31 * result + (attributeName != null ? attributeName.hashCode() : 0);
+ return result;
+ }
+
+ public int hashCode()
+ {
+ return hashCode;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java
new file mode 100644
index 000000000000..1e7dbc473c54
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMapperXmlFactoryModule.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import org.jfree.xmlns.parser.XmlDocumentInfo;
+import org.jfree.xmlns.parser.XmlFactoryModule;
+import org.jfree.xmlns.parser.XmlReadHandler;
+
+/**
+ * An XML-FactoryModule that load the style-mapper contents.
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public class StyleMapperXmlFactoryModule implements XmlFactoryModule
+{
+ public static final String NAMESPACE =
+ "http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper";
+
+ public StyleMapperXmlFactoryModule()
+ {
+ }
+
+ public XmlReadHandler createReadHandler(final XmlDocumentInfo documentInfo)
+ {
+ return new StyleMappingDocumentReadHandler();
+ }
+
+ public int getDocumentSupport(final XmlDocumentInfo documentInfo)
+ {
+ final String rootNamespace = documentInfo.getRootElementNameSpace();
+ if (StyleMapperXmlFactoryModule.NAMESPACE.equals(rootNamespace) == false)
+ {
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+
+ if ("style-mapper-definition".equals(documentInfo.getRootElement()))
+ {
+ return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE;
+ }
+ return XmlFactoryModule.NOT_RECOGNIZED;
+ }
+
+ public String getDefaultNamespace(final XmlDocumentInfo documentInfo)
+ {
+ return null;
+ }
+}
+
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java
new file mode 100644
index 000000000000..4e4b18cd08df
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMapperXmlResourceFactory.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import org.jfree.xmlns.parser.AbstractXmlResourceFactory;
+import org.jfree.util.Configuration;
+import org.jfree.report.JFreeReportBoot;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public class StyleMapperXmlResourceFactory extends AbstractXmlResourceFactory
+{
+ public StyleMapperXmlResourceFactory()
+ {
+ }
+
+ protected Configuration getConfiguration()
+ {
+ return JFreeReportBoot.getInstance().getGlobalConfig();
+ }
+
+ public Class getFactoryType()
+ {
+ return StyleMapper.class;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java
new file mode 100644
index 000000000000..89b4d9ce468d
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingDocumentReadHandler.java
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMappingDocumentReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import java.util.ArrayList;
+
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.jfree.xmlns.parser.XmlReadHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.Attributes;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public class StyleMappingDocumentReadHandler extends AbstractXmlReadHandler
+{
+ private StyleMapper styleMapper;
+ private ArrayList mappings;
+
+ public StyleMappingDocumentReadHandler()
+ {
+ this.mappings = new ArrayList();
+ this.styleMapper = new StyleMapper();
+ }
+
+
+ /**
+ * Returns the handler for a child element.
+ *
+ * @param tagName the tag name.
+ * @param atts the attributes.
+ * @return the handler or null, if the tagname is invalid.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected XmlReadHandler getHandlerForChild(final String uri,
+ final String tagName,
+ final Attributes atts)
+ throws SAXException
+ {
+ if (isSameNamespace(uri) == false)
+ {
+ return null;
+ }
+ if ("mapping".equals(tagName))
+ {
+ final StyleMappingReadHandler smr = new StyleMappingReadHandler();
+ mappings.add(smr);
+ return smr;
+ }
+ return null;
+ }
+
+
+ /**
+ * Done parsing.
+ *
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void doneParsing()
+ throws SAXException
+ {
+ for (int i = 0; i < mappings.size(); i++)
+ {
+ final StyleMappingReadHandler handler =
+ (StyleMappingReadHandler) mappings.get(i);
+ styleMapper.addMapping(handler.getRule());
+ }
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return styleMapper;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
new file mode 100644
index 000000000000..739915a709bd
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMappingReadHandler.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+import org.jfree.xmlns.parser.AbstractXmlReadHandler;
+import org.jfree.xmlns.parser.ParseException;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public class StyleMappingReadHandler extends AbstractXmlReadHandler
+{
+ private StyleMappingRule rule;
+
+ public StyleMappingReadHandler()
+ {
+ }
+
+
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
+ {
+ final String elementNamespace = attrs.getValue(getUri(),
+ "element-namespace");
+ if (elementNamespace == null)
+ {
+ throw new ParseException
+ ("Required attribute 'element-namespace' is missing", getLocator());
+ }
+
+ final String elementName = attrs.getValue(getUri(), "element-name");
+
+ if (elementName == null)
+ {
+ throw new ParseException
+ ("Required attribute 'element-name' is missing", getLocator());
+ }
+
+ final String attributeNamespace = attrs.getValue(getUri(),
+ "attribute-namespace");
+ final String attributeName = attrs.getValue(getUri(), "attribute-name");
+
+ final boolean listOfValues =
+ "styleNameRefs".equals(attrs.getValue(getUri(), "type"));
+
+ final String family = attrs.getValue(getUri(), "style-family");
+ final StyleMapperKey key = new StyleMapperKey
+ (elementNamespace, elementName, attributeNamespace, attributeName);
+ rule = new StyleMappingRule(key, family, listOfValues);
+ }
+
+
+ public StyleMappingRule getRule()
+ {
+ return rule;
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return rule;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java
new file mode 100644
index 000000000000..94b2458006c6
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StyleMappingRule.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.pentaho.styles;
+
+/**
+ * Todo: Document me!
+ *
+ * @author Thomas Morgner
+ * @since 12.03.2007
+ */
+public class StyleMappingRule
+{
+ private StyleMapperKey key;
+ private String family;
+ private boolean listOfValues;
+
+
+ public StyleMappingRule(final StyleMapperKey key, final String family,
+ final boolean listOfValues)
+ {
+ this.key = key;
+ this.family = family;
+ this.listOfValues = listOfValues;
+ }
+
+
+ public StyleMapperKey getKey()
+ {
+ return key;
+ }
+
+ public String getFamily()
+ {
+ return family;
+ }
+
+ public boolean isListOfValues()
+ {
+ return listOfValues;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml
new file mode 100644
index 000000000000..13e9d22996f5
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ OpenOffice.org - a multi-platform office productivity suite
+
+ $RCSfile: stylemapper.xml,v $
+
+ $Revision: 1.2 $
+
+ last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+
+ The Contents of this file are made available subject to
+ the terms of GNU Lesser General Public License Version 2.1.
+
+
+ GNU Lesser General Public License Version 2.1
+ =============================================
+ Copyright 2007 by Sun Microsystems, Inc.
+ 901 San Antonio Road, Palo Alto, CA 94303, USA
+ Copyright 2007 by Pentaho Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1, as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+ -->
+<style-mapper-definition
+ xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper">
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="p"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="p"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="class-names"
+ style-family="paragraph"
+ type="styleNameRefs"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="list"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="section"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="section"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="span"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="text"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="span"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="class-names"
+ style-family="text"
+ type="styleNameRefs"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="ruby"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="ruby"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ element-name="ruby-text"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+ attribute-name="style-name"
+ style-family="paragraph"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-column"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-column"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-row"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-row"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ element-name="table-cell"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+ attribute-name="style-name"
+ style-family="table-cell"
+ type="styleNameRef"/>
+ <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ element-name="custom-shape"
+ attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+ attribute-name="style-name"
+ style-family="graphic"
+ type="styleNameRef"/>
+</style-mapper-definition>
diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd
new file mode 100644
index 000000000000..d1597177e8db
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xsd
@@ -0,0 +1,98 @@
+<!--
+ OpenOffice.org - a multi-platform office productivity suite
+
+ $RCSfile: stylemapper.xsd,v $
+
+ $Revision: 1.2 $
+
+ last change: $Author: rt $ $Date: 2007-07-09 11:56:12 $
+
+ The Contents of this file are made available subject to
+ the terms of GNU Lesser General Public License Version 2.1.
+
+
+ GNU Lesser General Public License Version 2.1
+ =============================================
+ Copyright 2007 by Sun Microsystems, Inc.
+ 901 San Antonio Road, Palo Alto, CA 94303, USA
+ Copyright 2007 by Pentaho Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License version 2.1, as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ MA 02111-1307 USA
+ -->
+
+<xsd:schema version="0.9"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper"
+ targetNamespace="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper"
+ attributeFormDefault="unqualified">
+ <xsd:annotation>
+ <xsd:documentation>
+ This schema describes the format of the stylemapper definition file.
+ The stylemapper declares what style-families are referenced by an element.
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:simpleType name="styleNameRefType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="styleNameRef"/>
+ <xsd:enumeration value="styleNameRefs"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:simpleType name="styleFamilyType">
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="paragraph"/>
+ <xsd:enumeration value="text"/>
+ <xsd:enumeration value="section"/>
+ <xsd:enumeration value="table"/>
+ <xsd:enumeration value="table-column"/>
+ <xsd:enumeration value="table-row"/>
+ <xsd:enumeration value="table-cell"/>
+ <xsd:enumeration value="table-page"/>
+ <xsd:enumeration value="chart"/>
+ <xsd:enumeration value="default"/>
+ <xsd:enumeration value="drawing-page"/>
+ <xsd:enumeration value="graphic"/>
+ <xsd:enumeration value="presentation"/>
+ <xsd:enumeration value="control"/>
+ <xsd:enumeration value="ruby"/>
+ <xsd:enumeration value="custom-shape"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:element name="mapping">
+ <xsd:complexType>
+ <xsd:attribute name="element-namespace" use="required" type="xsd:anyURI"/>
+ <xsd:attribute name="element-name" use="required" type="xsd:NCName"/>
+ <xsd:attribute name="attribute-namespace" use="required" type="xsd:anyURI"/>
+ <xsd:attribute name="attribute-name" use="required" type="xsd:NCName"/>
+ <xsd:attribute name="type" use="required" type="styleNameRefType"/>
+ <xsd:attribute name="style-family" use="required" type="styleFamilyType"/>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="style-mapper-definition">
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:restriction base="xsd:anyType">
+ <xsd:sequence>
+ <xsd:element ref="mapping" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema> \ No newline at end of file
diff --git a/reportdesign/java/com/sun/star/report/pentaho/svg.css b/reportdesign/java/com/sun/star/report/pentaho/svg.css
new file mode 100644
index 000000000000..f715210c7c91
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/svg.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+
+/**
+ * All default styles for formating-objects elements (if there are any).
+ */
diff --git a/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css b/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css
new file mode 100644
index 000000000000..494ee66934e7
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/pentaho/xsl-fo.css
@@ -0,0 +1,5 @@
+@namespace url("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+
+/**
+ * All default styles for formating-objects elements (if there are any).
+ */
diff --git a/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java b/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java
new file mode 100644
index 000000000000..4f8c45582732
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/util/DefaultJobProperties.java
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultJobProperties.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.util;
+
+import java.util.HashMap;
+
+import com.sun.star.report.JobProperties;
+import com.sun.star.report.ReportEngineMetaData;
+import com.sun.star.report.JobDefinitionException;
+
+public class DefaultJobProperties implements JobProperties
+{
+ private ReportEngineMetaData metaData;
+ private HashMap properties;
+
+ public DefaultJobProperties (final ReportEngineMetaData metaData)
+ {
+ if (metaData == null)
+ {
+ throw new NullPointerException();
+ }
+ this.properties = new HashMap();
+ this.metaData = metaData;
+ }
+
+ public Object getProperty (final String key)
+ {
+ return properties.get(key);
+ }
+
+ public void setProperty (final String key, final Object value)
+ throws JobDefinitionException
+ {
+ final Class type = metaData.getParameterType(key);
+ if (type == null)
+ {
+ throw new JobDefinitionException("The parameter name is not known: " + key);
+ }
+ if (type.isInstance(value) == false)
+ {
+ throw new JobDefinitionException("The parameter value is not understood");
+ }
+
+ this.properties.put(key, value);
+ }
+
+ public JobProperties copy()
+ {
+ final DefaultJobProperties props = new DefaultJobProperties(metaData);
+ props.properties.putAll(properties);
+ return props;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java b/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java
new file mode 100644
index 000000000000..674a7ef636cc
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/util/DefaultParameterMap.java
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultParameterMap.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.util;
+
+import java.util.HashMap;
+
+import com.sun.star.report.ParameterMap;
+
+public class DefaultParameterMap implements ParameterMap
+{
+ private HashMap backend;
+
+ public DefaultParameterMap ()
+ {
+ backend = new HashMap();
+ }
+
+ public void clear ()
+ {
+ backend.clear();
+ }
+
+ /**
+ * Retrieves the value stored for a key in this properties collection.
+ *
+ * @param key the property key.
+ * @return The stored value, or <code>null</code> if the key does not exist in this
+ * collection.
+ */
+ public Object get (final String key)
+ {
+ if (key == null)
+ {
+ throw new NullPointerException
+ ("DefaultParameterMap.get (..): Parameter 'key' must not be null");
+ }
+ return backend.get(key);
+ }
+
+ /**
+ * Retrieves the value stored for a key in this properties collection, and returning the
+ * default value if the key was not stored in this properties collection.
+ *
+ * @param key the property key.
+ * @param defaultValue the default value to be returned when the key is not stored in
+ * this properties collection.
+ * @return The stored value, or the default value if the key does not exist in this
+ * collection.
+ */
+ public Object get (final String key, final Object defaultValue)
+ {
+ if (key == null)
+ {
+ throw new NullPointerException
+ ("DefaultParameterMap.get (..): Parameter 'key' must not be null");
+ }
+ final Object o = this.backend.get(key);
+ if (o == null)
+ {
+ return defaultValue;
+ }
+ return o;
+ }
+
+ public String[] keys ()
+ {
+ return (String[]) this.backend.keySet().toArray(new String[backend.size()]);
+ }
+
+ /**
+ * Adds a property to this properties collection. If a property with the given name
+ * exist, the property will be replaced with the new value. If the value is null, the
+ * property will be removed.
+ *
+ * @param key the property key.
+ * @param value the property value.
+ */
+ public void put (final String key, final Object value)
+ {
+ if (key == null)
+ {
+ throw new NullPointerException
+ ("ReportProperties.put (..): Parameter 'key' must not be null");
+ }
+ if (value == null)
+ {
+ this.backend.remove(key);
+ }
+ else
+ {
+ this.backend.put(key, value);
+ }
+ }
+
+ public int size ()
+ {
+ return this.backend.size();
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java b/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java
new file mode 100644
index 000000000000..f96621fcf1d1
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/util/DefaultReportJobDefinition.java
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultReportJobDefinition.java,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2007 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ * Copyright 2007 by Pentaho Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+package com.sun.star.report.util;
+
+import com.sun.star.report.DataSourceFactory;
+import com.sun.star.report.InputRepository;
+import com.sun.star.report.JobDefinitionException;
+import com.sun.star.report.JobProperties;
+import com.sun.star.report.OutputRepository;
+import com.sun.star.report.ParameterMap;
+import com.sun.star.report.ReportEngineMetaData;
+import com.sun.star.report.ReportEngineParameterNames;
+import com.sun.star.report.ReportJobDefinition;
+
+public class DefaultReportJobDefinition implements ReportJobDefinition
+{
+ public static final String OUTPUT_TYPE = "output-type";
+
+ private DefaultParameterMap parameters;
+ private DefaultJobProperties properties;
+
+ public DefaultReportJobDefinition (final ReportEngineMetaData metaData)
+ {
+ this.parameters = new DefaultParameterMap();
+ this.properties = new DefaultJobProperties(metaData);
+ }
+
+ public void setDataSourceFactory (final DataSourceFactory dataSourceFactory)
+ throws JobDefinitionException
+ {
+ this.properties.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory);
+ }
+
+ public DataSourceFactory getDataSourceFactory ()
+ {
+ return (DataSourceFactory) this.properties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY);
+ }
+
+ public InputRepository getInputRepository ()
+ {
+ return (InputRepository)
+ this.properties.getProperty(ReportEngineParameterNames.INPUT_REPOSITORY);
+ }
+
+ public void setInputRepository (final InputRepository inputRepository)
+ throws JobDefinitionException
+ {
+ this.properties.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, inputRepository);
+ }
+
+ public OutputRepository getOutputRepository ()
+ {
+ return (OutputRepository)
+ this.properties.getProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY);
+ }
+
+ public void setOutputRepository (final OutputRepository outputRepository)
+ throws JobDefinitionException
+ {
+ this.properties.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, outputRepository);
+ }
+
+ /**
+ * The parameters of the root report definition. The parameters for the subreports are
+ * defined using mappings, it would not make sense to define them here.
+ *
+ * @return a map container for query parameters.
+ */
+ public ParameterMap getQueryParameters ()
+ {
+ return parameters;
+ }
+
+ public void setReportDefinitionName (final String reportDefinitionName)
+ throws JobDefinitionException
+ {
+ this.properties.setProperty(ReportEngineParameterNames.INPUT_NAME, reportDefinitionName);
+ }
+
+ /**
+ * The name under which we can load the report definition.
+ *
+ * @return the report definition's name.
+ */
+ public String getReportDefinitionName ()
+ {
+ return (String) this.properties.getProperty(ReportEngineParameterNames.INPUT_NAME);
+ }
+
+ public JobProperties getProcessingParameters ()
+ {
+ return properties;
+ }
+}
diff --git a/reportdesign/java/com/sun/star/report/util/makefile.mk b/reportdesign/java/com/sun/star/report/util/makefile.mk
new file mode 100644
index 000000000000..fc75f93d8496
--- /dev/null
+++ b/reportdesign/java/com/sun/star/report/util/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ = ..$/..$/..$/..$/..$/..
+PRJNAME = reportdesign
+TARGET = $(PRJNAME)
+PACKAGE = com$/sun$/star$/report$/util
+
+# --- Settings -----------------------------------------------------
+.INCLUDE: settings.mk
+#----- compile .java files -----------------------------------------
+
+JARFILES = jcommon-1.0.8.jar
+JAVAFILES = DefaultJobProperties.java DefaultParameterMap.java DefaultReportJobDefinition.java FileRepository.java
+# --- Targets ------------------------------------------------------
+.INCLUDE : target.mk
diff --git a/reportdesign/java/jfreereport.properties b/reportdesign/java/jfreereport.properties
new file mode 100644
index 000000000000..9a42321126ee
--- /dev/null
+++ b/reportdesign/java/jfreereport.properties
@@ -0,0 +1,37 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: jfreereport.properties,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+org.jfree.report.modules.sun.report.Module=com.sun.star.report.pentaho.StarReportModule
+org.jfree.base.LogTarget=*none*
diff --git a/reportdesign/java/loader.properties b/reportdesign/java/loader.properties
new file mode 100644
index 000000000000..7b86abe522f0
--- /dev/null
+++ b/reportdesign/java/loader.properties
@@ -0,0 +1,38 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: loader.properties,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.model.OfficeDocument=com.sun.star.report.pentaho.parser.OfficeDocumentXmlResourceFactory
+org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.model.OfficeStylesCollection=com.sun.star.report.pentaho.parser.OfficeStylesXmlResourceFactory
+org.jfree.resourceloader.factory.type.com.sun.star.report.pentaho.styles.StyleMapper=com.sun.star.report.pentaho.styles.StyleMapperXmlResourceFactory
diff --git a/reportdesign/java/makefile.mk b/reportdesign/java/makefile.mk
new file mode 100644
index 000000000000..a11463a400e0
--- /dev/null
+++ b/reportdesign/java/makefile.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:03 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..
+PRJNAME=reportdesign
+TARGET = $(PRJNAME)
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+# ------------------------------------------------------------------
+
+COPYFILES = \
+ $(CLASSDIR)$/jfreereport.properties \
+ $(CLASSDIR)$/loader.properties
+
+.INCLUDE : target.mk
+# --- Targets ----------------------------------
+ALLTAR : $(COPYFILES)
+
+$(COPYFILES): $$(@:f)
+ +$(COPY) $< $@
diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst
new file mode 100644
index 000000000000..8c58745a087e
--- /dev/null
+++ b/reportdesign/prj/build.lst
@@ -0,0 +1,17 @@
+ba reportdesign : boost jfreereport comphelper dbaccess NULL
+ba reportdesign usr1 - all ba_mkout NULL
+ba reportdesign\inc nmake - all ba_inc NULL
+ba reportdesign\java nmake - all ba_java NULL
+ba reportdesign\java\com\sun\star\report nmake - all ba_jreport ba_java NULL
+ba reportdesign\java\com\sun\star\report\util nmake - all ba_jreport_util ba_jreport NULL
+ba reportdesign\java\com\sun\star\report\pentaho nmake - all ba_jreport_pe ba_jreport_util NULL
+ba reportdesign\source\core\api nmake - all ba_api ba_inc NULL
+ba reportdesign\source\core\resource nmake - all ba_res ba_inc NULL
+ba reportdesign\source\core\sdr nmake - all ba_sdr ba_inc NULL
+ba reportdesign\source\shared nmake - all ba_shared ba_inc NULL
+ba reportdesign\source\ui\misc nmake - all ba_uimisc ba_inc NULL
+ba reportdesign\source\ui\dlg nmake - all ba_uidlg ba_inc NULL
+ba reportdesign\source\ui\report nmake - all ba_uireport ba_inc NULL
+ba reportdesign\source\ui\inspection nmake - all ba_uiinspection ba_inc NULL
+ba reportdesign\source\filter\xml nmake - all ba_filter_xml ba_inc NULL
+ba reportdesign\util nmake - all ba_util ba_inc ba_jreport_pe ba_api ba_res ba_shared ba_uimisc ba_uidlg ba_uireport ba_uiinspection ba_sdr ba_filter_xml NULL
diff --git a/reportdesign/prj/d.lst b/reportdesign/prj/d.lst
new file mode 100644
index 000000000000..5a73db4d1fa9
--- /dev/null
+++ b/reportdesign/prj/d.lst
@@ -0,0 +1,29 @@
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\de-DE
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\en-GB
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\en-US
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\menubar
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\statusbar
+mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\toolbar
+
+..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
+
+dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
+
+# Libraries
+..\%__SRC%\bin\rpt*.dll %_DEST%\bin%_EXT%\rpt*.dll
+..\%__SRC%\lib\librpt*.so %_DEST%\lib%_EXT%\librpt*.so
+# ..\%__SRC%\lib\irpt*.lib %_DEST%\lib%_EXT%\irpt*.lib
+..\%__SRC%\lib\librpt*.dylib %_DEST%\lib%_EXT%\librpt*.dylib
+
+# Resources
+..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
+
+..\uiconfig\dbreport\accelerator\de-DE\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\de-DE\*.xml
+..\uiconfig\dbreport\accelerator\en-GB\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\en-GB\*.xml
+..\uiconfig\dbreport\accelerator\en-US\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\accelerator\en-US\*.xml
+..\uiconfig\dbreport\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\menubar\*.xml
+..\uiconfig\dbreport\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\statusbar\*.xml
+..\uiconfig\dbreport\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\toolbar\*.xml
+
+
diff --git a/reportdesign/prj/rpt.xml b/reportdesign/prj/rpt.xml
new file mode 100644
index 000000000000..efc28985c639
--- /dev/null
+++ b/reportdesign/prj/rpt.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name>reportdesign</module-name>
+ <component-description>
+ <author>Ocke Janssen</author>
+ <name>com.sun.star.report.comp.ReportDesign</name>
+ <description>Represents the report design.</description>
+ <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+ <language>c++</language>
+ <status value="final"/>
+ <supported-service>com.sun.star.report.ReportDesign</supported-service>
+ </component-description>
+</module-description>
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx
new file mode 100644
index 000000000000..100740b3f2f1
--- /dev/null
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -0,0 +1,551 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedLine.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FIXEDLINE_HXX
+#include "FixedLine.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <boost/bind.hpp>
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+uno::Sequence< ::rtl::OUString > lcl_getLineOptionals()
+{
+ ::rtl::OUString pProps[] = {
+ PROPERTY_DATAFIELD
+ ,PROPERTY_DEFAULTCONTROL
+ ,PROPERTY_CONTROLBORDER
+ ,PROPERTY_CONTROLBORDERCOLOR
+ ,PROPERTY_CHARCOLOR
+ ,PROPERTY_CHAREMPHASIS
+ ,PROPERTY_CHARFONTCHARSET
+ ,PROPERTY_CHARFONTFAMILY
+ ,PROPERTY_CHARFONTNAME
+ ,PROPERTY_CHARFONTPITCH
+ ,PROPERTY_CHARFONTSTYLENAME
+ ,PROPERTY_CHARHEIGHT
+ ,PROPERTY_CHARPOSTURE
+ ,PROPERTY_CHARRELIEF
+ ,PROPERTY_FONTDESCRIPTOR
+ ,PROPERTY_CONTROLTEXTEMPHASISMARK
+ ,PROPERTY_CHARROTATION
+ ,PROPERTY_CHARSCALEWIDTH
+ ,PROPERTY_CHARSTRIKEOUT
+ ,PROPERTY_CHARUNDERLINECOLOR
+ ,PROPERTY_CHARUNDERLINE
+ ,PROPERTY_CHARWEIGHT
+ ,PROPERTY_CHARWORDMODE
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ ,PROPERTY_CHARFLASH
+ ,PROPERTY_CHARAUTOKERNING
+ ,PROPERTY_CHARESCAPEMENTHEIGHT
+ ,PROPERTY_CHARLOCALE
+ ,PROPERTY_CHARESCAPEMENT
+ ,PROPERTY_CHARCASEMAP
+ ,PROPERTY_CHARCOMBINEISON
+ ,PROPERTY_CHARCOMBINEPREFIX
+ ,PROPERTY_CHARCOMBINESUFFIX
+ ,PROPERTY_CHARHIDDEN
+ ,PROPERTY_CHARSHADOWED
+ ,PROPERTY_CHARCONTOURED
+ ,PROPERTY_HYPERLINKURL
+ ,PROPERTY_HYPERLINKTARGET
+ ,PROPERTY_HYPERLINKNAME
+ ,PROPERTY_VISITEDCHARSTYLENAME
+ ,PROPERTY_UNVISITEDCHARSTYLENAME
+ ,PROPERTY_CHARKERNING
+ };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+DBG_NAME(rpt_OFixedLine)
+// -----------------------------------------------------------------------------
+OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext)
+:FixedLineBase(m_aMutex)
+,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nOrientation(1)
+,m_LineColor(0)
+,m_LineTransparence(0)
+,m_LineWidth(0)
+{
+ DBG_CTOR(rpt_OFixedLine,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_nWidth = 8;
+}
+// -----------------------------------------------------------------------------
+OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+:FixedLineBase(m_aMutex)
+,FixedLinePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getLineOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nOrientation(1)
+,m_LineColor(0)
+,m_LineTransparence(0)
+,m_LineWidth(0)
+{
+ DBG_CTOR(rpt_OFixedLine,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDLINE,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_xFactory = _xFactory;
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OFixedLine::~OFixedLine()
+{
+ DBG_DTOR(rpt_OFixedLine,NULL);
+}
+// -----------------------------------------------------------------------------
+//IMPLEMENT_FORWARD_XINTERFACE2(OFixedLine,FixedLineBase,FixedLinePropertySet)
+IMPLEMENT_FORWARD_REFCOUNT( OFixedLine, FixedLineBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedLine::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = FixedLineBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = FixedLinePropertySet::queryInterface(_rType);
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::dispose() throw(uno::RuntimeException)
+{
+ FixedLinePropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OFixedLine::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFixedLine"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedLine::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OFixedLine::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_FIXEDLINE;
+
+ return aServices;
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OFixedLine::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OFixedLine(xContext));
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OFixedLine::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OFixedLine::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OFixedLine)
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OFixedLine::getControlBorder( ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setControlBorder( ::sal_Int16 /*_border*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFixedLine::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setControlBorderColor( ::sal_Int32 /*_bordercolor*/ ) throw (beans::UnknownPropertyException,lang::IllegalArgumentException,uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OFixedLine::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return FixedLinePropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedLinePropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedLine::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return FixedLinePropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedLinePropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedLinePropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedLinePropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedLinePropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XReportControlModel
+::rtl::OUString SAL_CALL OFixedLine::getDataField() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OFixedLine::getParaAdjust() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.nAlign;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setParaAdjust( ::sal_Int16 _align ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_PARAADJUST,_align,m_aProps.aFormatProperties.nAlign);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFixedLine::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedLine::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedLine::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.bPrintWhenGroupChange;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedLine::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
+}
+
+// -----------------------------------------------------------------------------
+
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OFixedLine::createClone( ) throw (uno::RuntimeException)
+{
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XFixedLine> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FIXEDLINE),uno::UNO_QUERY_THROW);
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+
+// XFixedLine
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFixedLine::getOrientation() throw (beans::UnknownPropertyException,uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nOrientation;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setOrientation( ::sal_Int32 _orientation ) throw (beans::UnknownPropertyException,uno::RuntimeException)
+{
+ set(PROPERTY_ORIENTATION,_orientation,m_nOrientation);
+}
+// -----------------------------------------------------------------------------
+drawing::LineStyle SAL_CALL OFixedLine::getLineStyle() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_LineStyle;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setLineStyle( drawing::LineStyle _linestyle ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LINESTYLE,_linestyle,m_LineStyle);
+}
+// -----------------------------------------------------------------------------
+drawing::LineDash SAL_CALL OFixedLine::getLineDash() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_LineDash;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setLineDash( const drawing::LineDash& _linedash ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LINEDASH,_linedash,m_LineDash);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFixedLine::getLineColor() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_LineColor;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setLineColor( ::sal_Int32 _linecolor ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LINECOLOR,_linecolor,m_LineColor);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OFixedLine::getLineTransparence() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_LineTransparence;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setLineTransparence( ::sal_Int16 _linetransparence ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LINETRANSPARENCE,_linetransparence,m_LineTransparence);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFixedLine::getLineWidth() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_LineWidth;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setLineWidth( ::sal_Int32 _linewidth ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LINEWIDTH,_linewidth,m_LineWidth);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OFixedLine::getParent( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getParent(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ OShapeHelper::setParent(Parent,this);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFormatCondition > SAL_CALL OFixedLine::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
+{
+ return new OFormatCondition(m_aProps.aComponent.m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OFixedLine::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.addContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.removeContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OFixedLine::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedLine::hasElements( ) throw (uno::RuntimeException)
+{
+ return m_aProps.hasElements();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OFixedLine::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.insertByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.removeByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OFixedLine::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.replaceByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OFixedLine::getCount( ) throw (uno::RuntimeException)
+{
+ return m_aProps.getCount();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedLine::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_aProps.getByIndex( Index );
+}
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OFixedLine::getPosition( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getPosition(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ OShapeHelper::setPosition(aPosition,this);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OFixedLine::getSize( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getSize(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ if ( aSize.Width < 8 && m_nOrientation == 1 )
+ throw beans::PropertyVetoException();
+ OShapeHelper::setSize(aSize,this);
+}
+// -----------------------------------------------------------------------------
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OFixedLine::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aProps.aComponent.m_xShape.is() )
+ return m_aProps.aComponent.m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedLine::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+void SAL_CALL OFixedLine::setHyperLinkURL(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+::rtl::OUString SAL_CALL OFixedLine::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+void SAL_CALL OFixedLine::setHyperLinkTarget(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+::rtl::OUString SAL_CALL OFixedLine::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+void SAL_CALL OFixedLine::setHyperLinkName(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+
+NO_REPORTCONTROLFORMAT_IMPL(OFixedLine)
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/FixedText.cxx b/reportdesign/source/core/api/FixedText.cxx
new file mode 100644
index 000000000000..b9aad3717fcc
--- /dev/null
+++ b/reportdesign/source/core/api/FixedText.cxx
@@ -0,0 +1,390 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedText.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FIXEDTEXT_HXX
+#include "FixedText.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+uno::Sequence< ::rtl::OUString > lcl_getFixedTextOptionals()
+{
+ ::rtl::OUString pProps[] = { PROPERTY_DATAFIELD };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+DBG_NAME( rpt_OFixedText )
+// -----------------------------------------------------------------------------
+OFixedText::OFixedText(uno::Reference< uno::XComponentContext > const & _xContext)
+:FixedTextBase(m_aMutex)
+,FixedTextPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFixedTextOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_bMultiLine(sal_False)
+{
+ DBG_CTOR( rpt_OFixedText,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDTEXT,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_nBorder = 0; // no border
+}
+// -----------------------------------------------------------------------------
+OFixedText::OFixedText(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+:FixedTextBase(m_aMutex)
+,FixedTextPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFixedTextOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_bMultiLine(sal_False)
+{
+ DBG_CTOR( rpt_OFixedText,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FIXEDTEXT,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_nBorder = 0; // no border
+ m_aProps.aComponent.m_xFactory = _xFactory;
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OFixedText::~OFixedText()
+{
+ DBG_DTOR( rpt_OFixedText,NULL);
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_REFCOUNT( OFixedText, FixedTextBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedText::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = FixedTextBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = FixedTextPropertySet::queryInterface(_rType);
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
+}
+
+//IMPLEMENT_FORWARD_XINTERFACE2(OFixedText,FixedTextBase,FixedTextPropertySet)
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::dispose() throw(uno::RuntimeException)
+{
+ FixedTextPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ uno::Reference< report::XFixedText> xHoldAlive = this;
+ {
+ m_aProps.dispose(m_refCount);
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OFixedText::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFixedText"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedText::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OFixedText::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);//2);
+ aServices.getArray()[0] = SERVICE_FIXEDTEXT;
+ //aServices.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"));
+
+ return aServices;
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OFixedText::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OFixedText(xContext));
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OFixedText::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OFixedText::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OFixedText)
+REPORTCOMPONENT_IMPL2(OFixedText)
+REPORTCONTROLFORMAT_IMPL(OFixedText,m_aProps.aFormatProperties)
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OFixedText::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return FixedTextPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedTextPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedText::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return FixedTextPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedTextPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedTextPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedTextPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FixedTextPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XReportControlModel
+::rtl::OUString SAL_CALL OFixedText::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedText::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.bPrintWhenGroupChange;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedText::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
+}
+// -----------------------------------------------------------------------------
+
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OFixedText::createClone( ) throw (uno::RuntimeException)
+{
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XFixedText> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FIXEDTEXT),uno::UNO_QUERY_THROW);
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+
+// XFixedText
+::rtl::OUString SAL_CALL OFixedText::getLabel() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_sLabel;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setLabel( const ::rtl::OUString& _label ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_LABEL,_label,m_sLabel);
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OFixedText::getParent( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getParent(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ OShapeHelper::setParent(Parent,this);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedText::getMultiLine() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bMultiLine;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setMultiLine( ::sal_Bool _multiline ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_MULTILINE,_multiline,m_bMultiLine);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFormatCondition > SAL_CALL OFixedText::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
+{
+ return new OFormatCondition(m_aProps.aComponent.m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OFixedText::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.addContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.removeContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OFixedText::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFixedText::hasElements( ) throw (uno::RuntimeException)
+{
+ return m_aProps.hasElements();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OFixedText::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.insertByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.removeByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OFixedText::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.replaceByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OFixedText::getCount( ) throw (uno::RuntimeException)
+{
+ return m_aProps.getCount();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFixedText::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_aProps.getByIndex( Index );
+}
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OFixedText::getPosition( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getPosition(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ OShapeHelper::setPosition(aPosition,this);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OFixedText::getSize( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getSize(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedText::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ OShapeHelper::setSize(aSize,this);
+}
+// -----------------------------------------------------------------------------
+
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OFixedText::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aProps.aComponent.m_xShape.is() )
+ return m_aProps.aComponent.m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/FormatCondition.cxx b/reportdesign/source/core/api/FormatCondition.cxx
new file mode 100644
index 000000000000..c6b1c7af3ec8
--- /dev/null
+++ b/reportdesign/source/core/api/FormatCondition.cxx
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormatCondition.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include "ReportHelperImpl.hxx"
+#include "corestrings.hrc"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OFormatCondition::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OFormatCondition(xContext));
+}
+
+DBG_NAME( rpt_OFormatCondition )
+// -----------------------------------------------------------------------------
+OFormatCondition::OFormatCondition(uno::Reference< uno::XComponentContext > const & _xContext)
+:FormatConditionBase(m_aMutex)
+,FormatConditionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_bEnabled(sal_True)
+{
+ DBG_CTOR( rpt_OFormatCondition,NULL);
+}
+// -----------------------------------------------------------------------------
+OFormatCondition::~OFormatCondition()
+{
+ DBG_DTOR( rpt_OFormatCondition,NULL);
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XINTERFACE2(OFormatCondition,FormatConditionBase,FormatConditionPropertySet)
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::dispose() throw(uno::RuntimeException)
+{
+ FormatConditionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OFormatCondition::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFormatCondition"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFormatCondition::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OFormatCondition::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_FORMATCONDITION;
+
+ return aServices;
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OFormatCondition::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OFormatCondition::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormatCondition::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return FormatConditionPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormatConditionPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFormatCondition::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return FormatConditionPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormatConditionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormatConditionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormatConditionPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormatConditionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XFormatCondition
+::sal_Bool SAL_CALL OFormatCondition::getEnabled() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bEnabled;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::setEnabled( ::sal_Bool _enabled ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_ENABLED,_enabled,m_bEnabled);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFormatCondition::getFormula() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_sFormula;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormatCondition::setFormula( const ::rtl::OUString& _formula ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_FORMULA,_formula,m_sFormula);
+}
+// -----------------------------------------------------------------------------
+// XReportControlFormat
+REPORTCONTROLFORMAT_IMPL(OFormatCondition,m_aFormatProperties)
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx
new file mode 100644
index 000000000000..3ef55a073b32
--- /dev/null
+++ b/reportdesign/source/core/api/FormattedField.cxx
@@ -0,0 +1,411 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormattedField.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FORMATTEDFIELD_HXX
+#include "FormattedField.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OFormattedField::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OFormattedField(xContext));
+}
+
+DBG_NAME( rpt_OFormattedField )
+// -----------------------------------------------------------------------------
+OFormattedField::OFormattedField(uno::Reference< uno::XComponentContext > const & _xContext)
+:FormattedFieldBase(m_aMutex)
+,FormattedFieldPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nFormatKey(0)
+{
+ DBG_CTOR( rpt_OFormattedField,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FORMATTEDFIELD,m_aProps.aComponent.m_xContext->getServiceManager());
+}
+// -----------------------------------------------------------------------------
+OFormattedField::OFormattedField(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+:FormattedFieldBase(m_aMutex)
+,FormattedFieldPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nFormatKey(0)
+{
+ DBG_CTOR( rpt_OFormattedField,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_FORMATTEDFIELD,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_xFactory = _xFactory;
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OFormattedField::~OFormattedField()
+{
+ DBG_DTOR( rpt_OFormattedField,NULL);
+}
+// -----------------------------------------------------------------------------
+//IMPLEMENT_FORWARD_XINTERFACE2(OFormattedField,FormattedFieldBase,FormattedFieldPropertySet)
+IMPLEMENT_FORWARD_REFCOUNT( OFormattedField, FormattedFieldBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OFormattedField::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = FormattedFieldBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = FormattedFieldPropertySet::queryInterface(_rType);
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::dispose() throw(uno::RuntimeException)
+{
+ FormattedFieldPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ uno::Reference< report::XFormattedField> xHoldAlive = this;
+ {
+ m_xFormatsSupplier.clear();
+ m_xFunction.clear();
+ m_aProps.dispose(m_refCount);
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OFormattedField::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFormattedField"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFormattedField::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OFormattedField::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(2);
+ aServices.getArray()[0] = SERVICE_FORMATTEDFIELD;
+ aServices.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel"));
+
+ return aServices;
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OFormattedField::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OFormattedField::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OFormattedField)
+REPORTCOMPONENT_IMPL2(OFormattedField)
+REPORTCONTROLFORMAT_IMPL(OFormattedField,m_aProps.aFormatProperties)
+
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OFormattedField::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return FormattedFieldPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ // special case here /// TODO check
+ if ( !aValue.hasValue() && aPropertyName == PROPERTY_FORMATKEY )
+ m_nFormatKey = 0;
+ else
+ FormattedFieldPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFormattedField::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return FormattedFieldPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormattedFieldPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormattedFieldPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormattedFieldPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FormattedFieldPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XReportControlModel
+::rtl::OUString SAL_CALL OFormattedField::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aDataField;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setDataField( const ::rtl::OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFormattedField::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.bPrintWhenGroupChange;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFormattedField::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
+}
+
+// -----------------------------------------------------------------------------
+
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OFormattedField::createClone( ) throw (uno::RuntimeException)
+{
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XFormattedField> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FORMATTEDFIELD),uno::UNO_QUERY_THROW);
+
+ if ( xSet.is() )
+ {
+ ::std::vector< uno::Reference< report::XFormatCondition> >::iterator aIter = m_aProps.m_aFormatConditions.begin();
+ ::std::vector< uno::Reference< report::XFormatCondition> >::iterator aEnd = m_aProps.m_aFormatConditions.end();
+ for (sal_Int32 i = 0; aIter != aEnd; ++aIter,++i)
+ {
+ uno::Reference< report::XFormatCondition > xCond = xSet->createFormatCondition();
+ ::comphelper::copyProperties(aIter->get(),xCond.get());
+ xSet->insertByIndex(i,uno::makeAny(xCond));
+ }
+ }
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+// XFormattedField
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OFormattedField::getFormatKey() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nFormatKey;
+}
+
+void SAL_CALL OFormattedField::setFormatKey(::sal_Int32 _formatkey) throw (uno::RuntimeException)
+{
+ set(PROPERTY_FORMATKEY,_formatkey,m_nFormatKey);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< util::XNumberFormatsSupplier > SAL_CALL OFormattedField::getFormatsSupplier() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_xFormatsSupplier.is() )
+ {
+ uno::Reference< beans::XPropertySet> xProp(::dbtools::findDataSource(getParent()),uno::UNO_QUERY);
+ if ( xProp.is() )
+ {
+ m_xFormatsSupplier.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberFormatsSupplier"))),uno::UNO_QUERY);
+ }
+ }
+ return m_xFormatsSupplier;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setFormatsSupplier( const uno::Reference< util::XNumberFormatsSupplier >& _formatssupplier ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_FORMATSSUPPLIER,_formatssupplier,m_xFormatsSupplier);
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OFormattedField::getParent( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getParent(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ OShapeHelper::setParent(Parent,this);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFormatCondition > SAL_CALL OFormattedField::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
+{
+ return new OFormatCondition(m_aProps.aComponent.m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OFormattedField::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.addContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.removeContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OFormattedField::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFormattedField::hasElements( ) throw (uno::RuntimeException)
+{
+ return m_aProps.hasElements();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OFormattedField::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.insertByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.removeByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OFormattedField::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.replaceByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OFormattedField::getCount( ) throw (uno::RuntimeException)
+{
+ return m_aProps.getCount();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFormattedField::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_aProps.getByIndex( Index );
+}
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OFormattedField::getPosition( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getPosition(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ OShapeHelper::setPosition(aPosition,this);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OFormattedField::getSize( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getSize(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFormattedField::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ OShapeHelper::setSize(aSize,this);
+}
+// -----------------------------------------------------------------------------
+
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OFormattedField::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aProps.aComponent.m_xShape.is() )
+ return m_aProps.aComponent.m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/Function.cxx b/reportdesign/source/core/api/Function.cxx
new file mode 100644
index 000000000000..29e457379314
--- /dev/null
+++ b/reportdesign/source/core/api/Function.cxx
@@ -0,0 +1,244 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Function.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FUNCTION_HXX
+#include "Function.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#include "corestrings.hrc"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OFunction::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OFunction(xContext));
+}
+
+DBG_NAME( rpt_OFunction )
+// -----------------------------------------------------------------------------
+OFunction::OFunction(uno::Reference< uno::XComponentContext > const & _xContext)
+:FunctionBase(m_aMutex)
+,FunctionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_xContext(_xContext)
+,m_bPreEvaluated(sal_False)
+,m_bDeepTraversing(sal_False)
+{
+ m_sInitialFormula.IsPresent = sal_False;
+ DBG_CTOR( rpt_OFunction,NULL);
+}
+// -----------------------------------------------------------------------------
+OFunction::~OFunction()
+{
+ DBG_DTOR( rpt_OFunction,NULL);
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XINTERFACE2(OFunction,FunctionBase,FunctionPropertySet)
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::dispose() throw(uno::RuntimeException)
+{
+ FunctionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OFunction::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OFunction"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFunction::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OFunction::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_FUNCTION;
+
+ return aServices;
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OFunction::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OFunction::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OFunction::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return FunctionPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FunctionPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFunction::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return FunctionPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FunctionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FunctionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FunctionPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ FunctionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// report::XFunction:
+::sal_Bool SAL_CALL OFunction::getPreEvaluated() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_bPreEvaluated;
+}
+// -----------------------------------------------------------------------------
+
+void SAL_CALL OFunction::setPreEvaluated(::sal_Bool the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_PREEVALUATED,the_value,m_bPreEvaluated);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFunction::getDeepTraversing() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_bDeepTraversing;
+}
+// -----------------------------------------------------------------------------
+
+void SAL_CALL OFunction::setDeepTraversing(::sal_Bool the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_DEEPTRAVERSING,the_value,m_bPreEvaluated);
+}
+// -----------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL OFunction::getName() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_sName;
+}
+// -----------------------------------------------------------------------------
+
+void SAL_CALL OFunction::setName(const ::rtl::OUString & the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_NAME,the_value,m_sName);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFunction::getFormula() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_sFormula;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::setFormula(const ::rtl::OUString & the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_FORMULA,the_value,m_sFormula);
+}
+// -----------------------------------------------------------------------------
+beans::Optional< ::rtl::OUString> SAL_CALL OFunction::getInitialFormula() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_sInitialFormula;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::setInitialFormula(const beans::Optional< ::rtl::OUString> & the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_INITIALFORMULA,the_value,m_sInitialFormula);
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OFunction::getParent( ) throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunction::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ if ( Parent.is() )
+ {
+ uno::Reference< report::XFunctions> xFunctions(Parent,uno::UNO_QUERY_THROW);
+ m_xParent = xFunctions;
+ }
+ else
+ m_xParent = uno::WeakReference< report::XFunctions >();
+}
+// -----------------------------------------------------------------------------
+
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/Functions.cxx b/reportdesign/source/core/api/Functions.cxx
new file mode 100644
index 000000000000..b50fe4423ce5
--- /dev/null
+++ b/reportdesign/source/core/api/Functions.cxx
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Functions.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_FUNCTIONS_HXX
+#include "Functions.hxx"
+#endif
+#ifndef RPT_FUNCTION_HXX
+#include "Function.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#include <boost/bind.hpp>
+#include <algorithm>
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+DBG_NAME( rpt_OFunctions )
+// -----------------------------------------------------------------------------
+OFunctions::OFunctions(const uno::Reference< report::XFunctionsSupplier >& _xParent,const uno::Reference< uno::XComponentContext >& context)
+:FunctionsBase(m_aMutex)
+,m_aContainerListeners(m_aMutex)
+,m_xContext(context)
+,m_xParent(_xParent)
+{
+ DBG_CTOR( rpt_OFunctions,NULL);
+}
+//--------------------------------------------------------------------------
+OFunctions::~OFunctions()
+{
+ DBG_DTOR( rpt_OFunctions,NULL);
+}
+//--------------------------------------------------------------------------
+void OFunctions::copyFunctions(const uno::Reference< report::XFunctions >& _xSource)
+{
+ sal_Int32 nCount = _xSource->getCount();
+ for (sal_Int32 i = 0; i != nCount; ++i)
+ {
+ uno::Reference<report::XFunction> xDestFunction = new OFunction(m_xContext);
+ m_aFunctions.push_back(xDestFunction);
+ uno::Reference<report::XFunction> xSourceFunction(_xSource->getByIndex(i),uno::UNO_QUERY);
+ ::comphelper::copyProperties(xSourceFunction.get(),xDestFunction.get());
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunctions::dispose() throw(uno::RuntimeException)
+{
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunctions::disposing()
+{
+ ::std::for_each(m_aFunctions.begin(),m_aFunctions.end(),::boost::mem_fn(&com::sun::star::report::XFunction::dispose));
+ m_aFunctions.clear();
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_aContainerListeners.disposeAndClear( aDisposeEvent );
+ m_xContext.clear();
+}
+// -----------------------------------------------------------------------------
+// XFunctionsSupplier
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFunction > SAL_CALL OFunctions::createFunction( ) throw (uno::RuntimeException)
+{
+ return new OFunction(m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OFunctions::insertByIndex( ::sal_Int32 Index, const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ sal_Bool bAdd = (Index == static_cast<sal_Int32>(m_aFunctions.size()));
+ if ( !bAdd )
+ checkIndex(Index);
+ uno::Reference< report::XFunction > xFunction(aElement,uno::UNO_QUERY);
+ if ( !xFunction.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_xContext->getServiceManager()),*this,2);
+
+ if ( bAdd )
+ m_aFunctions.push_back(xFunction);
+ else
+ {
+ TFunctions::iterator aPos = m_aFunctions.begin();
+ ::std::advance(aPos,Index);
+ m_aFunctions.insert(aPos, xFunction);
+ }
+ xFunction->setParent(*this);
+ }
+ // notify our container listeners
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), aElement, uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementInserted,aEvent);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunctions::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Reference< report::XFunction > xFunction;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ TFunctions::iterator aPos = m_aFunctions.begin();
+ ::std::advance(aPos,Index);
+ xFunction = *aPos;
+ m_aFunctions.erase(aPos);
+ xFunction->setParent(NULL);
+ }
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), uno::makeAny(xFunction), uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementRemoved,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OFunctions::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Any aOldElement;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ uno::Reference< report::XFunction > xFunction(Element,uno::UNO_QUERY);
+ if ( !xFunction.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_xContext->getServiceManager()),*this,2);
+ TFunctions::iterator aPos = m_aFunctions.begin();
+ ::std::advance(aPos,Index);
+ aOldElement <<= *aPos;
+ *aPos = xFunction;
+ }
+
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), Element, aOldElement);
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementReplaced,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OFunctions::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aFunctions.size();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OFunctions::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ TFunctions::iterator aPos = m_aFunctions.begin();
+ ::std::advance(aPos,Index);
+ return uno::makeAny(*aPos);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OFunctions::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFunction>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OFunctions::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return !m_aFunctions.empty();
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OFunctions::getParent( ) throw (uno::RuntimeException)
+{
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunctions::setParent( const uno::Reference< uno::XInterface >& /*Parent*/ ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ throw lang::NoSupportException();
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OFunctions::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.addInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFunctions::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.removeInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void OFunctions::checkIndex(sal_Int32 _nIndex)
+{
+ if ( _nIndex < 0 || static_cast<sal_Int32>(m_aFunctions.size()) <= _nIndex )
+ throw lang::IndexOutOfBoundsException();
+}
+// =============================================================================
+}
+// =============================================================================
diff --git a/reportdesign/source/core/api/Group.cxx b/reportdesign/source/core/api/Group.cxx
new file mode 100644
index 000000000000..96c5f7f4f751
--- /dev/null
+++ b/reportdesign/source/core/api/Group.cxx
@@ -0,0 +1,379 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Group.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_GROUP_HXX
+#include "Group.hxx"
+#endif
+#ifndef REPORTDESIGN_API_SECTION_HXX
+#include "Section.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_GROUPON_HPP_
+#include <com/sun/star/report/GroupOn.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_KEEPTOGETHER_HPP_
+#include <com/sun/star/report/KeepTogether.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_API_FUNCTIONS_HXX
+#include "Functions.hxx"
+#endif
+
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+DBG_NAME( rpt_OGroup )
+// -----------------------------------------------------------------------------
+OGroup::OGroup(const uno::Reference< report::XGroups >& _xParent
+ ,const uno::Reference< uno::XComponentContext >& _xContext)
+:GroupBase(m_aMutex)
+,GroupPropertySet(_xContext,static_cast< GroupPropertySet::Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_xContext(_xContext)
+,m_xParent(_xParent)
+{
+ DBG_CTOR( rpt_OGroup,NULL);
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ m_xFunctions = new OFunctions(this,m_xContext);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+//--------------------------------------------------------------------------
+OGroup::~OGroup()
+{
+ DBG_DTOR( rpt_OGroup,NULL);
+}
+//--------------------------------------------------------------------------
+void OGroup::copyGroup(const uno::Reference< report::XGroup >& _xSource)
+{
+ ::comphelper::copyProperties(_xSource.get(),static_cast<GroupPropertySet*>(this));
+
+ if ( _xSource->getHeaderOn() )
+ {
+ setHeaderOn(sal_True);
+ OSection::lcl_copySection(_xSource->getHeader(),m_xHeader);
+ } // if ( _xSource->getHeaderOn() )
+
+ if ( _xSource->getFooterOn() )
+ {
+ setFooterOn(sal_True);
+ OSection::lcl_copySection(_xSource->getFooter(),m_xFooter);
+ } // if ( _xSource->getFooterOn() )
+}
+//--------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XINTERFACE2(OGroup,GroupBase,GroupPropertySet)
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OGroup::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Group"));
+}
+//------------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> OGroup::getSupportedServiceNames_Static(void) throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString> aSupported(1);
+ aSupported.getArray()[0] = SERVICE_GROUP;
+ return aSupported;
+}
+//-------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> SAL_CALL OGroup::getSupportedServiceNames() throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OGroup::supportsService( const ::rtl::OUString& _rServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(_rServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::dispose() throw(uno::RuntimeException)
+{
+ GroupPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::disposing()
+{
+ ::comphelper::disposeComponent(m_xHeader);
+ ::comphelper::disposeComponent(m_xFooter);
+ ::comphelper::disposeComponent(m_xFunctions);
+ m_xContext.clear();
+}
+// -----------------------------------------------------------------------------
+// XGroup
+::sal_Bool SAL_CALL OGroup::getSortAscending() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_eSortAscending;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setSortAscending( ::sal_Bool _sortascending ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_SORTASCENDING,_sortascending,m_aProps.m_eSortAscending);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OGroup::getHeaderOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xHeader.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setHeaderOn( ::sal_Bool _headeron ) throw (uno::RuntimeException)
+{
+ if ( _headeron != m_xHeader.is() )
+ {
+ ::rtl::OUString sName(RPT_RESSTRING(RID_STR_GROUP_HEADER,m_xContext->getServiceManager()));
+ /*const ::rtl::OUString sPlaceHolder(RTL_CONSTASCII_USTRINGPARAM("%1"));
+ sName = sName.replaceAt(sName.indexOf(sPlaceHolder),sPlaceHolder.getLength(),m_aProps.m_sExpression);*/
+ setSection(PROPERTY_HEADERON,_headeron,sName,m_xHeader);
+ }
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OGroup::getFooterOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xFooter.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setFooterOn( ::sal_Bool _footeron ) throw (uno::RuntimeException)
+{
+ if ( _footeron != m_xFooter.is() )
+ {
+ ::rtl::OUString sName(RPT_RESSTRING(RID_STR_GROUP_FOOTER,m_xContext->getServiceManager()));
+ /*const ::rtl::OUString sPlaceHolder(RTL_CONSTASCII_USTRINGPARAM("%1"));
+ sName = sName.replaceAt(sName.indexOf(sPlaceHolder),sPlaceHolder.getLength(),m_aProps.m_sExpression);*/
+ setSection(PROPERTY_FOOTERON,_footeron,sName,m_xFooter);
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OGroup::getHeader() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ uno::Reference< report::XSection > xRet;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ xRet = m_xHeader;
+ }
+
+ if ( !xRet.is() )
+ throw container::NoSuchElementException();
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OGroup::getFooter() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ uno::Reference< report::XSection > xRet;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ xRet = m_xFooter;
+ }
+
+ if ( !xRet.is() )
+ throw container::NoSuchElementException();
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OGroup::getGroupOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_nGroupOn;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setGroupOn( ::sal_Int16 _groupon ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( _groupon < report::GroupOn::DEFAULT || _groupon > report::GroupOn::INTERVAL )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::GroupOn"))
+ ,*this
+ ,1
+ ,m_xContext);
+ set(PROPERTY_GROUPON,_groupon,m_aProps.m_nGroupOn);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OGroup::getGroupInterval() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_nGroupInterval;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setGroupInterval( ::sal_Int32 _groupinterval ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_GROUPINTERVAL,_groupinterval,m_aProps.m_nGroupInterval);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OGroup::getKeepTogether() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_nKeepTogether;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setKeepTogether( ::sal_Int16 _keeptogether ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( _keeptogether < report::KeepTogether::NO || _keeptogether > report::KeepTogether::WITH_FIRST_DETAIL )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::KeepTogether"))
+ ,*this
+ ,1
+ ,m_xContext);
+ set(PROPERTY_KEEPTOGETHER,_keeptogether,m_aProps.m_nKeepTogether);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XGroups > SAL_CALL OGroup::getGroups() throw (uno::RuntimeException)
+{
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OGroup::getExpression() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_sExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setExpression( const ::rtl::OUString& _expression ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_EXPRESSION,_expression,m_aProps.m_sExpression);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OGroup::getStartNewColumn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_bStartNewColumn;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setStartNewColumn( ::sal_Bool _startnewcolumn ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_STARTNEWCOLUMN,_startnewcolumn,m_aProps.m_bStartNewColumn);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OGroup::getResetPageNumber() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.m_bResetPageNumber;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setResetPageNumber( ::sal_Bool _resetpagenumber ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_RESETPAGENUMBER,_resetpagenumber,m_aProps.m_bResetPageNumber);
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OGroup::getParent( ) throw (uno::RuntimeException)
+{
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setParent( const uno::Reference< uno::XInterface >& /*Parent*/ ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ throw lang::NoSupportException();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OGroup::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ // return uno::Reference< beans::XPropertySetInfo >();
+ return GroupPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ GroupPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OGroup::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return GroupPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ GroupPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ GroupPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ GroupPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroup::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ GroupPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void OGroup::setSection( const ::rtl::OUString& _sProperty
+ ,const sal_Bool& _bOn
+ ,const ::rtl::OUString& _sName
+ ,uno::Reference< report::XSection>& _member)
+{
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, uno::makeAny(_member), uno::makeAny(_bOn), &l);
+ lcl_createSectionIfNeeded(_bOn ,this,_member);
+ if ( _member.is() )
+ _member->setName(_sName);
+ }
+ l.notify();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFunctions > SAL_CALL OGroup::getFunctions() throw (uno::RuntimeException)
+{
+ return m_xFunctions;
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/Groups.cxx b/reportdesign/source/core/api/Groups.cxx
new file mode 100644
index 000000000000..8b38e62c5690
--- /dev/null
+++ b/reportdesign/source/core/api/Groups.cxx
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Groups.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_GROUPS_HXX
+#include "Groups.hxx"
+#endif
+#ifndef REPORTDESIGN_API_GROUP_HXX
+#include "Group.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include <boost/bind.hpp>
+#include <algorithm>
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+DBG_NAME( rpt_OGroups )
+// -----------------------------------------------------------------------------
+OGroups::OGroups(const uno::Reference< report::XReportDefinition >& _xParent,const uno::Reference< uno::XComponentContext >& context)
+:GroupsBase(m_aMutex)
+,m_aContainerListeners(m_aMutex)
+,m_xContext(context)
+,m_xParent(_xParent)
+{
+ DBG_CTOR( rpt_OGroups,NULL);
+}
+//--------------------------------------------------------------------------
+OGroups::~OGroups()
+{
+ DBG_DTOR( rpt_OGroups,NULL);
+}
+//--------------------------------------------------------------------------
+void OGroups::copyGroups(const uno::Reference< report::XGroups >& _xSource)
+{
+ sal_Int32 nCount = _xSource->getCount();
+ for (sal_Int32 i = 0; i != nCount; ++i)
+ {
+ OGroup* pGroup = new OGroup(this,m_xContext);
+ m_aGroups.push_back(pGroup);
+ uno::Reference<report::XGroup> xGroup(_xSource->getByIndex(i),uno::UNO_QUERY);
+ pGroup->copyGroup(xGroup);
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroups::dispose() throw(uno::RuntimeException)
+{
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroups::disposing()
+{
+ ::std::for_each(m_aGroups.begin(),m_aGroups.end(),::boost::mem_fn(&com::sun::star::report::XGroup::dispose));
+ m_aGroups.clear();
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_aContainerListeners.disposeAndClear( aDisposeEvent );
+ m_xContext.clear();
+}
+// -----------------------------------------------------------------------------
+// XGroups
+uno::Reference< report::XReportDefinition > SAL_CALL OGroups::getReportDefinition() throw (uno::RuntimeException)
+{
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XGroup > SAL_CALL OGroups::createGroup( ) throw (uno::RuntimeException)
+{
+ return new OGroup(this,m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OGroups::insertByIndex( ::sal_Int32 Index, const uno::Any& aElement ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ sal_Bool bAdd = (Index == static_cast<sal_Int32>(m_aGroups.size()));
+ if ( !bAdd )
+ checkIndex(Index);
+ uno::Reference< report::XGroup > xGroup(aElement,uno::UNO_QUERY);
+ if ( !xGroup.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_xContext->getServiceManager()),*this,2);
+
+ if ( bAdd )
+ m_aGroups.push_back(xGroup);
+ else
+ {
+ TGroups::iterator aPos = m_aGroups.begin();
+ ::std::advance(aPos,Index);
+ m_aGroups.insert(aPos, xGroup);
+ }
+ }
+ // notify our container listeners
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), aElement, uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementInserted,aEvent);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroups::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Reference< report::XGroup > xGroup;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ TGroups::iterator aPos = m_aGroups.begin();
+ ::std::advance(aPos,Index);
+ xGroup = *aPos;
+ m_aGroups.erase(aPos);
+ }
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), uno::makeAny(xGroup), uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementRemoved,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OGroups::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Any aOldElement;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ uno::Reference< report::XGroup > xGroup(Element,uno::UNO_QUERY);
+ if ( !xGroup.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_xContext->getServiceManager()),*this,2);
+ TGroups::iterator aPos = m_aGroups.begin();
+ ::std::advance(aPos,Index);
+ aOldElement <<= *aPos;
+ *aPos = xGroup;
+ }
+
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::makeAny(Index), Element, aOldElement);
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementReplaced,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OGroups::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aGroups.size();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OGroups::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkIndex(Index);
+ TGroups::iterator aPos = m_aGroups.begin();
+ ::std::advance(aPos,Index);
+ return uno::makeAny(*aPos);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OGroups::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XGroup>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OGroups::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return !m_aGroups.empty();
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OGroups::getParent( ) throw (uno::RuntimeException)
+{
+ return m_xParent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroups::setParent( const uno::Reference< uno::XInterface >& /*Parent*/ ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ throw lang::NoSupportException();
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OGroups::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.addInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OGroups::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.removeInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void OGroups::checkIndex(sal_Int32 _nIndex)
+{
+ if ( _nIndex < 0 || static_cast<sal_Int32>(m_aGroups.size()) <= _nIndex )
+ throw lang::IndexOutOfBoundsException();
+}
+// =============================================================================
+}
+// =============================================================================
diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx
new file mode 100644
index 000000000000..88b43ca2854f
--- /dev/null
+++ b/reportdesign/source/core/api/ImageControl.cxx
@@ -0,0 +1,502 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageControl.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_IMAGECONTROL_HXX
+#include "ImageControl.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+uno::Sequence< ::rtl::OUString > lcl_getImageOptionals()
+{
+ ::rtl::OUString pProps[] = {
+ PROPERTY_CHARCOLOR
+ ,PROPERTY_CHAREMPHASIS
+ ,PROPERTY_CHARFONTCHARSET
+ ,PROPERTY_CHARFONTFAMILY
+ ,PROPERTY_CHARFONTNAME
+ ,PROPERTY_CHARFONTPITCH
+ ,PROPERTY_CHARFONTSTYLENAME
+ ,PROPERTY_CHARHEIGHT
+ ,PROPERTY_CHARPOSTURE
+ ,PROPERTY_CHARRELIEF
+ ,PROPERTY_FONTDESCRIPTOR
+ ,PROPERTY_CONTROLTEXTEMPHASISMARK
+ ,PROPERTY_CHARROTATION
+ ,PROPERTY_CHARSCALEWIDTH
+ ,PROPERTY_CHARSTRIKEOUT
+ ,PROPERTY_CHARUNDERLINECOLOR
+ ,PROPERTY_CHARUNDERLINE
+ ,PROPERTY_CHARWEIGHT
+ ,PROPERTY_CHARWORDMODE
+ ,PROPERTY_CHARFLASH
+ ,PROPERTY_CHARAUTOKERNING
+ ,PROPERTY_CHARESCAPEMENTHEIGHT
+ ,PROPERTY_CHARLOCALE
+ ,PROPERTY_CHARESCAPEMENT
+ ,PROPERTY_CHARCASEMAP
+ ,PROPERTY_CHARCOMBINEISON
+ ,PROPERTY_CHARCOMBINEPREFIX
+ ,PROPERTY_CHARCOMBINESUFFIX
+ ,PROPERTY_CHARHIDDEN
+ ,PROPERTY_CHARSHADOWED
+ ,PROPERTY_CHARCONTOURED
+ ,PROPERTY_VISITEDCHARSTYLENAME
+ ,PROPERTY_UNVISITEDCHARSTYLENAME
+ ,PROPERTY_CHARKERNING
+ };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+
+DBG_NAME( rpt_OImageControl )
+// -----------------------------------------------------------------------------
+OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext)
+:ImageControlBase(m_aMutex)
+,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_bScaleImage(sal_False)
+{
+ DBG_CTOR( rpt_OImageControl,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
+}
+// -----------------------------------------------------------------------------
+OImageControl::OImageControl(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+:ImageControlBase(m_aMutex)
+,ImageControlPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getImageOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_bScaleImage(sal_False)
+{
+ DBG_CTOR( rpt_OImageControl,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_IMAGECONTROL,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_xFactory = _xFactory;
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OImageControl::~OImageControl()
+{
+ DBG_DTOR( rpt_OImageControl,NULL);
+}
+// -----------------------------------------------------------------------------
+//IMPLEMENT_FORWARD_XINTERFACE2(OImageControl,ImageControlBase,ImageControlPropertySet)
+IMPLEMENT_FORWARD_REFCOUNT( OImageControl, ImageControlBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OImageControl::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ImageControlBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = ImageControlPropertySet::queryInterface(_rType);
+
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::dispose() throw(uno::RuntimeException)
+{
+ ImageControlPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ uno::Reference< report::XImageControl> xHoldAlive = this;
+ {
+ m_aProps.dispose(m_refCount);
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OImageControl::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OImageControl"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OImageControl::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OImageControl::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_IMAGECONTROL;
+
+ return aServices;
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OImageControl::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OImageControl(xContext));
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OImageControl::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OImageControl::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OImageControl)
+REPORTCOMPONENT_IMPL2(OImageControl)
+//REPORTCONTROLFORMAT_IMPL(OImageControl,m_aProps.aFormatProperties)
+NO_REPORTCONTROLFORMAT_IMPL(OImageControl)
+::rtl::OUString SAL_CALL OImageControl::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.sHyperLinkURL;
+}
+void SAL_CALL OImageControl::setHyperLinkURL(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ set(PROPERTY_HYPERLINKURL,the_value,m_aProps.aFormatProperties.sHyperLinkURL);
+}
+::rtl::OUString SAL_CALL OImageControl::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.sHyperLinkTarget;
+}
+void SAL_CALL OImageControl::setHyperLinkTarget(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ set(PROPERTY_HYPERLINKTARGET,the_value,m_aProps.aFormatProperties.sHyperLinkTarget);
+}
+::rtl::OUString SAL_CALL OImageControl::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.sHyperLinkName;
+}
+void SAL_CALL OImageControl::setHyperLinkName(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ set(PROPERTY_HYPERLINKNAME,the_value,m_aProps.aFormatProperties.sHyperLinkName);
+}
+
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OImageControl::getParaAdjust() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.nAlign;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setParaAdjust( ::sal_Int16 _align ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_PARAADJUST,_align,m_aProps.aFormatProperties.nAlign);
+}
+::sal_Int32 SAL_CALL OImageControl::getControlBackground() throw (::com::sun::star::beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.m_bBackgroundTransparent ? COL_TRANSPARENT : m_aProps.aFormatProperties.nBackgroundColor;
+}
+
+void SAL_CALL OImageControl::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ setControlBackgroundTransparent(_backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT));
+ set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,m_aProps.aFormatProperties.nBackgroundColor);
+}
+
+::sal_Bool SAL_CALL OImageControl::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aFormatProperties.m_bBackgroundTransparent;
+}
+
+void SAL_CALL OImageControl::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,m_aProps.aFormatProperties.m_bBackgroundTransparent);
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OImageControl::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return ImageControlPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ImageControlPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OImageControl::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return ImageControlPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ImageControlPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ImageControlPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ImageControlPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ImageControlPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XReportControlModel
+::rtl::OUString SAL_CALL OImageControl::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aDataField;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setDataField( const ::rtl::OUString& _datafield ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_DATAFIELD,_datafield,m_aProps.aDataField);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OImageControl::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.bPrintWhenGroupChange;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OImageControl::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
+}
+
+// -----------------------------------------------------------------------------
+
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OImageControl::createClone( ) throw (uno::RuntimeException)
+{
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XImageControl> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_IMAGECONTROL),uno::UNO_QUERY_THROW);
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+
+// XImageControl
+::sal_Bool SAL_CALL OImageControl::getScaleImage() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bScaleImage;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setScaleImage( ::sal_Bool _scaleimage ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_SCALEIMAGE,_scaleimage,m_bScaleImage);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OImageControl::getImageURL() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aImageURL;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setImageURL( const ::rtl::OUString& _imageurl ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_IMAGEURL,_imageurl,m_aImageURL);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< awt::XImageProducer > SAL_CALL OImageControl::getImageProducer( ) throw (uno::RuntimeException)
+{
+ return uno::Reference< awt::XImageProducer >();
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OImageControl::getParent( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getParent(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ OShapeHelper::setParent(Parent,this);
+}
+uno::Reference< report::XFormatCondition > SAL_CALL OImageControl::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
+{
+ return new OFormatCondition(m_aProps.aComponent.m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OImageControl::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.addContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.removeContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OImageControl::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OImageControl::hasElements( ) throw (uno::RuntimeException)
+{
+ return m_aProps.hasElements();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OImageControl::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.insertByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.removeByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OImageControl::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.replaceByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OImageControl::getCount( ) throw (uno::RuntimeException)
+{
+ return m_aProps.getCount();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OImageControl::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_aProps.getByIndex( Index );
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OImageControl::getPosition( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getPosition(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ OShapeHelper::setPosition(aPosition,this);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OImageControl::getSize( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getSize(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ OShapeHelper::setSize(aSize,this);
+}
+// -----------------------------------------------------------------------------
+
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OImageControl::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aProps.aComponent.m_xShape.is() )
+ return m_aProps.aComponent.m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OImageControl::getPreserveIRI() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bPreserveIRI;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setPreserveIRI( ::sal_Bool _preserveiri ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_PRESERVEIRI,_preserveiri,m_bPreserveIRI);
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/ReportComponent.cxx b/reportdesign/source/core/api/ReportComponent.cxx
new file mode 100644
index 000000000000..7e23e033bfbf
--- /dev/null
+++ b/reportdesign/source/core/api/ReportComponent.cxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportComponent.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "ReportComponent.hxx"
+
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_OUTDEV_HXX
+#include <vcl/outdev.hxx>
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontWidth.hpp>
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REFLECTION_XPROXYFACTORY_HPP_
+#include <com/sun/star/reflection/XProxyFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include <svx/unoshape.hxx>
+#include <svtools/syslocale.hxx>
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+OFormatProperties::OFormatProperties()
+ :nAlign(0)
+ ,nFontEmphasisMark(0)
+ ,nFontRelief(0)
+ ,nTextColor(0)
+ ,nTextLineColor(0)
+ ,nCharUnderlineColor(0xFFFFFFFF)
+ ,nBackgroundColor(COL_TRANSPARENT)
+ ,aVerticalAlignment(text::ParagraphVertAlign::TOP)
+ ,nCharEscapement(0)
+ ,nCharCaseMap(0)
+ ,nCharKerning(0)
+ ,nCharEscapementHeight(100)
+ ,m_bBackgroundTransparent(sal_True)
+ ,bCharFlash(sal_False)
+ ,bCharAutoKerning(sal_False)
+ ,bCharCombineIsOn(sal_False)
+ ,bCharHidden(sal_False)
+ ,bCharShadowed(sal_False)
+ ,bCharContoured(sal_False)
+{
+ Font aInitFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont();
+ aFontDescriptor = VCLUnoHelper::CreateFontDescriptor(aInitFont);
+ aFontDescriptor.Weight = awt::FontWeight::NORMAL;
+ aFontDescriptor.CharacterWidth = awt::FontWidth::NORMAL;
+ aCharLocale = SvtSysLocale().GetLocaleData().getLocale();
+ //if ( !aFontDescriptor.StyleName.getLength() )
+ // aFontDescriptor.StyleName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test"));
+}
+// -----------------------------------------------------------------------------
+void OReportComponentProperties::setShape(uno::Reference< drawing::XShape >& _xShape,const uno::Reference< report::XReportComponent>& _xTunnel,oslInterlockedCount& _rRefCount)
+{
+ osl_incrementInterlockedCount( &_rRefCount );
+ {
+ // decrement the count from ReportDrawPage.cxx aArgs[0] <<= SvxDrawPage::_CreateShape( pObj );
+ SvxShape* pShape = SvxShape::getImplementation( _xShape );
+ if ( pShape )
+ pShape->release();
+ m_xProxy.set(_xShape,uno::UNO_QUERY);
+ ::comphelper::query_aggregation(m_xProxy,m_xShape);
+ ::comphelper::query_aggregation(m_xProxy,m_xProperty);
+ _xShape.clear();
+ m_xTypeProvider.set(m_xShape,uno::UNO_QUERY);
+ m_xUnoTunnel.set(m_xShape,uno::UNO_QUERY);
+ m_xServiceInfo.set(m_xShape,uno::UNO_QUERY);
+
+ // set ourself as delegator
+ if ( m_xProxy.is() )
+ m_xProxy->setDelegator( _xTunnel );
+ }
+ // do not decrement the refcount again, this will be done from the any ReportDrawPage.cxx aArgs[0] <<= SvxDrawPage::_CreateShape( pObj ); , otherwise it will delete the object
+ //osl_decrementInterlockedCount( &_rRefCount );
+}
+// -----------------------------------------------------------------------------
+void OReportComponentProperties::dispose(oslInterlockedCount& _rRefCount)
+{
+ if ( m_xProxy.is() )
+ osl_decrementInterlockedCount( &_rRefCount );
+ //m_xShape.clear();
+ //m_xTypeProvider.clear();
+ //m_xUnoTunnel.clear();
+ //m_xServiceInfo.clear();
+ //m_xProperty.clear();
+ m_xContext.clear();
+ m_xFactory.clear();
+}
+// -----------------------------------------------------------------------------
+OReportComponentProperties::~OReportComponentProperties()
+{
+ if ( m_xProxy.is() )
+ {
+ m_xProxy->setDelegator( NULL );
+ m_xProxy.clear();
+ }
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
+
diff --git a/reportdesign/source/core/api/ReportControlModel.cxx b/reportdesign/source/core/api/ReportControlModel.cxx
new file mode 100644
index 000000000000..d2968bd58f89
--- /dev/null
+++ b/reportdesign/source/core/api/ReportControlModel.cxx
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportControlModel.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+namespace reportdesign
+{
+using namespace com::sun::star;
+using namespace comphelper;
+
+bool operator==( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs )
+{
+ return ( _lhs.Name == _rhs.Name )
+ && ( _lhs.Height == _rhs.Height )
+ && ( _lhs.Width == _rhs.Width )
+ && ( _lhs.StyleName == _rhs.StyleName )
+ && ( _lhs.Family == _rhs.Family )
+ && ( _lhs.CharSet == _rhs.CharSet )
+ && ( _lhs.Pitch == _rhs.Pitch )
+ && ( _lhs.CharacterWidth == _rhs.CharacterWidth )
+ && ( _lhs.Weight == _rhs.Weight )
+ && ( _lhs.Slant == _rhs.Slant )
+ && ( _lhs.Underline == _rhs.Underline )
+ && ( _lhs.Strikeout == _rhs.Strikeout )
+ && ( _lhs.Orientation == _rhs.Orientation )
+ && ( _lhs.Kerning == _rhs.Kerning )
+ && ( _lhs.WordLineMode == _rhs.WordLineMode )
+ && ( _lhs.Type == _rhs.Type );
+}
+
+// -----------------------------------------------------------------------------
+// XContainer
+void OReportControlModel::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ aContainerListeners.addInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void OReportControlModel::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ aContainerListeners.removeInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool OReportControlModel::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_rMutex);
+ return !m_aFormatConditions.empty();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void OReportControlModel::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Reference<report::XFormatCondition> xElement(Element,uno::UNO_QUERY);
+ if ( !xElement.is() )
+ throw lang::IllegalArgumentException();
+
+ uno::Reference< container::XContainer > xBroadcaster;
+ {
+ ::osl::MutexGuard aGuard(m_rMutex);
+ xBroadcaster = m_pOwner;
+ if ( Index > static_cast<sal_Int32>(m_aFormatConditions.size()) )
+ throw lang::IndexOutOfBoundsException();
+
+ //m_aFormatConditions.resize(m_aFormatConditions.size() + 1);
+ m_aFormatConditions.insert(m_aFormatConditions.begin() + Index,xElement);
+ }
+
+ // notify our container listeners
+ container::ContainerEvent aEvent(xBroadcaster, uno::makeAny(Index), Element, uno::Any());
+ aContainerListeners.notifyEach(&container::XContainerListener::elementInserted,aEvent);
+}
+// -----------------------------------------------------------------------------
+void OReportControlModel::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Any Element;
+ uno::Reference< container::XContainer > xBroadcaster;
+ {
+ ::osl::MutexGuard aGuard(m_rMutex);
+ xBroadcaster = m_pOwner;
+ checkIndex(Index);
+ Element <<= m_aFormatConditions[Index];
+ m_aFormatConditions.erase(m_aFormatConditions.begin() + Index);
+ }
+ container::ContainerEvent aEvent(xBroadcaster, uno::makeAny(Index), Element, uno::Any());
+ aContainerListeners.notifyEach(&container::XContainerListener::elementRemoved,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void OReportControlModel::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Reference<report::XFormatCondition> xElement(Element,uno::UNO_QUERY);
+ if ( !xElement.is() )
+ throw lang::IllegalArgumentException();
+ uno::Reference< container::XContainer > xBroadcaster;
+ {
+ ::osl::MutexGuard aGuard(m_rMutex);
+ xBroadcaster = m_pOwner;
+ checkIndex(Index);
+ m_aFormatConditions[Index] = xElement;
+ }
+ container::ContainerEvent aEvent(xBroadcaster, uno::makeAny(Index), Element, uno::Any());
+ aContainerListeners.notifyEach(&container::XContainerListener::elementReplaced,aEvent);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 OReportControlModel::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_rMutex);
+ return m_aFormatConditions.size();
+}
+// -----------------------------------------------------------------------------
+uno::Any OReportControlModel::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Any aElement;
+ {
+ ::osl::MutexGuard aGuard(m_rMutex);
+ checkIndex(Index);
+ aElement <<= m_aFormatConditions[Index];
+ }
+ return aElement;
+}
+// -----------------------------------------------------------------------------
+void OReportControlModel::checkIndex(sal_Int32 _nIndex)
+{
+ if ( _nIndex < 0 || static_cast<sal_Int32>(m_aFormatConditions.size()) <= _nIndex )
+ throw lang::IndexOutOfBoundsException();
+}
+// -----------------------------------------------------------------------------
+void OReportControlModel::dispose(oslInterlockedCount& _rRefCount)
+{
+ m_aFormatConditions.clear();
+ lang::EventObject aDisposeEvent( m_pOwner );
+ aContainerListeners.disposeAndClear( aDisposeEvent );
+ m_aFormatConditions.clear();
+ aComponent.dispose(_rRefCount);
+}
+// -----------------------------------------------------------------------------
+bool OReportControlModel::isInterfaceForbidden(const uno::Type& _rType)
+{
+ return (_rType == ::getCppuType((const uno::Reference< beans::XPropertyState>* )0) || _rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet>* )0));
+}
+// -----------------------------------------------------------------------------
+} // reportdesign
+
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
new file mode 100644
index 000000000000..314aa3a345bb
--- /dev/null
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -0,0 +1,2456 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportDefinition.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#include "ReportDefinition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_GROUPKEEPTOGETHER_HPP_
+#include <com/sun/star/report/GroupKeepTogether.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_REPORTPRINTOPTION_HPP_
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTION_HPP_
+#include <com/sun/star/report/XFunction.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TABLE_BORDERLINE_HPP_
+#include <com/sun/star/table/BorderLine.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TABLE_SHADOWFORMAT_HPP_
+#include <com/sun/star/table/ShadowFormat.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_PAGESTYLELAYOUT_HPP_
+#include <com/sun/star/style/PageStyleLayout.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_GRAPHICLOCATION_HPP_
+#include <com/sun/star/style/GraphicLocation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_ATTRIBUTEDATA_HPP_
+#include <com/sun/star/xml/AttributeData.hpp>
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef COMPHELPER_PROPERTYSTATECONTAINER_HXX
+#include <comphelper/propertystatecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
+#include <comphelper/proparrhlp.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSTATES_HPP_
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_EVENTOBJECT_HPP_
+#include <com/sun/star/document/EventObject.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
+#include <com/sun/star/document/XEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_
+#include <com/sun/star/style/XStyle.hpp>
+#endif
+#ifndef _COMPHELPER_DOCUMENTCONSTANTS_HXX
+#include <comphelper/documentconstants.hxx>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_EMBEDMAPUNITS_HPP_
+#include <com/sun/star/embed/EmbedMapUnits.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
+#include <com/sun/star/embed/ElementModes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_
+#include <com/sun/star/io/XSeekable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONSTORAGE_HPP_
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
+#include <com/sun/star/document/XExporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
+#include <com/sun/star/document/XImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
+#include <com/sun/star/document/XFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_ERRORCODEIOEXCEPTION_HPP_
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_API_GROUPS_HXX
+#include "Groups.hxx"
+#endif
+#ifndef REPORTDESIGN_API_SECTION_HXX
+#include "Section.hxx"
+#endif
+#include "FixedLine.hxx"
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
+#include <connectivity/CommonTools.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTSETINFO_HXX_
+#include <comphelper/propertysetinfo.hxx>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COMPHELPER_MEDIADESCRIPTOR_HXX_
+#include <comphelper/mediadescriptor.hxx>
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#ifndef REPORTDESIGN_API_FUNCTIONS_HXX
+#include "Functions.hxx"
+#endif
+#include <boost/mem_fn.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#ifndef INCLUDED_SVTOOLS_SAVEOPT_HXX
+#include <svtools/saveopt.hxx>
+#endif
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#ifndef RPT_FORMATTEDFIELD_HXX
+#include "FormattedField.hxx"
+#endif
+#ifndef RPT_FIXEDTEXT_HXX
+#include "FixedText.hxx"
+#endif
+#ifndef RPT_IMAGECONTROL_HXX
+#include "ImageControl.hxx"
+#endif
+#ifndef RPT_SHAPE_HXX
+#include "Shape.hxx"
+#endif
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SVDLAYER_HXX
+#include <svx/svdlayer.hxx>
+#endif
+#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
+#include <cppuhelper/interfacecontainer.h>
+#endif
+#ifndef RPT_REPORTCOMPONENT_HXX
+#include "ReportComponent.hxx"
+#endif
+#ifndef _COM_SUN_STAR_SDB_XOFFICEDATABASEDOCUMENT_HPP_
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_NUMBERINGTYPE_HPP_
+#include <com/sun/star/style/NumberingType.hpp>
+#endif
+
+#define MAP_LEN(x) x, sizeof(x) - 1
+#define MAP_CHAR_LEN(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x))
+// page styles
+#define SC_UNO_PAGE_GRAPHICFILT "BackGraphicFilter"
+#define SC_UNO_PAGE_LEFTBORDER "LeftBorder"
+#define SC_UNO_PAGE_RIGHTBORDER "RightBorder"
+#define SC_UNO_PAGE_BOTTBORDER "BottomBorder"
+#define SC_UNO_PAGE_TOPBORDER "TopBorder"
+#define SC_UNO_PAGE_LEFTBRDDIST "LeftBorderDistance"
+#define SC_UNO_PAGE_RIGHTBRDDIST "RightBorderDistance"
+#define SC_UNO_PAGE_BOTTBRDDIST "BottomBorderDistance"
+#define SC_UNO_PAGE_TOPBRDDIST "TopBorderDistance"
+#define SC_UNO_PAGE_BORDERDIST "BorderDistance"
+#define SC_UNO_PAGE_SHADOWFORM "ShadowFormat"
+#define SC_UNO_PAGE_PAPERTRAY "PrinterPaperTray"
+#define SC_UNO_PAGE_SCALEVAL "PageScale"
+#define SC_UNO_PAGE_SCALETOPAG "ScaleToPages"
+#define SC_UNO_PAGE_SCALETOX "ScaleToPagesX"
+#define SC_UNO_PAGE_SCALETOY "ScaleToPagesY"
+#define SC_UNO_PAGE_FIRSTPAGE "FirstPageNumber"
+#define SC_UNO_PAGE_LEFTHDRCONT "LeftPageHeaderContent"
+#define SC_UNO_PAGE_LEFTFTRCONT "LeftPageFooterContent"
+#define SC_UNO_PAGE_RIGHTHDRCON "RightPageHeaderContent"
+#define SC_UNO_PAGE_RIGHTFTRCON "RightPageFooterContent"
+#define SC_UNO_PAGE_PRINTFORMUL "PrintFormulas"
+#define SC_UNO_PAGE_PRINTZERO "PrintZeroValues"
+#define SC_UNO_PAGE_HDRBACKCOL "HeaderBackColor"
+#define SC_UNO_PAGE_HDRBACKTRAN "HeaderBackTransparent"
+#define SC_UNO_PAGE_HDRGRFFILT "HeaderBackGraphicFilter"
+#define SC_UNO_PAGE_HDRGRFLOC "HeaderBackGraphicLocation"
+#define SC_UNO_PAGE_HDRGRFURL "HeaderBackGraphicURL"
+#define SC_UNO_PAGE_HDRLEFTBOR "HeaderLeftBorder"
+#define SC_UNO_PAGE_HDRRIGHTBOR "HeaderRightBorder"
+#define SC_UNO_PAGE_HDRBOTTBOR "HeaderBottomBorder"
+#define SC_UNO_PAGE_HDRTOPBOR "HeaderTopBorder"
+#define SC_UNO_PAGE_HDRLEFTBDIS "HeaderLeftBorderDistance"
+#define SC_UNO_PAGE_HDRRIGHTBDIS "HeaderRightBorderDistance"
+#define SC_UNO_PAGE_HDRBOTTBDIS "HeaderBottomBorderDistance"
+#define SC_UNO_PAGE_HDRTOPBDIS "HeaderTopBorderDistance"
+#define SC_UNO_PAGE_HDRBRDDIST "HeaderBorderDistance"
+#define SC_UNO_PAGE_HDRSHADOW "HeaderShadowFormat"
+#define SC_UNO_PAGE_HDRLEFTMAR "HeaderLeftMargin"
+#define SC_UNO_PAGE_HDRRIGHTMAR "HeaderRightMargin"
+#define SC_UNO_PAGE_HDRBODYDIST "HeaderBodyDistance"
+#define SC_UNO_PAGE_HDRHEIGHT "HeaderHeight"
+#define SC_UNO_PAGE_HDRON "HeaderIsOn"
+#define SC_UNO_PAGE_HDRDYNAMIC "HeaderIsDynamicHeight"
+#define SC_UNO_PAGE_HDRSHARED "HeaderIsShared"
+#define SC_UNO_PAGE_FTRBACKCOL "FooterBackColor"
+#define SC_UNO_PAGE_FTRBACKTRAN "FooterBackTransparent"
+#define SC_UNO_PAGE_FTRGRFFILT "FooterBackGraphicFilter"
+#define SC_UNO_PAGE_FTRGRFLOC "FooterBackGraphicLocation"
+#define SC_UNO_PAGE_FTRGRFURL "FooterBackGraphicURL"
+#define SC_UNO_PAGE_FTRLEFTBOR "FooterLeftBorder"
+#define SC_UNO_PAGE_FTRRIGHTBOR "FooterRightBorder"
+#define SC_UNO_PAGE_FTRBOTTBOR "FooterBottomBorder"
+#define SC_UNO_PAGE_FTRTOPBOR "FooterTopBorder"
+#define SC_UNO_PAGE_FTRLEFTBDIS "FooterLeftBorderDistance"
+#define SC_UNO_PAGE_FTRRIGHTBDIS "FooterRightBorderDistance"
+#define SC_UNO_PAGE_FTRBOTTBDIS "FooterBottomBorderDistance"
+#define SC_UNO_PAGE_FTRTOPBDIS "FooterTopBorderDistance"
+#define SC_UNO_PAGE_FTRBRDDIST "FooterBorderDistance"
+#define SC_UNO_PAGE_FTRSHADOW "FooterShadowFormat"
+#define SC_UNO_PAGE_FTRLEFTMAR "FooterLeftMargin"
+#define SC_UNO_PAGE_FTRRIGHTMAR "FooterRightMargin"
+#define SC_UNO_PAGE_FTRBODYDIST "FooterBodyDistance"
+#define SC_UNO_PAGE_FTRHEIGHT "FooterHeight"
+#define SC_UNO_PAGE_FTRON "FooterIsOn"
+#define SC_UNO_PAGE_FTRDYNAMIC "FooterIsDynamicHeight"
+#define SC_UNO_PAGE_FTRSHARED "FooterIsShared"
+
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+ using namespace rptui;
+// -----------------------------------------------------------------------------
+// local functions
+// -----------------------------------------------------------------------------
+void lcl_setModelReadOnly(const uno::Reference< embed::XStorage >& _xStorage,::boost::shared_ptr<rptui::OReportModel>& _rModel)
+{
+ uno::Reference<beans::XPropertySet> xProp(_xStorage,uno::UNO_QUERY);
+ sal_Int32 nOpenMode = embed::ElementModes::READ;
+ if ( xProp.is() )
+ xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OpenMode"))) >>= nOpenMode;
+
+ _rModel->SetReadOnly((nOpenMode & embed::ElementModes::WRITE) != embed::ElementModes::WRITE);
+}
+void lcl_stripLoadArguments( ::comphelper::MediaDescriptor& _rDescriptor, uno::Sequence< beans::PropertyValue >& _rArgs )
+{
+ _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StatusIndicator" ) ) );
+ _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InteractionHandler" ) ) );
+ _rDescriptor.erase( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Model" ) ) );
+ _rDescriptor >> _rArgs;
+}
+// -----------------------------------------------------------------------------
+void lcl_extractAndStartStatusIndicator( const ::comphelper::MediaDescriptor& _rDescriptor, uno::Reference< task::XStatusIndicator >& _rxStatusIndicator,
+ uno::Sequence< uno::Any >& _rCallArgs )
+{
+ try
+ {
+ _rxStatusIndicator = _rDescriptor.getUnpackedValueOrDefault( _rDescriptor.PROP_STATUSINDICATOR(), _rxStatusIndicator );
+ if ( _rxStatusIndicator.is() )
+ {
+ _rxStatusIndicator->start( ::rtl::OUString(), (sal_Int32)1000000 );
+
+ sal_Int32 nLength = _rCallArgs.getLength();
+ _rCallArgs.realloc( nLength + 1 );
+ _rCallArgs[ nLength ] <<= _rxStatusIndicator;
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "lcl_extractAndStartStatusIndicator: caught an exception!" );
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface> lcl_createDefault()
+{
+ comphelper::PropertyMapEntry aExportInfoMap[] =
+ {
+ { MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((sal_Bool*)0), beans::PropertyAttribute::MAYBEVOID, 0},
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
+ return xInfoSet.get();
+}
+// -----------------------------------------------------------------------------
+typedef ::comphelper::OPropertyStateContainer OStyle_PBASE;
+class OStyle;
+typedef ::comphelper::OPropertyArrayUsageHelper < OStyle
+ > OStyle_PABASE;
+typedef ::cppu::WeakImplHelper2< style::XStyle, beans::XMultiPropertyStates> TStyleBASE;
+
+class OStyle : public ::comphelper::OMutexAndBroadcastHelper
+ ,public TStyleBASE
+ ,public OStyle_PBASE
+ ,public OStyle_PABASE
+{
+ awt::Size m_aSize;
+
+protected:
+ void getPropertyDefaultByHandle( sal_Int32 _nHandle, uno::Any& _rDefault ) const;
+ ~OStyle(){}
+public:
+ OStyle();
+
+
+ DECLARE_XINTERFACE( )
+
+ // XPropertySet
+ com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(com::sun::star::uno::RuntimeException);
+ ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+ // XStyle
+ ::sal_Bool SAL_CALL isUserDefined( ) throw (uno::RuntimeException);
+ ::sal_Bool SAL_CALL isInUse( ) throw (uno::RuntimeException);
+ ::rtl::OUString SAL_CALL getParentStyle( ) throw (uno::RuntimeException);
+ void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw (container::NoSuchElementException, uno::RuntimeException);
+ // XNamed
+ ::rtl::OUString SAL_CALL getName( ) throw (uno::RuntimeException);
+ void SAL_CALL setName( const ::rtl::OUString& aName ) throw (uno::RuntimeException);
+
+ // XMultiPropertyState
+ uno::Sequence< beans::PropertyState > SAL_CALL getPropertyStates( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+ {
+ return OStyle_PBASE::getPropertyStates(aPropertyNames);
+ }
+ void SAL_CALL setAllPropertiesToDefault( ) throw (uno::RuntimeException);
+ void SAL_CALL setPropertiesToDefault( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, uno::RuntimeException);
+ uno::Sequence< uno::Any > SAL_CALL getPropertyDefaults( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
+};
+// -----------------------------------------------------------------------------
+OStyle::OStyle()
+:OStyle_PBASE(m_aBHelper)
+,m_aSize(21000,29700)
+{
+ const style::GraphicLocation eGraphicLocation = style::GraphicLocation_NONE;
+ const sal_Bool bFalse = sal_False;
+ const sal_Bool bTrue = sal_True;
+ const sal_Int32 nMargin = 2000;
+ //const sal_Int32 nColor = COL_WHITE;
+ const sal_Int32 nTransparent = COL_TRANSPARENT;
+ const sal_Int32 nZero = 0;
+ const sal_Int16 n16Zero = 0;
+ const sal_Int16 nNummeringType = style::NumberingType::ARABIC;
+ const ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("Default"));
+ const ::rtl::OUString sEmpty;
+ const table::BorderLine eBorderLine(0,0,0,0);
+ const table::ShadowFormat eShadowFormat(table::ShadowLocation_NONE,0,0,0);
+ const style::PageStyleLayout ePageStyleLayout = style::PageStyleLayout_ALL;
+ const sal_Int32 nBound = beans::PropertyAttribute::BOUND;
+ const sal_Int32 nMayBeVoid = beans::PropertyAttribute::MAYBEVOID;
+
+ sal_Int32 i = 0;
+ registerPropertyNoMember( PROPERTY_NAME, ++i,nBound,::getCppuType( static_cast< ::rtl::OUString *>(NULL) ), &sName );
+
+ registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_GRAPHICFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+
+ registerPropertyNoMember(PROPERTY_BACKGRAPHICLOCATION, ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation);
+ //registerPropertyNoMember(PROPERTY_BACKGRAPHICURL, ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+ registerPropertyNoMember(PROPERTY_BACKTRANSPARENT, ++i,nBound,::getBooleanCppuType() ,&bTrue);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKCOLOR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BORDERDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(PROPERTY_BOTTOMMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin);
+ registerPropertyNoMember(MAP_CHAR_LEN("DisplayName"), ++i,nBound,::getCppuType((rtl::OUString*)0) ,&sEmpty);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FIRSTPAGE), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero);
+ //
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFLOC), ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFURL), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKTRAN), ++i,nBound,::getBooleanCppuType() ,&bTrue);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBODYDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRHEIGHT), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBDIS),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRSHADOW), ++i,nBound,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBACKCOL), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nTransparent);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFFILT), ++i,nBound|nMayBeVoid,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFLOC), ++i,nBound|nMayBeVoid,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFURL), ++i,nBound|nMayBeVoid,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBACKTRAN), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bTrue);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBODYDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBRDDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRHEIGHT), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRDYNAMIC), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRON), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRSHARED), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRON), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBDIS),++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRSHADOW), ++i,nBound|nMayBeVoid,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero);
+ //
+ registerProperty(PROPERTY_HEIGHT, ++i,nBound,&m_aSize.Height, ::getCppuType((const sal_Int32*)0) );
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKTRANS), ++i,nBound, ::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(PROPERTY_ISLANDSCAPE, ++i,nBound, ::getBooleanCppuType() ,&bFalse);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBORDER), ++i,nBound, ::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBRDDIST), ++i,nBound, ::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(PROPERTY_LEFTMARGIN, ++i,beans::PropertyAttribute::BOUND, ::getCppuType((const sal_Int32*)0) ,&nMargin);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTFTRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTHDRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL);
+ registerPropertyNoMember(PROPERTY_NUMBERINGTYPE, ++i,nBound,::getCppuType((const sal_Int16*)0) ,&nNummeringType);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALEVAL), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero);
+ registerPropertyNoMember(PROPERTY_PAGESTYLELAYOUT, ++i,nBound,::getCppuType((const style::PageStyleLayout*)0) ,&ePageStyleLayout);
+ const ::rtl::OUString sPaperTray(RTL_CONSTASCII_USTRINGPARAM("[From printer settings]"));
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_PAPERTRAY), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sPaperTray);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBRDDIST),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(PROPERTY_RIGHTMARGIN, ++i,beans::PropertyAttribute::BOUND,::getCppuType((const sal_Int32*)0) ,&nMargin);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTFTRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL);
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTHDRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOPAG), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOX), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOY), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SHADOWFORM), ++i,nBound,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat);
+ registerProperty(PROPERTY_PAPERSIZE, ++i,beans::PropertyAttribute::BOUND,&m_aSize,::getCppuType((const awt::Size*)0) );
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine);
+ registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero);
+ registerPropertyNoMember(PROPERTY_TOPMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse);
+ //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse);
+ uno::Reference< container::XNameContainer> xAttribs = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast< xml::AttributeData* >(NULL)));
+ registerPropertyNoMember(MAP_CHAR_LEN("UserDefinedAttributes"), ++i,nBound,::getCppuType((uno::Reference<container::XNameContainer>*)0) ,&xAttribs);
+ registerProperty(PROPERTY_WIDTH, ++i,nBound,&m_aSize.Width,::getCppuType((const sal_Int32*)0) );
+ //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNONAME_WRITING), ++i,nBound,:.getCppuType((sal_Int16*)0) ,&n16Zero);
+ registerPropertyNoMember(MAP_CHAR_LEN("PrinterName"), ++i,nBound,::getCppuType((const ::rtl::OUString*)0),&sEmpty);
+ uno::Sequence<sal_Int8> aSe;
+ registerPropertyNoMember(MAP_CHAR_LEN("PrinterSetup"), ++i,nBound,::getCppuType((const uno::Sequence<sal_Int8>*)0),&aSe);
+
+
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XINTERFACE2(OStyle,TStyleBASE,OStyle_PBASE)
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo> SAL_CALL OStyle::getPropertySetInfo() throw(uno::RuntimeException)
+{
+ return createPropertySetInfo( getInfoHelper() );
+}
+// -----------------------------------------------------------------------------
+void OStyle::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, uno::Any& /*_rDefault*/ ) const
+{
+}
+//-------------------------------------------------------------------------
+::cppu::IPropertyArrayHelper& OStyle::getInfoHelper()
+{
+ return *const_cast<OStyle*>(this)->getArrayHelper();
+}
+//--------------------------------------------------------------------
+::cppu::IPropertyArrayHelper* OStyle::createArrayHelper( ) const
+{
+ uno::Sequence< beans::Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+// -----------------------------------------------------------------------------
+// XStyle
+::sal_Bool SAL_CALL OStyle::isUserDefined( ) throw (uno::RuntimeException)
+{
+ return sal_False;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OStyle::isInUse( ) throw (uno::RuntimeException)
+{
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OStyle::getParentStyle( ) throw (uno::RuntimeException)
+{
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStyle::setParentStyle( const ::rtl::OUString& /*aParentStyle*/ ) throw (container::NoSuchElementException, uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+// XNamed
+::rtl::OUString SAL_CALL OStyle::getName( ) throw (uno::RuntimeException)
+{
+ ::rtl::OUString sName;
+ getPropertyValue(PROPERTY_NAME) >>= sName;
+ return sName;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStyle::setName( const ::rtl::OUString& aName ) throw (uno::RuntimeException)
+{
+ setPropertyValue(PROPERTY_NAME,uno::makeAny(aName));
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStyle::setAllPropertiesToDefault( ) throw (uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStyle::setPropertiesToDefault( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ const ::rtl::OUString* pIter = aPropertyNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aPropertyNames.getLength();
+ for(;pIter != pEnd;++pIter)
+ setPropertyToDefault(*pIter);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< uno::Any > SAL_CALL OStyle::getPropertyDefaults( const uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ uno::Sequence< uno::Any > aRet(aPropertyNames.getLength());
+ const ::rtl::OUString* pIter = aPropertyNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aPropertyNames.getLength();
+ for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
+ aRet[i] = getPropertyDefault(*pIter);
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+struct OReportDefinitionImpl
+{
+ uno::WeakReference< uno::XInterface > m_xParent;
+ ::cppu::OInterfaceContainerHelper m_aStorageChangeListeners;
+ ::cppu::OInterfaceContainerHelper m_aCloseListener;
+ ::cppu::OInterfaceContainerHelper m_aModifyListeners;
+ ::cppu::OInterfaceContainerHelper m_aDocEventListeners;
+ ::std::vector< uno::Reference< frame::XController> > m_aControllers;
+ uno::Sequence< ::rtl::OUString > m_aMasterFields;
+ uno::Sequence< ::rtl::OUString > m_aDetailFields;
+ uno::Sequence< beans::PropertyValue > m_aArgs;
+
+ uno::Reference< report::XGroups > m_xGroups;
+ uno::Reference< report::XSection> m_xReportHeader;
+ uno::Reference< report::XSection> m_xReportFooter;
+ uno::Reference< report::XSection> m_xPageHeader;
+ uno::Reference< report::XSection> m_xPageFooter;
+ uno::Reference< report::XSection> m_xDetail;
+ uno::Reference< embed::XStorage > m_xStorage;
+ uno::Reference< frame::XController > m_xCurrentController;
+ uno::Reference< document::XEventListener > m_xDocEventBroadcaster;
+ uno::Reference< container::XIndexAccess > m_xViewData;
+ uno::Reference< container::XNameAccess > m_xStyles;
+ uno::Reference< report::XFunctions > m_xFunctions;
+ uno::Reference< ui::XUIConfigurationManager> m_xUIConfigurationManager;
+ uno::Reference< util::XNumberFormatsSupplier> m_xNumberFormatsSupplier;
+
+ ::boost::shared_ptr<rptui::OReportModel> m_pReportModel;
+ ::rtl::OUString m_sCaption;
+ ::rtl::OUString m_sCommand;
+ ::rtl::OUString m_sFilter;
+ ::rtl::OUString m_sMimeType;
+ ::rtl::OUString m_sIdentifier;
+ awt::Size m_aVisualAreaSize;
+ ::sal_Int64 m_nAspect;
+ ::sal_Int16 m_nGroupKeepTogether;
+ ::sal_Int16 m_nPageHeaderOption;
+ ::sal_Int16 m_nPageFooterOption;
+ ::sal_Int32 m_nCommandType;
+ sal_Bool m_bControllersLocked;
+ sal_Bool m_bModified;
+ sal_Bool m_bEscapeProcessing;
+ OReportDefinitionImpl(::osl::Mutex& _aMutex)
+ :m_aStorageChangeListeners(_aMutex)
+ ,m_aCloseListener(_aMutex)
+ ,m_aModifyListeners(_aMutex)
+ ,m_aDocEventListeners(_aMutex)
+ ,m_sMimeType(MIMETYPE_OASIS_OPENDOCUMENT_TEXT)
+ ,m_sIdentifier(SERVICE_REPORTDEFINITION)
+ ,m_nGroupKeepTogether(0)
+ ,m_nPageHeaderOption(0)
+ ,m_nPageFooterOption(0)
+ ,m_nCommandType(sdb::CommandType::TABLE)
+ ,m_bControllersLocked(sal_False)
+ ,m_bModified(sal_False)
+ ,m_bEscapeProcessing(sal_True)
+ {}
+
+ OReportDefinitionImpl(::osl::Mutex& _aMutex,const OReportDefinitionImpl& _aCopy)
+ :m_aStorageChangeListeners(_aMutex)
+ ,m_aCloseListener(_aMutex)
+ ,m_aModifyListeners(_aMutex)
+ ,m_aDocEventListeners(_aMutex)
+ ,m_sMimeType(_aCopy.m_sMimeType)
+ ,m_sIdentifier(_aCopy.m_sIdentifier)
+ ,m_nGroupKeepTogether(_aCopy.m_nGroupKeepTogether)
+ ,m_nPageHeaderOption(_aCopy.m_nPageHeaderOption)
+ ,m_nPageFooterOption(_aCopy.m_nPageFooterOption)
+ ,m_nCommandType(_aCopy.m_nCommandType)
+ ,m_bControllersLocked(_aCopy.m_bControllersLocked)
+ ,m_bModified(_aCopy.m_bModified)
+ ,m_bEscapeProcessing(_aCopy.m_bEscapeProcessing)
+ {}
+};
+
+DBG_NAME( rpt_OReportDefinition )
+// -----------------------------------------------------------------------------
+OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext)
+: ReportDefinitionBase(m_aMutex)
+,ReportDefinitionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_aProps(new OReportComponentProperties(_xContext))
+,m_pImpl(new OReportDefinitionImpl(m_aMutex))
+{
+ DBG_CTOR( rpt_OReportDefinition,NULL);
+ m_aProps->m_sName = RPT_RESSTRING(RID_STR_REPORT,m_aProps->m_xContext->getServiceManager());
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ init();
+ m_pImpl->m_xGroups = new OGroups(this,m_aProps->m_xContext);
+ m_pImpl->m_xDetail = new OSection(this,m_aProps->m_xContext);
+ m_pImpl->m_xDetail->setName(RPT_RESSTRING(RID_STR_DETAIL,m_aProps->m_xContext->getServiceManager()));
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+: ReportDefinitionBase(m_aMutex)
+,ReportDefinitionPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_aProps(new OReportComponentProperties(_xContext))
+,m_pImpl(new OReportDefinitionImpl(m_aMutex))
+{
+ DBG_CTOR( rpt_OReportDefinition,NULL);
+ m_aProps->m_sName = RPT_RESSTRING(RID_STR_REPORT,m_aProps->m_xContext->getServiceManager());
+ m_aProps->m_xFactory = _xFactory;
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ m_aProps->setShape(_xShape,this,m_refCount);
+ init();
+ m_pImpl->m_xGroups = new OGroups(this,m_aProps->m_xContext);
+ m_pImpl->m_xDetail = new OSection(this,m_aProps->m_xContext);
+ m_pImpl->m_xDetail->setName(RPT_RESSTRING(RID_STR_DETAIL,m_aProps->m_xContext->getServiceManager()));
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OReportDefinition::OReportDefinition(const OReportDefinition& _rCopy)
+: cppu::BaseMutex()
+,ReportDefinitionBase(m_aMutex)
+,ReportDefinitionPropertySet(_rCopy.m_aProps->m_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_aProps(new OReportComponentProperties(*_rCopy.m_aProps))
+,m_pImpl(new OReportDefinitionImpl(m_aMutex,*_rCopy.m_pImpl))
+{
+ DBG_CTOR( rpt_OReportDefinition,NULL);
+ osl_incrementInterlockedCount(&m_refCount);
+ {
+ init();
+ OGroups* pGroups = new OGroups(this,m_aProps->m_xContext);
+ m_pImpl->m_xGroups = pGroups;
+ pGroups->copyGroups(_rCopy.m_pImpl->m_xGroups);
+ m_pImpl->m_xDetail = new OSection(this,m_aProps->m_xContext);
+ OSection::lcl_copySection(_rCopy.m_pImpl->m_xDetail,m_pImpl->m_xDetail);
+
+ setPageHeaderOn(_rCopy.m_pImpl->m_xPageHeader.is());
+ setPageFooterOn(_rCopy.m_pImpl->m_xPageFooter.is());
+ setReportHeaderOn(_rCopy.m_pImpl->m_xReportHeader.is());
+ setReportFooterOn(_rCopy.m_pImpl->m_xReportFooter.is());
+ OSection::lcl_copySection(_rCopy.m_pImpl->m_xPageHeader,m_pImpl->m_xPageHeader);
+ OSection::lcl_copySection(_rCopy.m_pImpl->m_xPageFooter,m_pImpl->m_xPageFooter);
+ OSection::lcl_copySection(_rCopy.m_pImpl->m_xReportHeader,m_pImpl->m_xReportHeader);
+ OSection::lcl_copySection(_rCopy.m_pImpl->m_xReportFooter,m_pImpl->m_xReportFooter);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OReportDefinition::~OReportDefinition()
+{
+ DBG_DTOR( rpt_OReportDefinition,NULL);
+ if ( !ReportDefinitionBase::rBHelper.bInDispose && !ReportDefinitionBase::rBHelper.bDisposed )
+ {
+ acquire();
+ dispose();
+ }
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_REFCOUNT( OReportDefinition, ReportDefinitionBase )
+//IMPLEMENT_FORWARD_XINTERFACE2(OReportDefinition,ReportDefinitionBase,ReportDefinitionPropertySet)
+void OReportDefinition::init()
+{
+ try
+ {
+ m_pImpl->m_pReportModel.reset(new OReportModel());
+ m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
+ m_pImpl->m_pReportModel->SetScaleUnit( MAP_100TH_MM );
+ SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
+ rAdmin.NewStandardLayer();
+ rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ) );
+ m_pImpl->m_xDocEventBroadcaster.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")),m_aProps->m_xContext),
+ uno::UNO_QUERY);
+ m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext);
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!");
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::dispose() throw(uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ m_aProps->dispose(m_refCount);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::disposing()
+{
+ m_pImpl->m_aControllers.clear();
+ uno::Reference< frame::XModel > xHoldAlive( this );
+ {
+ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
+
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
+ m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
+
+ m_pImpl->m_xDocEventBroadcaster.clear();
+
+ ::comphelper::disposeComponent(m_pImpl->m_xGroups);
+ ::comphelper::disposeComponent(m_pImpl->m_xReportHeader);
+ ::comphelper::disposeComponent(m_pImpl->m_xReportFooter);
+ ::comphelper::disposeComponent(m_pImpl->m_xPageHeader);
+ ::comphelper::disposeComponent(m_pImpl->m_xPageFooter);
+ ::comphelper::disposeComponent(m_pImpl->m_xDetail);
+ ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
+ //::comphelper::disposeComponent(m_pImpl->m_xStorage);
+ // don't dispose, this currently is the task of either the ref count going to
+ // 0, or of the embedded object (if we're embedded, which is the only possible
+ // case so far)
+ // #i78366# / 2007-06-18 / frank.schoenheit@sun.com
+ m_pImpl->m_xStorage.clear();
+ m_pImpl->m_xViewData.clear();
+ m_pImpl->m_xCurrentController.clear();
+ m_pImpl->m_xNumberFormatsSupplier.clear();
+ m_pImpl->m_xStyles.clear();
+ m_pImpl->m_xUIConfigurationManager.clear();
+ m_pImpl->m_pReportModel.reset();
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportDefinition::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OReportDefinition"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OReportDefinition::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_REPORTDEFINITION;
+
+ return aServices;
+}
+// --------------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ // first collect the services which are supported by our aggregate
+ uno::Sequence< ::rtl::OUString > aSupported;
+ if ( m_aProps->m_xServiceInfo.is() )
+ aSupported = m_aProps->m_xServiceInfo->getSupportedServiceNames();
+
+ // append our own service, if necessary
+ if ( 0 == ::comphelper::findValue( aSupported, SERVICE_REPORTDEFINITION, sal_True ).getLength() )
+ {
+ sal_Int32 nLen = aSupported.getLength();
+ aSupported.realloc( nLen + 1 );
+ aSupported[ nLen ] = SERVICE_REPORTDEFINITION;
+ }
+
+ // outta here
+ return aSupported;
+}
+
+// --------------------------------------------------------------------------------
+sal_Bool SAL_CALL OReportDefinition::supportsService( const ::rtl::OUString& _rServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::findValue( getSupportedServiceNames(), _rServiceName, sal_True ).getLength() != 0;
+}
+
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OReportDefinition::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ReportDefinitionBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = ReportDefinitionPropertySet::queryInterface(_rType);
+
+ return aReturn.hasValue() ? aReturn : (m_aProps->m_xProxy.is() ? m_aProps->m_xProxy->queryAggregation(_rType) : aReturn);
+}
+// --------------------------------------------------------------------------------
+uno::Sequence< uno::Type > SAL_CALL OReportDefinition::getTypes( ) throw (uno::RuntimeException)
+{
+ if ( m_aProps->m_xTypeProvider.is() )
+ return ::comphelper::concatSequences(
+ ReportDefinitionBase::getTypes(),
+ m_aProps->m_xTypeProvider->getTypes()
+ );
+ return ReportDefinitionBase::getTypes();
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OReportDefinition::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OReportDefinition(xContext));
+}
+
+// -----------------------------------------------------------------------------
+// XReportDefinition
+::rtl::OUString SAL_CALL OReportDefinition::getCaption() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_sCaption;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_CAPTION,_caption,m_pImpl->m_sCaption);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OReportDefinition::getGroupKeepTogether() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_nGroupKeepTogether;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setGroupKeepTogether( ::sal_Int16 _groupkeeptogether ) throw (uno::RuntimeException)
+{
+ if ( _groupkeeptogether < report::GroupKeepTogether::PER_PAGE || _groupkeeptogether > report::GroupKeepTogether::PER_COLUMN )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::GroupKeepTogether"))
+ ,*this
+ ,1
+ ,m_aProps->m_xContext);
+ set(PROPERTY_GROUPKEEPTOGETHER,_groupkeeptogether,m_pImpl->m_nGroupKeepTogether);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OReportDefinition::getPageHeaderOption() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_nPageHeaderOption;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPageHeaderOption( ::sal_Int16 _pageheaderoption ) throw (uno::RuntimeException)
+{
+ if ( _pageheaderoption < report::ReportPrintOption::ALL_PAGES || _pageheaderoption > report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::ReportPrintOption"))
+ ,*this
+ ,1
+ ,m_aProps->m_xContext);
+ set(PROPERTY_PAGEHEADEROPTION,_pageheaderoption,m_pImpl->m_nPageHeaderOption);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OReportDefinition::getPageFooterOption() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_nPageFooterOption;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPageFooterOption( ::sal_Int16 _pagefooteroption ) throw (uno::RuntimeException)
+{
+ if ( _pagefooteroption < report::ReportPrintOption::ALL_PAGES || _pagefooteroption > report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::ReportPrintOption"))
+ ,*this
+ ,1
+ ,m_aProps->m_xContext);
+ set(PROPERTY_PAGEFOOTEROPTION,_pagefooteroption,m_pImpl->m_nPageFooterOption);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getMasterFields() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_aMasterFields;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setMasterFields( const uno::Sequence< ::rtl::OUString >& _masterfields ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_MASTERFIELDS,_masterfields,m_pImpl->m_aMasterFields);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getDetailFields() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_aDetailFields;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setDetailFields( const uno::Sequence< ::rtl::OUString >& _detailfields ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_DETAILFIELDS,_detailfields,m_pImpl->m_aDetailFields);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getCommand() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_sCommand;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setCommand( const ::rtl::OUString& _command ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_COMMAND,_command,m_pImpl->m_sCommand);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getCommandType() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_nCommandType;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setCommandType( ::sal_Int32 _commandtype ) throw (uno::RuntimeException)
+{
+ if ( _commandtype < sdb::CommandType::TABLE || _commandtype > sdb::CommandType::COMMAND )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::sdb::CommandType"))
+ ,*this
+ ,1
+ ,m_aProps->m_xContext);
+ set(PROPERTY_COMMANDTYPE,_commandtype,m_pImpl->m_nCommandType);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getFilter() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_sFilter;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setFilter( const ::rtl::OUString& _filter ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_FILTER,_filter,m_pImpl->m_sFilter);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getEscapeProcessing() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_bEscapeProcessing;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setEscapeProcessing( ::sal_Bool _escapeprocessing ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_ESCAPEPROCESSING,_escapeprocessing,m_pImpl->m_bEscapeProcessing);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getReportHeaderOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xReportHeader.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setReportHeaderOn( ::sal_Bool _reportheaderon ) throw (uno::RuntimeException)
+{
+ if ( _reportheaderon != m_pImpl->m_xReportHeader.is() )
+ {
+ setSection(PROPERTY_REPORTHEADERON,_reportheaderon,RPT_RESSTRING(RID_STR_REPORT_HEADER,m_aProps->m_xContext->getServiceManager()),m_pImpl->m_xReportHeader);
+ }
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getReportFooterOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xReportFooter.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setReportFooterOn( ::sal_Bool _reportfooteron ) throw (uno::RuntimeException)
+{
+ if ( _reportfooteron != m_pImpl->m_xReportFooter.is() )
+ {
+ setSection(PROPERTY_REPORTFOOTERON,_reportfooteron,RPT_RESSTRING(RID_STR_REPORT_FOOTER,m_aProps->m_xContext->getServiceManager()),m_pImpl->m_xReportFooter);
+ }
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getPageHeaderOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xPageHeader.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPageHeaderOn( ::sal_Bool _pageheaderon ) throw (uno::RuntimeException)
+{
+ if ( _pageheaderon != m_pImpl->m_xPageHeader.is() )
+ {
+ setSection(PROPERTY_PAGEHEADERON,_pageheaderon,RPT_RESSTRING(RID_STR_PAGE_HEADER,m_aProps->m_xContext->getServiceManager()),m_pImpl->m_xPageHeader);
+ }
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getPageFooterOn() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xPageFooter.is();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPageFooterOn( ::sal_Bool _pagefooteron ) throw (uno::RuntimeException)
+{
+ if ( _pagefooteron != m_pImpl->m_xPageFooter.is() )
+ {
+ setSection(PROPERTY_PAGEFOOTERON,_pagefooteron,RPT_RESSTRING(RID_STR_PAGE_FOOTER,m_aProps->m_xContext->getServiceManager()),m_pImpl->m_xPageFooter);
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XGroups > SAL_CALL OReportDefinition::getGroups() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xGroups;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getReportHeader() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_pImpl->m_xReportHeader.is() )
+ throw container::NoSuchElementException();
+ return m_pImpl->m_xReportHeader;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getPageHeader() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_pImpl->m_xPageHeader.is() )
+ throw container::NoSuchElementException();
+ return m_pImpl->m_xPageHeader;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getDetail() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xDetail;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getPageFooter() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_pImpl->m_xPageFooter.is() )
+ throw container::NoSuchElementException();
+ return m_pImpl->m_xPageFooter;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getReportFooter() throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_pImpl->m_xReportFooter.is() )
+ throw container::NoSuchElementException();
+ return m_pImpl->m_xReportFooter;
+}
+//------------------------------------------------------------------------------
+uno::Reference< document::XEventBroadcaster > SAL_CALL OReportDefinition::getEventBroadcaster( ) throw (lang::DisposedException, uno::Exception, uno::RuntimeException)
+{
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return this;
+}
+//------------------------------------------------------------------------------
+// XReportComponent
+::rtl::OUString SAL_CALL OReportDefinition::getName() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps->m_sName;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException,beans::PropertyVetoException)
+{
+ set(PROPERTY_NAME,_name,m_aProps->m_sName);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getHeight() throw (uno::RuntimeException)
+{
+ return getSize().Height;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeException)
+{
+ awt::Size aSize = getSize();
+ aSize.Height = _height;
+ setSize(aSize);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getPositionX() throw (uno::RuntimeException)
+{
+ return getPosition().X;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPositionX( ::sal_Int32 _positionx ) throw (uno::RuntimeException)
+{
+ awt::Point aPos = getPosition();
+ aPos.X = _positionx;
+ setPosition(aPos);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getPositionY() throw (uno::RuntimeException)
+{
+ return getPosition().Y;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPositionY( ::sal_Int32 _positiony ) throw (uno::RuntimeException)
+{
+ awt::Point aPos = getPosition();
+ aPos.Y = _positiony;
+ setPosition(aPos);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getWidth() throw (uno::RuntimeException)
+{
+ return getSize().Width;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException)
+{
+ awt::Size aSize = getSize();
+ aSize.Width = _width;
+ setSize(aSize);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OReportDefinition::getControlBorder() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps->m_nBorder;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setControlBorder( ::sal_Int16 _border ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONTROLBORDER,_border,m_aProps->m_nBorder);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps->m_nBorderColor;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setControlBorderColor( ::sal_Int32 _bordercolor ) throw (beans::UnknownPropertyException,lang::IllegalArgumentException,uno::RuntimeException)
+{
+ set(PROPERTY_CONTROLBORDERCOLOR,_bordercolor,m_aProps->m_nBorderColor);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps->m_bPrintRepeatedValues;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPrintRepeatedValues( ::sal_Bool _printrepeatedvalues ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTREPEATEDVALUES,_printrepeatedvalues,m_aProps->m_bPrintRepeatedValues);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > SAL_CALL OReportDefinition::getSection() throw (uno::RuntimeException)
+{
+ uno::Reference< container::XChild > xParent(getParent( ),uno::UNO_QUERY);
+ return lcl_getSection(xParent);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OReportDefinition::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return ReportDefinitionPropertySet::getPropertySetInfo();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OReportDefinition::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return ReportDefinitionPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getParent( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< container::XChild > xChild;
+ comphelper::query_aggregation(m_aProps->m_xProxy,xChild);
+ if ( xChild.is() )
+ return xChild->getParent();
+ return m_pImpl->m_xParent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps->m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
+ m_pImpl->m_xParent = Parent;
+ uno::Reference< container::XChild > xChild;
+ comphelper::query_aggregation(m_aProps->m_xProxy,xChild);
+ if ( xChild.is() )
+ xChild->setParent(Parent);
+}
+// -----------------------------------------------------------------------------
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OReportDefinition::createClone( ) throw (uno::RuntimeException)
+{
+ OSL_ENSURE(0,"Not yet implemented correctly");
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XReportDefinition> xSet(cloneObject(xSource,m_aProps->m_xFactory,SERVICE_REPORTDEFINITION),uno::UNO_QUERY_THROW);
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+void OReportDefinition::setSection( const ::rtl::OUString& _sProperty
+ ,const sal_Bool& _bOn
+ ,const ::rtl::OUString& _sName
+ ,uno::Reference< report::XSection>& _member)
+{
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, uno::makeAny(_member), uno::makeAny(_bOn), &l);
+ lcl_createSectionIfNeeded(_bOn ,this,_member,_sProperty == PROPERTY_PAGEHEADERON || _sProperty == PROPERTY_PAGEFOOTERON);
+ if ( _member.is() )
+ _member->setName(_sName);
+ }
+ l.notify();
+}
+// -----------------------------------------------------------------------------
+// XCloseBroadcaster
+void SAL_CALL OReportDefinition::addCloseListener( const uno::Reference< util::XCloseListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( _xListener.is() )
+ m_pImpl->m_aCloseListener.addInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removeCloseListener( const uno::Reference< util::XCloseListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aCloseListener.removeInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+// XCloseable
+void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException)
+{
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ // notify our container listeners
+ lang::EventObject aEvt( static_cast< ::cppu::OWeakObject* >( this ) );
+ aGuard.clear();
+ m_pImpl->m_aCloseListener.forEach<util::XCloseListener>(
+ ::boost::bind(&util::XCloseListener::queryClosing,_1,boost::cref(aEvt),boost::cref(_bDeliverOwnership)));
+ aGuard.reset();
+
+
+ ::std::vector< uno::Reference< frame::XController> > aCopy = m_pImpl->m_aControllers;
+ ::std::vector< uno::Reference< frame::XController> >::iterator aIter = aCopy.begin();
+ ::std::vector< uno::Reference< frame::XController> >::iterator aEnd = aCopy.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ if ( aIter->is() )
+ {
+ try
+ {
+ uno::Reference< util::XCloseable> xFrame( (*aIter)->getFrame(), uno::UNO_QUERY );
+ if ( xFrame.is() )
+ xFrame->close( _bDeliverOwnership );
+ }
+ catch( const util::CloseVetoException& ) { throw; }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" );
+ }
+ }
+ }
+
+ aGuard.clear();
+ m_pImpl->m_aCloseListener.notifyEach(&util::XCloseListener::notifyClosing,aEvt);
+ aGuard.reset();
+
+ dispose();
+}
+// -----------------------------------------------------------------------------
+// XModel
+::sal_Bool SAL_CALL OReportDefinition::attachResource( const ::rtl::OUString& /*_rURL*/, const uno::Sequence< beans::PropertyValue >& _aArguments ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ ::comphelper::MediaDescriptor aDescriptor( _aArguments );
+ fillArgs(aDescriptor);
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+void OReportDefinition::fillArgs(::comphelper::MediaDescriptor& _aDescriptor)
+{
+ uno::Sequence<beans::PropertyValue> aComponentData;
+ aComponentData = _aDescriptor.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ComponentData")),aComponentData);
+ if ( aComponentData.getLength() )
+ {
+ ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData );
+ uno::Reference<sdbc::XConnection> xConnection;
+ xConnection = aComponentDataMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),xConnection);
+ m_pImpl->m_xNumberFormatsSupplier = dbtools::getNumberFormats(xConnection);
+ }
+ lcl_stripLoadArguments( _aDescriptor, m_pImpl->m_aArgs );
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getURL( ) throw (uno::RuntimeException)
+{
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< beans::PropertyValue > SAL_CALL OReportDefinition::getArgs( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_aArgs;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::connectController( const uno::Reference< frame::XController >& _xController ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aControllers.push_back(_xController);
+ sal_Int32 nCount;
+ if ( _xController.is() && m_pImpl->m_xViewData.is() && ( nCount = m_pImpl->m_xViewData->getCount()) != 0)
+ {
+ _xController->restoreViewData(m_pImpl->m_xViewData->getByIndex(nCount - 1));
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::disconnectController( const uno::Reference< frame::XController >& _xController ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ ::std::vector< uno::Reference< frame::XController> >::iterator aFind = ::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController);
+ if ( aFind != m_pImpl->m_aControllers.end() )
+ m_pImpl->m_aControllers.erase(aFind);
+ if ( m_pImpl->m_xCurrentController == _xController )
+ m_pImpl->m_xCurrentController.clear();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::lockControllers( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_bControllersLocked = sal_True;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::unlockControllers( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_bControllersLocked = sal_False;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::hasControllersLocked( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_bControllersLocked;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XController > SAL_CALL OReportDefinition::getCurrentController( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_xCurrentController;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setCurrentController( const uno::Reference< frame::XController >& _xController ) throw (container::NoSuchElementException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( ::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController) == m_pImpl->m_aControllers.end() )
+ throw container::NoSuchElementException();
+ m_pImpl->m_xCurrentController = _xController;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getCurrentSelection( ) throw (uno::RuntimeException)
+{
+ return uno::Reference< uno::XInterface >();
+}
+// -----------------------------------------------------------------------------
+
+// XStorageBasedDocument
+void SAL_CALL OReportDefinition::loadFromStorage( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom
+ , const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor ) throw (lang::IllegalArgumentException, frame::DoubleInitializationException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ m_pImpl->m_xStorage = _xStorageToLoadFrom;
+
+ ::comphelper::MediaDescriptor aDescriptor( _aMediaDescriptor );
+ fillArgs(aDescriptor);
+ aDescriptor.createItemIfMissing(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage")),uno::makeAny(_xStorageToLoadFrom));
+
+ uno::Sequence< uno::Any > aDelegatorArguments(_aMediaDescriptor.getLength());
+ uno::Any* pIter = aDelegatorArguments.getArray();
+ uno::Any* pEnd = pIter + aDelegatorArguments.getLength();
+ for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
+ {
+ *pIter <<= _aMediaDescriptor[i];
+ }
+ sal_Int32 nPos = aDelegatorArguments.getLength();
+ aDelegatorArguments.realloc(nPos+1);
+ beans::PropertyValue aPropVal;
+ aPropVal.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
+ aPropVal.Value <<= _xStorageToLoadFrom;
+ aDelegatorArguments[nPos] <<= aPropVal;
+
+ uno::Reference< document::XFilter > xFilter(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OReportFilter")),aDelegatorArguments,m_aProps->m_xContext),
+ uno::UNO_QUERY_THROW );
+
+ uno::Reference< document::XImporter> xImporter(xFilter,uno::UNO_QUERY_THROW);
+ uno::Reference<XComponent> xComponent(static_cast<OWeakObject*>(this),uno::UNO_QUERY);
+ xImporter->setTargetDocument(xComponent);
+
+ ::comphelper::MediaDescriptor aTemp;
+ aTemp << aDelegatorArguments;
+ xFilter->filter(aTemp.getAsConstPropertyValueList());
+
+ lcl_setModelReadOnly(m_pImpl->m_xStorage,m_pImpl->m_pReportModel);
+ //LLA: if read only, try to load writer
+ // sal_Bool bIsReadOnly = aTemp.getUnpackedValueOrDefault(MediaDescriptor::PROP_READONLY(), sal_False);
+ // if (bIsReadOnly)
+ // {
+ // // try to open the writer
+ // bIsReadOnly = sal_True;
+ // }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XStorage >& _xStorageToSaveTo, const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor ) throw (lang::IllegalArgumentException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+ if ( !_xStorageToSaveTo.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_aProps->m_xContext->getServiceManager()),*this,1);
+
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ // create XStatusIndicator
+ uno::Reference<task::XStatusIndicator> xStatusIndicator;
+ uno::Sequence< uno::Any > aDelegatorArguments;
+ ::comphelper::MediaDescriptor aDescriptor( _aMediaDescriptor );
+ lcl_extractAndStartStatusIndicator( aDescriptor, xStatusIndicator, aDelegatorArguments );
+
+ // properties
+ uno::Sequence < beans::PropertyValue > aProps;
+
+ // export sub streams for package, else full stream into a file
+ sal_Bool bWarn = sal_False, bErr = sal_False;
+ ::rtl::OUString sWarnFile, sErrFile;
+
+ uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY);
+ if ( xProp.is() )
+ {
+ static const ::rtl::OUString sPropName(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ ::rtl::OUString sOldMediaType;
+ xProp->getPropertyValue(sPropName) >>= sOldMediaType;
+ if ( !xProp->getPropertyValue(sPropName).hasValue() || !sOldMediaType.getLength() )
+ xProp->setPropertyValue( sPropName, uno::makeAny(MIMETYPE_OASIS_OPENDOCUMENT_REPORT) );
+ }
+
+ /** property map for export info set */
+ comphelper::PropertyMapEntry aExportInfoMap[] =
+ {
+ { MAP_LEN( "UsePrettyPrinting" ), 0, &::getCppuType((sal_Bool*)0), beans::PropertyAttribute::MAYBEVOID, 0},
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
+
+ SvtSaveOptions aSaveOpt;
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")), uno::makeAny(aSaveOpt.IsPrettyPrinting()));
+ sal_Int32 nArgsLen = aDelegatorArguments.getLength();
+ aDelegatorArguments.realloc(nArgsLen+1);
+ aDelegatorArguments[nArgsLen] <<= xInfoSet;
+
+ uno::Reference<XComponent> xCom(static_cast<OWeakObject*>(this),uno::UNO_QUERY);
+ if( !bErr )
+ {
+ if( !WriteThroughComponent(
+ xCom, "settings.xml",
+ "com.sun.star.comp.report.XMLSettingsExporter",
+ aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) )
+ {
+ if( !bWarn )
+ {
+ bWarn = sal_True;
+ sWarnFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml"));
+ }
+ }
+ }
+
+ if( !bErr )
+ {
+ if( !WriteThroughComponent(
+ xCom, "styles.xml",
+ "com.sun.star.comp.report.XMLStylesExporter",
+ aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) )
+ {
+ if( !bWarn )
+ {
+ bWarn = sal_True;
+ sWarnFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("styles.xml"));
+ }
+ }
+ }
+
+ if ( !bErr )
+ {
+ if( !WriteThroughComponent(
+ xCom, "content.xml",
+ "com.sun.star.comp.report.ExportFilter",
+ aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) )
+ {
+ bErr = sal_True;
+ sErrFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"));
+ }
+ }
+
+
+ if ( xStatusIndicator.is() )
+ xStatusIndicator->end();
+ if ( !bErr )
+ {
+ try
+ {
+ uno::Reference<embed::XTransactedObject> xTransact(_xStorageToSaveTo,uno::UNO_QUERY);
+ if ( xTransact.is() )
+ xTransact->commit();
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Exception Caught: Could not commit report storage!");
+ throw io::IOException();
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::switchToStorage( const uno::Reference< embed::XStorage >& _xStorage ) throw (lang::IllegalArgumentException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+ if ( !_xStorage.is() )
+ throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_aProps->m_xContext->getServiceManager()),*this,1);
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_xStorage = _xStorage;
+ lcl_setModelReadOnly(m_pImpl->m_xStorage,m_pImpl->m_pReportModel);
+ }
+ // notify our container listeners
+ m_pImpl->m_aStorageChangeListeners.forEach<document::XStorageChangeListener>(
+ ::boost::bind(&document::XStorageChangeListener::notifyStorageChange,_1,boost::cref(static_cast<OWeakObject*>(this)),boost::cref(_xStorage)));
+}
+// -----------------------------------------------------------------------------
+uno::Reference< embed::XStorage > SAL_CALL OReportDefinition::getDocumentStorage( ) throw (io::IOException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_xStorage;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::addStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( xListener.is() )
+ m_pImpl->m_aStorageChangeListeners.addInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removeStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aStorageChangeListeners.removeInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportDefinition::WriteThroughComponent(
+ const uno::Reference<lang::XComponent> & xComponent,
+ const sal_Char* pStreamName,
+ const sal_Char* pServiceName,
+ const uno::Sequence<uno::Any> & rArguments,
+ const uno::Sequence<beans::PropertyValue> & rMediaDesc,
+ sal_Bool bPlainStream
+ ,const uno::Reference<embed::XStorage>& _xStorageToSaveTo)
+{
+ OSL_ENSURE( NULL != pStreamName, "Need stream name!" );
+ OSL_ENSURE( NULL != pServiceName, "Need service name!" );
+ try
+ {
+ uno::Reference<embed::XStorage> xMyStorage = _xStorageToSaveTo;
+ // open stream
+ ::rtl::OUString sStreamName = ::rtl::OUString::createFromAscii( pStreamName );
+ uno::Reference<io::XStream> xStream = xMyStorage->openStreamElement( sStreamName,embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
+ if ( !xStream.is() )
+ return sal_False;
+ uno::Reference<io::XOutputStream> xOutputStream = xStream->getOutputStream();
+ OSL_ENSURE(xOutputStream.is(), "Can't create output stream in package!");
+ if ( ! xOutputStream.is() )
+ return sal_False;
+
+ uno::Reference<beans::XPropertySet> xStreamProp(xOutputStream,uno::UNO_QUERY);
+ OSL_ENSURE(xStreamProp.is(),"No valid preoperty set for the output stream!");
+
+ uno::Reference<io::XSeekable> xSeek(xStreamProp,uno::UNO_QUERY);
+ if ( xSeek.is() )
+ {
+ OSL_TRACE("Length of stream %i",(int)xSeek->getPosition());
+ xSeek->seek(0);
+ }
+
+ ::rtl::OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ ::rtl::OUString aMime( RTL_CONSTASCII_USTRINGPARAM("text/xml") );
+ uno::Any aAny;
+ aAny <<= aMime;
+ xStreamProp->setPropertyValue( aPropName, aAny );
+
+ if( bPlainStream )
+ {
+ aAny <<= sal_False;
+ xStreamProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Compressed") ), aAny );
+ }
+ else
+ {
+ xStreamProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ), uno::makeAny(sal_True) );
+ }
+
+
+ // set buffer and create outputstream
+
+ // write the stuff
+ sal_Bool bRet = WriteThroughComponent(
+ xOutputStream, xComponent,
+ pServiceName, rArguments, rMediaDesc );
+ // finally, commit stream.
+ return bRet;
+ }
+ catch(const uno::Exception& e)
+ {
+ (void)e; // helper to know what e contains
+ throw;
+ }
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportDefinition::WriteThroughComponent(
+ const uno::Reference<io::XOutputStream> & xOutputStream,
+ const uno::Reference<lang::XComponent> & xComponent,
+ const sal_Char* pServiceName,
+ const uno::Sequence<uno::Any> & rArguments,
+ const uno::Sequence<beans::PropertyValue> & rMediaDesc)
+{
+ OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
+ OSL_ENSURE( xComponent.is(), "Need component!" );
+ OSL_ENSURE( NULL != pServiceName, "Need component name!" );
+
+ // get component
+ uno::Reference< io::XActiveDataSource > xSaxWriter(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")),m_aProps->m_xContext),
+ uno::UNO_QUERY );
+ OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML com.sun.star.xml.sax.Writer" );
+ if(!xSaxWriter.is())
+ return sal_False;
+
+ // connect XML writer to output stream
+ xSaxWriter->setOutputStream( xOutputStream );
+
+ // prepare arguments (prepend doc handler to given arguments)
+ uno::Reference<xml::sax::XDocumentHandler> xDocHandler( xSaxWriter,uno::UNO_QUERY);
+ uno::Sequence<uno::Any> aArgs( 1 + rArguments.getLength() );
+ aArgs[0] <<= xDocHandler;
+ for(sal_Int32 i = 0; i < rArguments.getLength(); i++)
+ aArgs[i+1] = rArguments[i];
+
+ // get filter component
+ uno::Reference< document::XExporter > xExporter(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString::createFromAscii(pServiceName), aArgs,m_aProps->m_xContext), uno::UNO_QUERY);
+ OSL_ENSURE( xExporter.is(),
+ "can't instantiate export filter component" );
+ if( !xExporter.is() )
+ return sal_False;
+
+ // connect model and filter
+ xExporter->setSourceDocument( xComponent );
+
+ // filter!
+ uno::Reference<document::XFilter> xFilter( xExporter, uno::UNO_QUERY );
+ return xFilter->filter( rMediaDesc );
+}
+// -----------------------------------------------------------------------------
+// XLoadable
+void SAL_CALL OReportDefinition::initNew( ) throw (frame::DoubleInitializationException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+ setPageHeaderOn( sal_True );
+ setPageFooterOn( sal_True );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue >& /*lArguments*/ ) throw (frame::DoubleInitializationException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+// XVisualObject
+void SAL_CALL OReportDefinition::setVisualAreaSize( ::sal_Int64 _nAspect, const awt::Size& _aSize ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aVisualAreaSize = _aSize;
+ m_pImpl->m_nAspect = _nAspect;
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OReportDefinition::getVisualAreaSize( ::sal_Int64 /*nAspect*/ ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_aVisualAreaSize;
+}
+// -----------------------------------------------------------------------------
+embed::VisualRepresentation SAL_CALL OReportDefinition::getPreferredVisualRepresentation( ::sal_Int64 /*nAspect*/ ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ embed::VisualRepresentation aVisualRepresentation;
+ return aVisualRepresentation;
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportDefinition::getMapUnit( ::sal_Int64 /*nAspect*/ ) throw (uno::Exception, uno::RuntimeException)
+{
+ return embed::EmbedMapUnits::ONE_100TH_MM;
+}
+// -----------------------------------------------------------------------------
+// XModifiable
+::sal_Bool SAL_CALL OReportDefinition::isModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_bModified;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setModified( ::sal_Bool _bModified ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_pImpl->m_pReportModel->IsReadOnly() && _bModified )
+ throw beans::PropertyVetoException();
+ if ( m_pImpl->m_bModified != _bModified )
+ {
+ m_pImpl->m_bModified = _bModified;
+ lang::EventObject aEvent(*this);
+ aGuard.clear();
+ m_pImpl->m_aModifyListeners.notifyEach(&util::XModifyListener::modified,aEvent);
+ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnModifyChanged")));
+ }
+}
+// -----------------------------------------------------------------------------
+// XModifyBroadcaster
+void SAL_CALL OReportDefinition::addModifyListener( const uno::Reference< util::XModifyListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( _xListener.is() )
+ m_pImpl->m_aModifyListeners.addInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removeModifyListener( const uno::Reference< util::XModifyListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aModifyListeners.removeInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+void OReportDefinition::notifyEvent(const ::rtl::OUString& _sEventName)
+{
+ try
+ {
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ document::EventObject aEvt(*this, _sEventName);
+ /// TODO: this code has to be deleted after as cws will be integrated
+ uno::Reference< document::XEventListener > xDocEventBroadcaster;
+ try
+ {
+ xDocEventBroadcaster.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.GlobalEventBroadcaster")),m_aProps->m_xContext),
+ uno::UNO_QUERY);
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!");
+ }
+ aGuard.clear();
+ if ( xDocEventBroadcaster.is() )
+ xDocEventBroadcaster->notifyEvent(aEvt);
+ m_pImpl->m_aDocEventListeners.notifyEach(&document::XEventListener::notifyEvent,aEvt);
+ }
+ catch(uno::Exception&)
+ {
+ }
+}
+// -----------------------------------------------------------------------------
+// document::XEventBroadcaster
+void SAL_CALL OReportDefinition::addEventListener(const uno::Reference< document::XEventListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( _xListener.is() )
+ m_pImpl->m_aDocEventListeners.addInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::removeEventListener( const uno::Reference< document::XEventListener >& _xListener ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_aDocEventListeners.removeInterface(_xListener);
+}
+// -----------------------------------------------------------------------------
+// document::XEventListener
+void SAL_CALL OReportDefinition::notifyEvent( const document::EventObject& aEvent ) throw (uno::RuntimeException)
+{
+ // used only to forward external events (e.g. for doc creation) from the frame loader
+ // to the global event broadcaster and all other interested doc event listener.
+ notifyEvent(aEvent.EventName);
+}
+// -----------------------------------------------------------------------------
+// document::XViewDataSupplier
+uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewData( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( !m_pImpl->m_xViewData.is() )
+ {
+ m_pImpl->m_xViewData.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")),m_aProps->m_xContext ),uno::UNO_QUERY);
+ //uno::Sequence< beans::PropertyValue > aProps;
+ //m_pImpl->m_xViewData->insertByIndex(m_pImpl->m_xViewData->getCount(),uno::makeAny(aProps));
+ uno::Reference< container::XIndexContainer > xContainer(m_pImpl->m_xViewData,uno::UNO_QUERY);
+ ::std::vector< uno::Reference< frame::XController> >::iterator aIter = m_pImpl->m_aControllers.begin();
+ ::std::vector< uno::Reference< frame::XController> >::iterator aEnd = m_pImpl->m_aControllers.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ if ( aIter->is() )
+ {
+ try
+ {
+ xContainer->insertByIndex(xContainer->getCount(),(*aIter)->getViewData());
+ }
+ catch(uno::Exception&)
+ {
+ }
+ } // if ( aIter->is() )
+ }
+
+ }
+ return m_pImpl->m_xViewData;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setViewData( const uno::Reference< container::XIndexAccess >& Data ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_xViewData = Data;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFunctions > SAL_CALL OReportDefinition::getFunctions() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_xFunctions;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< ui::XUIConfigurationManager > SAL_CALL OReportDefinition::getUIConfigurationManager( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ if ( !m_pImpl->m_xUIConfigurationManager.is() )
+ {
+ m_pImpl->m_xUIConfigurationManager.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager")),m_aProps->m_xContext),
+ uno::UNO_QUERY);
+
+ uno::Reference< ui::XUIConfigurationStorage > xUIConfigStorage( m_pImpl->m_xUIConfigurationManager, uno::UNO_QUERY );
+ if ( xUIConfigStorage.is() )
+ {
+ uno::Reference< embed::XStorage > xConfigStorage;
+ // initialize ui configuration manager with document substorage
+ xUIConfigStorage->setStorage( xConfigStorage );
+ }
+ }
+
+ return m_pImpl->m_xUIConfigurationManager;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< embed::XStorage > SAL_CALL OReportDefinition::getDocumentSubStorage( const ::rtl::OUString& aStorageName, sal_Int32 nMode ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_xStorage->openStorageElement(aStorageName, nMode);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getDocumentSubStoragesNames( ) throw (io::IOException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ uno::Reference<container::XNameAccess> xNameAccess(m_pImpl->m_xStorage,uno::UNO_QUERY);
+ return xNameAccess.is() ? xNameAccess->getElementNames() : uno::Sequence< ::rtl::OUString >();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getMimeType() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_sMimeType;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setMimeType( const ::rtl::OUString& _mimetype ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ uno::Sequence< ::rtl::OUString > aList = getAvailableMimeTypes();
+ const ::rtl::OUString* pEnd = aList.getConstArray()+aList.getLength();
+ if ( ::std::find(aList.getConstArray(),pEnd,_mimetype) == pEnd )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getAvailableMimeTypes()"))
+ ,*this
+ ,1
+ ,m_aProps->m_xContext);
+ set(PROPERTY_MIMETYPE,_mimetype,m_pImpl->m_sMimeType);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getAvailableMimeTypes( ) throw (lang::DisposedException, uno::Exception, uno::RuntimeException)
+{
+ static uno::Sequence< ::rtl::OUString > s_aList;
+ if ( !s_aList.hasElements() )
+ {
+ s_aList.realloc(2);
+ s_aList[0] = MIMETYPE_OASIS_OPENDOCUMENT_TEXT;
+ s_aList[1] = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET;
+ }
+
+ return s_aList;
+}
+// -----------------------------------------------------------------------------
+// com::sun::star::XUnoTunnel
+sal_Int64 SAL_CALL OReportDefinition::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw(uno::RuntimeException)
+{
+ if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return reinterpret_cast<sal_Int64>(this);
+
+ return 0;
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< sal_Int8 > SAL_CALL OReportDefinition::getImplementationId( ) throw (uno::RuntimeException)
+{
+ return OReportDefinition::getUnoTunnelImplementationId();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< sal_Int8 > OReportDefinition::getUnoTunnelImplementationId()
+{
+ static ::cppu::OImplementationId * pId = 0;
+ if (! pId)
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if (! pId)
+ {
+ static ::cppu::OImplementationId aId;
+ pId = &aId;
+ }
+ }
+ return pId->getImplementationId();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XComponentContext > OReportDefinition::getContext()
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_aProps->m_xContext;
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel() const
+{
+ return m_pImpl->m_pReportModel;
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(uno::Reference< report::XReportDefinition >& _xReportDefinition)
+{
+ ::boost::shared_ptr<rptui::OReportModel> pReportModel;
+ uno::Reference< lang::XUnoTunnel > xUT( _xReportDefinition, uno::UNO_QUERY );
+ if( xUT.is() )
+ pReportModel = reinterpret_cast<OReportDefinition*>(sal::static_int_cast<sal_uIntPtr>(xUT->getSomething( OReportDefinition::getUnoTunnelImplementationId())))->getSdrModel();
+ return pReportModel;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWithArguments( const ::rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& _aArgs)
+ throw( uno::Exception, uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ uno::Reference< drawing::XShape > xShape;
+ const uno::Any* pIter = _aArgs.getConstArray();
+ const uno::Any* pEnd = pIter + _aArgs.getLength();
+ for(;pIter != pEnd && !xShape.is();++pIter)
+ xShape.set(*pIter,uno::UNO_QUERY);
+
+ uno::Reference< uno::XInterface > xReportComponent;
+ if ( xShape.is() )
+ {
+ if ( aServiceSpecifier == SERVICE_FORMATTEDFIELD )
+ {
+ uno::Reference<report::XFormattedField> xProp = new OFormattedField(m_aProps->m_xContext,this,xShape);
+ xReportComponent = xProp;
+ if ( xShape.is() )
+ throw uno::Exception();
+ xProp->setPropertyValue( PROPERTY_FORMATSSUPPLIER, uno::makeAny(m_pImpl->m_xNumberFormatsSupplier) );
+ }
+ else if ( aServiceSpecifier == SERVICE_FIXEDTEXT)
+ {
+ xReportComponent = static_cast<cppu::OWeakObject*>(new OFixedText(m_aProps->m_xContext,this,xShape));
+ if ( xShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_FIXEDLINE)
+ {
+ xReportComponent = static_cast<cppu::OWeakObject*>(new OFixedLine(m_aProps->m_xContext,this,xShape));
+ if ( xShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_IMAGECONTROL )
+ {
+ xReportComponent = static_cast<cppu::OWeakObject*>(new OImageControl(m_aProps->m_xContext,this,xShape));
+ if ( xShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_REPORTDEFINITION )
+ {
+ xReportComponent = static_cast<cppu::OWeakObject*>(new OReportDefinition(m_aProps->m_xContext,this,xShape));
+ if ( xShape.is() )
+ throw uno::Exception();
+ }
+ else if ( xShape.is() )
+ {
+ xReportComponent = static_cast<cppu::OWeakObject*>(new OShape(m_aProps->m_xContext,this,xShape));
+ if ( xShape.is() )
+ throw uno::Exception();
+ }
+ }
+ return xReportComponent;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ uno::Reference< drawing::XShape > xShape;
+ if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.report.") ) == 0 )
+ {
+ if ( aServiceSpecifier == SERVICE_SHAPE )
+ xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")) ),uno::UNO_QUERY_THROW);
+ else
+ xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")) ),uno::UNO_QUERY_THROW);
+ }
+ else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.form.component.") ) == 0 )
+ {
+ xShape.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier,m_aProps->m_xContext),uno::UNO_QUERY);
+ }
+ else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.style.PageStyle") ) == 0 ||
+ aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.style.FrameStyle") ) == 0 ||
+ aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.style.GraphicStyle") ) == 0
+ )
+ {
+ uno::Reference< style::XStyle> xStyle = new OStyle();
+ xStyle->setName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default")));
+ uno::Reference<beans::XPropertySet> xProp(xStyle,uno::UNO_QUERY);
+ ::rtl::OUString sTray;
+ xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PrinterPaperTray")))>>= sTray;
+
+ return xStyle.get();
+ }
+ else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.document.Settings") ) == 0 )
+ {
+ uno::Reference<beans::XPropertySet> xProp = new OStyle();
+
+ return xProp.get();
+ }
+ else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.drawing.Defaults") ) == 0 )
+ {
+ uno::Reference<beans::XPropertySet> xProp = new OStyle();
+
+ return xProp.get();
+ }
+ else
+ xShape.set(SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ),uno::UNO_QUERY_THROW);
+
+
+ uno::Reference< uno::XInterface > xReturn;
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] <<= xShape;
+ xShape.clear();
+ xReturn = createInstanceWithArguments(aServiceSpecifier,aArgs);
+ }
+ return xReturn;
+}
+//-----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getAvailableServiceNames(void) throw( uno::RuntimeException )
+{
+ static const ::rtl::OUString aSvxComponentServiceNameList[] =
+ {
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.PageStyle")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.GraphicStyle")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.FrameStyle")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults"))
+ };
+
+ static const sal_uInt16 nSvxComponentServiceNameListCount = sizeof(aSvxComponentServiceNameList) / sizeof ( aSvxComponentServiceNameList[0] );
+
+ uno::Sequence< ::rtl::OUString > aSeq( nSvxComponentServiceNameListCount );
+ ::rtl::OUString* pStrings = aSeq.getArray();
+ for( sal_uInt16 nIdx = 0; nIdx < nSvxComponentServiceNameListCount; nIdx++ )
+ pStrings[nIdx] = aSvxComponentServiceNameList[nIdx];
+
+ uno::Sequence< ::rtl::OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() );
+ return concatServiceNames( aParentSeq, aSeq );
+}
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OReportDefinition::getPosition( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_aProps->m_xShape.is() )
+ return m_aProps->m_xShape->getPosition();
+ return awt::Point(m_aProps->m_nPosX,m_aProps->m_nPosY);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_aProps->m_xShape.is() )
+ m_aProps->m_xShape->setPosition(aPosition);
+ set(PROPERTY_POSITIONX,aPosition.X,m_aProps->m_nPosX);
+ set(PROPERTY_POSITIONY,aPosition.Y,m_aProps->m_nPosY);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OReportDefinition::getSize( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_aProps->m_xShape.is() )
+ return m_aProps->m_xShape->getSize();
+ return awt::Size(m_aProps->m_nWidth,m_aProps->m_nHeight);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_aProps->m_xShape.is() )
+ m_aProps->m_xShape->setSize(aSize);
+ set(PROPERTY_WIDTH,aSize.Width,m_aProps->m_nWidth);
+ set(PROPERTY_HEIGHT,aSize.Height,m_aProps->m_nHeight);
+}
+// -----------------------------------------------------------------------------
+
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OReportDefinition::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( m_aProps->m_xShape.is() )
+ return m_aProps->m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+typedef ::cppu::WeakImplHelper2< container::XNameContainer,
+ container::XIndexAccess
+ > TStylesBASE;
+class OStylesHelper : public ::cppu::BaseMutex, public TStylesBASE
+{
+ typedef ::std::map< ::rtl::OUString, uno::Any , ::comphelper::UStringMixLess> TStyleElements;
+ TStyleElements m_aElements;
+ ::std::vector<TStyleElements::iterator> m_aElementsPos;
+ uno::Type m_aType;
+
+ OStylesHelper(const OStylesHelper&);
+ void operator =(const OStylesHelper&);
+protected:
+ virtual ~OStylesHelper(){}
+public:
+ OStylesHelper(const uno::Type _aType = ::getCppuType(static_cast< uno::Reference< container::XElementAccess >* >(NULL)));
+
+ // XNameContainer
+ virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::ElementExistException,lang::WrappedTargetException, uno::RuntimeException);
+ virtual void SAL_CALL removeByName( const ::rtl::OUString& Name ) throw(container::NoSuchElementException, lang::WrappedTargetException,uno::RuntimeException);
+
+ // XNameReplace
+ virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::NoSuchElementException,lang::WrappedTargetException, uno::RuntimeException);
+
+ // container::XElementAccess
+ uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException);
+ sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException);
+ // container::XIndexAccess
+ sal_Int32 SAL_CALL getCount( ) throw(uno::RuntimeException);
+ uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException);
+
+ // container::XNameAccess
+ uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
+ uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(uno::RuntimeException);
+ sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(uno::RuntimeException);
+};
+
+OStylesHelper::OStylesHelper(const uno::Type _aType)
+: cppu::BaseMutex()
+,m_aType(_aType)
+{
+}
+// -----------------------------------------------------------------------------;
+// container::XElementAccess
+uno::Type SAL_CALL OStylesHelper::getElementType( ) throw(uno::RuntimeException)
+{
+ return m_aType;
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OStylesHelper::hasElements( ) throw(uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return !m_aElementsPos.empty();
+}
+// -----------------------------------------------------------------------------
+// container::XIndexAccess
+sal_Int32 SAL_CALL OStylesHelper::getCount( ) throw(uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aElementsPos.size();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OStylesHelper::getByIndex( sal_Int32 Index ) throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( Index < 0 || Index >= static_cast<sal_Int32>(m_aElementsPos.size()) )
+ throw lang::IndexOutOfBoundsException();
+ return uno::makeAny(m_aElementsPos[Index]->second);
+}
+// -----------------------------------------------------------------------------
+// container::XNameAccess
+uno::Any SAL_CALL OStylesHelper::getByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ TStyleElements::iterator aFind = m_aElements.find(aName);
+ if ( aFind == m_aElements.end() )
+ throw container::NoSuchElementException();
+ return uno::makeAny(aFind->second);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OStylesHelper::getElementNames( ) throw(uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Sequence< ::rtl::OUString > aNameList(m_aElementsPos.size());
+
+ ::rtl::OUString* pStringArray = aNameList.getArray();
+ ::std::vector<TStyleElements::iterator>::const_iterator aEnd = m_aElementsPos.end();
+ for(::std::vector<TStyleElements::iterator>::const_iterator aIter = m_aElementsPos.begin(); aIter != aEnd;++aIter,++pStringArray)
+ *pStringArray = (*aIter)->first;
+
+ return aNameList;
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OStylesHelper::hasByName( const ::rtl::OUString& aName ) throw(uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aElements.find(aName) != m_aElements.end();
+}
+// -----------------------------------------------------------------------------
+// XNameContainer
+void SAL_CALL OStylesHelper::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::ElementExistException,lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aElements.find(aName) != m_aElements.end() )
+ throw container::ElementExistException();
+
+ if ( !aElement.isExtractableTo(m_aType) )
+ throw lang::IllegalArgumentException();
+
+ m_aElementsPos.push_back(m_aElements.insert(TStyleElements::value_type(aName,aElement)).first);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStylesHelper::removeByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException,uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ TStyleElements::iterator aFind = m_aElements.find(aName);
+ if ( aFind != m_aElements.end() )
+ throw container::NoSuchElementException();
+ m_aElementsPos.erase(::std::find(m_aElementsPos.begin(),m_aElementsPos.end(),aFind));
+ m_aElements.erase(aFind);
+}
+// -----------------------------------------------------------------------------
+// XNameReplace
+void SAL_CALL OStylesHelper::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement ) throw(lang::IllegalArgumentException, container::NoSuchElementException,lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ TStyleElements::iterator aFind = m_aElements.find(aName);
+ if ( aFind != m_aElements.end() )
+ throw container::NoSuchElementException();
+ if ( !aElement.isExtractableTo(m_aType) )
+ throw lang::IllegalArgumentException();
+ aFind->second = aElement;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< container::XNameAccess > SAL_CALL OReportDefinition::getStyleFamilies( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( !m_pImpl->m_xStyles.is() )
+ {
+ m_pImpl->m_xStyles = new OStylesHelper();
+ uno::Reference< container::XNameContainer> xStyles(m_pImpl->m_xStyles,uno::UNO_QUERY);
+
+ uno::Reference< container::XNameContainer> xPageStyles = new OStylesHelper(::getCppuType(static_cast< uno::Reference<style::XStyle>* >(NULL)));
+ xStyles->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageStyles")),uno::makeAny(xPageStyles));
+ uno::Reference< style::XStyle> xPageStyle(createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.PageStyle"))),uno::UNO_QUERY);
+ xPageStyles->insertByName(xPageStyle->getName(),uno::makeAny(xPageStyle));
+
+ uno::Reference< container::XNameContainer> xFrameStyles = new OStylesHelper(::getCppuType(static_cast< uno::Reference<style::XStyle>* >(NULL)));
+ xStyles->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameStyles")),uno::makeAny(xFrameStyles));
+ uno::Reference< style::XStyle> xFrameStyle(createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.FrameStyle"))),uno::UNO_QUERY);
+ xFrameStyles->insertByName(xFrameStyle->getName(),uno::makeAny(xFrameStyle));
+
+ uno::Reference< container::XNameContainer> xGraphicStyles = new OStylesHelper(::getCppuType(static_cast< uno::Reference<style::XStyle>* >(NULL)));
+ xStyles->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("graphics")),uno::makeAny(xGraphicStyles));
+ uno::Reference< style::XStyle> xGraphicStyle(createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.style.GraphicStyle"))),uno::UNO_QUERY);
+ xGraphicStyles->insertByName(xGraphicStyle->getName(),uno::makeAny(xGraphicStyle));
+ }
+ return m_pImpl->m_xStyles;
+}
+::rtl::OUString SAL_CALL OReportDefinition::getIdentifier( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ return m_pImpl->m_sIdentifier;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setIdentifier( const ::rtl::OUString& Identifier ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_sIdentifier = Identifier;
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// =============================================================================
+}// namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
new file mode 100644
index 000000000000..03f8b91cae14
--- /dev/null
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -0,0 +1,506 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportEngineJFree.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include "ReportEngineJFree.hxx"
+
+#ifndef _COMPHELPER_ENUMHELPER_HXX_
+#include <comphelper/enumhelper.hxx>
+#endif
+#ifndef _COMPHELPER_DOCUMENTCONSTANTS_HXX
+#include <comphelper/documentconstants.hxx>
+#endif
+#ifndef _COMPHELPER_STORAGEHELPER_HXX
+#include <comphelper/storagehelper.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XCOMPLETEDEXECUTION_HPP_
+#include <com/sun/star/sdb/XCompletedExecution.hpp>
+#endif
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#ifndef _COM_SUN_STAR_TASK_XJOB_HPP_
+#include <com/sun/star/task/XJob.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _UNOTOOLS_TEMPFILE_HXX
+#include <unotools/tempfile.hxx>
+#endif
+#ifndef UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+#include <unotools/sharedunocomponent.hxx>
+#endif
+#ifndef _COMPHELPER_MIMECONFIGHELPER_HXX_
+#include <comphelper/mimeconfighelper.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
+#include <connectivity/CommonTools.hxx>
+#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+DBG_NAME( rpt_OReportEngineJFree )
+// -----------------------------------------------------------------------------
+OReportEngineJFree::OReportEngineJFree( const uno::Reference< uno::XComponentContext >& context)
+:ReportEngineBase(m_aMutex)
+,ReportEnginePropertySet(context,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),uno::Sequence< ::rtl::OUString >())
+,m_xContext(context)
+{
+ DBG_CTOR( rpt_OReportEngineJFree,NULL);
+}
+// -----------------------------------------------------------------------------
+OReportEngineJFree::~OReportEngineJFree()
+{
+ DBG_DTOR( rpt_OReportEngineJFree,NULL);
+}
+//--------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XINTERFACE2(OReportEngineJFree,ReportEngineBase,ReportEnginePropertySet)
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::dispose() throw(uno::RuntimeException)
+{
+ ReportEnginePropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ ::comphelper::disposeComponent(m_xRowSet);
+ m_xActiveConnection.clear();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportEngineJFree::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OReportEngineJFree"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportEngineJFree::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OReportEngineJFree::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_REPORTENGINE;
+
+ return aServices;
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OReportEngineJFree::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OReportEngineJFree(xContext));
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OReportEngineJFree::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OReportEngineJFree::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportEngine
+ // Attributes
+uno::Reference< report::XReportDefinition > SAL_CALL OReportEngineJFree::getReportDefinition() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xReport;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::setReportDefinition( const uno::Reference< report::XReportDefinition >& _report ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( !_report.is() )
+ throw lang::IllegalArgumentException();
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_xReport != _report )
+ {
+ prepareSet(PROPERTY_REPORTDEFINITION, uno::makeAny(m_xReport), uno::makeAny(_report), &l);
+ m_xReport = _report;
+ ::comphelper::disposeComponent(m_xRowSet);
+ m_xRowSet.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.RowSet"))
+ ,m_xContext),uno::UNO_QUERY);
+ }
+ setRowSetProperties();
+ }
+ l.notify();
+}
+// -----------------------------------------------------------------------------
+void OReportEngineJFree::setRowSetProperties()
+{
+ if ( m_xReport.is() && m_xRowSet.is() )
+ {
+ uno::Reference< beans::XPropertySet> xRowSetProp(m_xRowSet,uno::UNO_QUERY);
+ xRowSetProp->setPropertyValue(PROPERTY_COMMAND,m_xReport->getPropertyValue(PROPERTY_COMMAND));
+ xRowSetProp->setPropertyValue(PROPERTY_COMMANDTYPE,m_xReport->getPropertyValue(PROPERTY_COMMANDTYPE));
+ xRowSetProp->setPropertyValue(PROPERTY_FILTER,m_xReport->getPropertyValue(PROPERTY_FILTER));
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< task::XStatusIndicator > SAL_CALL OReportEngineJFree::getStatusIndicator() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_StatusIndicator;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task::XStatusIndicator >& _statusindicator ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_STATUSINDICATOR,_statusindicator,m_StatusIndicator);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportEngineJFree::transform()
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")); /// TODO has to be changed into the real name for the report transformation
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportEngineJFree::getNewOutputName()
+{
+ ::rtl::OUString sOutputName;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
+ if ( !m_xReport.is() || !m_xRowSet.is() || !m_xActiveConnection.is() )
+ throw lang::IllegalArgumentException();
+
+ try
+ {
+ uno::Reference< embed::XStorage > xTemp = OStorageHelper::GetTemporaryStorage(/*sFileTemp,embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,*/uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY));
+ utl::DisposableComponent aTemp(xTemp);
+ uno::Sequence< beans::PropertyValue > aEmpty;
+ uno::Reference< beans::XPropertySet> xStorageProp(xTemp,uno::UNO_QUERY);
+ if ( xStorageProp.is() )
+ {
+ static const ::rtl::OUString sPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ xStorageProp->setPropertyValue( sPropName, uno::makeAny(m_xReport->getMimeType()));
+ }
+ m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file because it may contain information which aren't in the database yet.
+
+ uno::Sequence< beans::NamedValue > aConvertedProperties(5/*6*/);
+ sal_Int32 nPos = 0;
+
+ //aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Key"));
+ //::rtl::OUString sKey;// = StorageContainer::registerStorage(m_xReport);
+ //aConvertedProperties[nPos++].Value <<= sKey;
+
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStorage"));
+ aConvertedProperties[nPos++].Value <<= xTemp;
+
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStorage"));
+
+ //! TODO: has to be changed into a temp storage later on
+ const static String s_sExt = String::CreateFromAscii(".rpt");
+ String sName = m_xReport->getName();
+ ::utl::TempFile aFile(sName,&s_sExt);
+ uno::Reference< embed::XStorage > xOut = OStorageHelper::GetStorageFromURL(aFile.GetURL(),embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY));
+ utl::DisposableComponent aOut(xOut);
+ xStorageProp.set(xOut,uno::UNO_QUERY);
+ if ( xStorageProp.is() )
+ {
+ static const ::rtl::OUString sPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ xStorageProp->setPropertyValue( sPropName, uno::makeAny(m_xReport->getMimeType()));
+ }
+ /*::rtl::OUString sStyles(RTL_CONSTASCII_USTRINGPARAM("styles.xml"));
+ xTemp->copyElementTo(sStyles,xOut,sStyles);*/
+
+ aConvertedProperties[nPos++].Value <<= xOut;
+
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("mimetype"));
+ aConvertedProperties[nPos++].Value <<= m_xReport->getMimeType();
+
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowSet"));
+ aConvertedProperties[nPos++].Value <<= m_xRowSet;
+
+ // create job factory and initialize
+ uno::Reference<task::XJob> xJob(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOReportJobFactory")),m_xContext),uno::UNO_QUERY);
+ if ( xJob.is() )
+ {
+ if ( m_xReport->getCommand().getLength() )
+ {
+ uno::Reference< beans::XPropertySet> xRowSetProp(m_xRowSet,uno::UNO_QUERY);
+ xRowSetProp->setPropertyValue(PROPERTY_ACTIVECONNECTION,uno::makeAny(m_xActiveConnection));
+
+ ::rtl::OUString sOrder = getOrderStatement();
+ xRowSetProp->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Order")),uno::makeAny(sOrder));
+
+ if ( m_xReport->getFilter().getLength() )
+ xRowSetProp->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ApplyFilter")),uno::makeAny(sal_True));
+
+ uno::Reference<sdb::XCompletedExecution> xExecute( m_xRowSet, uno::UNO_QUERY );
+ if ( xExecute.is() )
+ {
+ uno::Reference<task::XInteractionHandler> xHandler(
+ m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.InteractionHandler"))
+ ,m_xContext),
+ uno::UNO_QUERY);
+ xExecute->executeWithCompletion(xHandler);
+ }
+ else
+ m_xRowSet->execute();
+ xJob->execute(aConvertedProperties);
+ }
+
+ if ( xStorageProp.is() )
+ {
+ //xStorageProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))) >>= sOutputName;
+ sOutputName = aFile.GetURL();
+ }
+ }
+
+ uno::Reference<embed::XTransactedObject> xTransact(xOut,uno::UNO_QUERY);
+ if ( sOutputName.getLength() && xTransact.is() )
+ xTransact->commit();
+
+ if ( !sOutputName.getLength() )
+ throw lang::IllegalArgumentException();
+ }
+ catch(const uno::Exception& e)
+ {
+ (void)e; // helper to know what e contains
+ throw;
+ }
+ }
+ return sOutputName;
+}
+// -----------------------------------------------------------------------------
+// Methods
+uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentModel( ) throw (lang::DisposedException, lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel;
+ ::rtl::OUString sOutputName = getNewOutputName();
+ if ( sOutputName.getLength() )
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY);
+ ::comphelper::MimeConfigurationHelper aHelper(xFac);
+ ::rtl::OUString sServiceName = aHelper.GetDocServiceNameFromMediaType(m_xReport->getMimeType());
+ xModel.set(m_xContext->getServiceManager()->createInstanceWithContext(sServiceName,m_xContext),uno::UNO_QUERY_THROW);
+ uno::Sequence< beans::PropertyValue > aArguments;
+ xModel->attachResource(sOutputName,aArguments);
+ }
+ return xModel;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive( const uno::Reference< frame::XFrame >& _frame ) throw (lang::DisposedException, lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel;
+ ::rtl::OUString sOutputName = getNewOutputName(); // starts implicite the report generator
+ if ( sOutputName.getLength() )
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
+ uno::Reference<frame::XComponentLoader> xFrameLoad(_frame,uno::UNO_QUERY);
+ if ( !xFrameLoad.is() )
+ {
+ // if there is no frame given, find the right
+ xFrameLoad.set( m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))
+ ,m_xContext)
+ ,uno::UNO_QUERY);
+ ::rtl::OUString sTarget = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank"));
+ sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
+ uno::Reference< frame::XFrame> xFrame = uno::Reference< frame::XFrame>(xFrameLoad,uno::UNO_QUERY)->findFrame(sTarget,nFrameSearchFlag);
+ xFrameLoad.set( xFrame,uno::UNO_QUERY);
+ }
+
+ if ( xFrameLoad.is() )
+ {
+ uno::Sequence < beans::PropertyValue > aArgs( 2 );
+ sal_Int32 nLen = 0;
+ aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate"));
+ aArgs[nLen++].Value <<= sal_False;
+
+ aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
+ aArgs[nLen++].Value <<= sal_True;
+
+ uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY);
+ ::comphelper::MimeConfigurationHelper aHelper(xFac);
+ xModel.set( xFrameLoad->loadComponentFromURL(
+ sOutputName,
+ ::rtl::OUString(), // empty frame name
+ 0,
+ aArgs
+ ),uno::UNO_QUERY);
+ }
+ }
+ return xModel;
+}
+// -----------------------------------------------------------------------------
+util::URL SAL_CALL OReportEngineJFree::createDocument( ) throw (lang::DisposedException, lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
+{
+ util::URL aRet;
+ uno::Reference< frame::XModel > xModel = createDocumentModel();
+ if ( xModel.is() )
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
+ }
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::interrupt( ) throw (lang::DisposedException, uno::Exception, uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OReportEngineJFree::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return ReportEnginePropertySet::getPropertySetInfo();
+}
+// -------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportEnginePropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OReportEngineJFree::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return ReportEnginePropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportEnginePropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportEnginePropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportEnginePropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ReportEnginePropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sdbc::XConnection > SAL_CALL OReportEngineJFree::getActiveConnection() throw (uno::RuntimeException)
+{
+ return m_xActiveConnection;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::setActiveConnection( const uno::Reference< sdbc::XConnection >& _activeconnection ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( !_activeconnection.is() )
+ throw lang::IllegalArgumentException();
+ set(PROPERTY_ACTIVECONNECTION,_activeconnection,m_xActiveConnection);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportEngineJFree::getOrderStatement() const
+{
+ OSL_ENSURE(m_xActiveConnection.is(),"OReportEngineJFree::getOrderStatement: The ActiveConnection can not be NULL here!");
+ OSL_ENSURE(m_xReport.is(),"OReportEngineJFree::getOrderStatement: The ReportDefinition can not be NULL here!");
+
+ // retrieve columns of the object we're bound to
+ uno::Reference< lang::XComponent > xHoldAlive;
+ ::dbtools::SQLExceptionInfo aErrorInfo;
+ uno::Reference< container::XNameAccess> xColumns( ::dbtools::getFieldsByCommandDescriptor(
+ m_xActiveConnection, m_xReport->getCommandType(), m_xReport->getCommand(), xHoldAlive, & aErrorInfo ) );
+ if ( aErrorInfo.isValid() )
+ aErrorInfo.doThrow();
+ if ( !xColumns.is() )
+ {
+ DBG_WARNING( "OReportEngineJFree::getOrderStatement: could not retrieve the columns for the ORDER statement!" );
+ return ::rtl::OUString();
+ }
+
+ // set order for groups
+ ::rtl::OUStringBuffer aOrder;
+
+ const ::rtl::OUString sQuote = m_xActiveConnection->getMetaData()->getIdentifierQuoteString();
+
+ uno::Reference< report::XGroups> xGroups = m_xReport->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i )
+ {
+ uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ ::rtl::OUString sExpression = xGroup->getExpression();
+ if ( xColumns->hasByName(sExpression) )
+ sExpression = ::dbtools::quoteName( sQuote, sExpression );
+ aOrder.append( sExpression );
+ aOrder.appendAscii( " " );
+ if ( !xGroup->getSortAscending() )
+ aOrder.appendAscii( "DESC" );
+ if ( (i+1) < nCount )
+ aOrder.appendAscii( "," );
+ }
+
+ return aOrder.makeStringAndClear();
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/ReportVisitor.cxx b/reportdesign/source/core/api/ReportVisitor.cxx
new file mode 100644
index 000000000000..1eb6d3684fc6
--- /dev/null
+++ b/reportdesign/source/core/api/ReportVisitor.cxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportVisitor.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "ReportVisitor.hxx"
+namespace reportdesign
+{
+using namespace com::sun::star;
+
+OReportVisitor::OReportVisitor(ITraverseReport* _pTraverseReport)
+ :m_pTraverseReport(_pTraverseReport)
+{
+ OSL_ENSURE(m_pTraverseReport,"ReportDefintion must be not NULL!");
+}
+// -----------------------------------------------------------------------------
+void OReportVisitor::start(const uno::Reference< report::XReportDefinition>& _xReportDefinition)
+{
+ OSL_ENSURE(_xReportDefinition.is(),"ReportDefinition is NULL!");
+ if ( !_xReportDefinition.is() )
+ return;
+
+ m_pTraverseReport->traverseReport(_xReportDefinition);
+ m_pTraverseReport->traverseReportFunctions(_xReportDefinition->getFunctions());
+ if ( _xReportDefinition->getPageHeaderOn() )
+ m_pTraverseReport->traversePageHeader(_xReportDefinition->getPageHeader());
+ if ( _xReportDefinition->getReportHeaderOn() )
+ m_pTraverseReport->traverseReportHeader(_xReportDefinition->getReportHeader());
+
+ uno::Reference< report::XGroups > xGroups = _xReportDefinition->getGroups();
+ m_pTraverseReport->traverseGroups(xGroups);
+ const sal_Int32 nCount = xGroups->getCount();
+ sal_Int32 i = 0;
+ for (;i<nCount ; ++i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ m_pTraverseReport->traverseGroup(xGroup);
+ m_pTraverseReport->traverseGroupFunctions(xGroup->getFunctions());
+ if ( xGroup->getHeaderOn() )
+ m_pTraverseReport->traverseGroupHeader(xGroup->getHeader());
+ }
+
+ m_pTraverseReport->traverseDetail(_xReportDefinition->getDetail());
+
+ for (i = 0;i<nCount ; ++i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ if ( xGroup->getFooterOn() )
+ m_pTraverseReport->traverseGroupFooter(xGroup->getFooter());
+ }
+
+ if ( _xReportDefinition->getPageFooterOn() )
+ m_pTraverseReport->traversePageFooter(_xReportDefinition->getPageFooter());
+ if ( _xReportDefinition->getReportFooterOn() )
+ m_pTraverseReport->traverseReportFooter(_xReportDefinition->getReportFooter());
+}
+// -----------------------------------------------------------------------------
+void OReportVisitor::start(const uno::Reference< report::XGroup>& _xGroup)
+{
+ OSL_ENSURE(_xGroup.is(),"Group is NULL!");
+ if ( !_xGroup.is() )
+ return;
+ m_pTraverseReport->traverseGroup(_xGroup);
+ m_pTraverseReport->traverseGroupFunctions(_xGroup->getFunctions());
+ if ( _xGroup->getHeaderOn() )
+ m_pTraverseReport->traverseGroupHeader(_xGroup->getHeader());
+ if ( _xGroup->getFooterOn() )
+ m_pTraverseReport->traverseGroupFooter(_xGroup->getFooter());
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
new file mode 100644
index 000000000000..517100209d5a
--- /dev/null
+++ b/reportdesign/source/core/api/Section.cxx
@@ -0,0 +1,729 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Section.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "Section.hxx"
+
+#ifndef _COMPHELPER_ENUMHELPER_HXX_
+#include <comphelper/enumhelper.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_FORCENEWPAGE_HPP_
+#include <com/sun/star/report/ForceNewPage.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#include "ReportDefinition.hxx"
+#endif
+#ifndef RPT_SHAPE_HXX
+#include "Shape.hxx"
+#endif
+#ifndef _SVX_UNOSHAPE_HXX
+#include <svx/unoshape.hxx>
+#endif
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef REPORTDRAWPAGE_HXX_INCLUDED
+#include "ReportDrawPage.hxx"
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+DBG_NAME( rpt_OSection )
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> lcl_getGroupAbsent()
+{
+ ::rtl::OUString pProps[] = {
+ PROPERTY_CANGROW
+ ,PROPERTY_CANSHRINK
+ };
+
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+
+// -----------------------------------------------------------------------------
+OSection::OSection( const uno::Reference< report::XGroup >& _xParent
+ ,const uno::Reference< uno::XComponentContext >& context
+ ,bool /*_bPageSection*/)
+:SectionBase(m_aMutex)
+,SectionPropertySet(context,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getGroupAbsent())
+,m_aContainerListeners(m_aMutex)
+,m_xContext(context)
+,m_xGroup(_xParent)
+,m_nHeight(3000)
+,m_nBackgroundColor(COL_TRANSPARENT)
+,m_nForceNewPage(report::ForceNewPage::NONE)
+,m_nNewRowOrCol(report::ForceNewPage::NONE)
+,m_bKeepTogether(sal_False)
+,m_bCanGrow(sal_False)
+,m_bCanShrink(sal_False)
+,m_bRepeatSection(sal_False)
+,m_bVisible(sal_True)
+,m_bBacktransparent(sal_True)
+,m_bInRemoveNotify(false)
+,m_bInInsertNotify(false)
+{
+ DBG_CTOR( rpt_OSection,NULL);
+ init();
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> lcl_getAbsent(bool _bPageSection)
+{
+ if ( _bPageSection )
+ {
+ ::rtl::OUString pProps[] = {
+ PROPERTY_FORCENEWPAGE
+ ,PROPERTY_NEWROWORCOL
+ ,PROPERTY_KEEPTOGETHER
+ ,PROPERTY_CANGROW
+ ,PROPERTY_CANSHRINK
+ ,PROPERTY_REPEATSECTION
+ };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+ }
+
+ ::rtl::OUString pProps[] = {
+ PROPERTY_CANGROW
+ ,PROPERTY_CANSHRINK
+ ,PROPERTY_REPEATSECTION
+ };
+
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+// -----------------------------------------------------------------------------
+OSection::OSection(const uno::Reference< report::XReportDefinition >& _xParent
+ ,const uno::Reference< uno::XComponentContext >& context
+ ,bool _bPageSection)
+:SectionBase(m_aMutex)
+,SectionPropertySet(context,SectionPropertySet::IMPLEMENTS_PROPERTY_SET,lcl_getAbsent(_bPageSection))
+,m_aContainerListeners(m_aMutex)
+,m_xContext(context)
+,m_xReportDefinition(_xParent)
+,m_nHeight(3000)
+,m_nBackgroundColor(COL_TRANSPARENT)
+,m_nForceNewPage(report::ForceNewPage::NONE)
+,m_nNewRowOrCol(report::ForceNewPage::NONE)
+,m_bKeepTogether(sal_False)
+,m_bCanGrow(sal_False)
+,m_bCanShrink(sal_False)
+,m_bRepeatSection(sal_False)
+,m_bVisible(sal_True)
+,m_bBacktransparent(sal_True)
+,m_bInRemoveNotify(false)
+,m_bInInsertNotify(false)
+{
+ DBG_CTOR( rpt_OSection,NULL);
+ init();
+ //.getSdrModel()->createNewPage(m_xSection);
+}
+//--------------------------------------------------------------------------
+OSection::~OSection()
+{
+ DBG_DTOR( rpt_OSection,NULL);
+ if ( m_xProxy.is() )
+ m_xProxy->setDelegator( NULL );
+}
+//--------------------------------------------------------------------------
+//IMPLEMENT_FORWARD_XINTERFACE2(OSection,SectionBase,SectionPropertySet)
+IMPLEMENT_FORWARD_REFCOUNT( OSection, SectionBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OSection::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = SectionBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = SectionPropertySet::queryInterface(_rType);
+
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_xProxy.is() ? m_xProxy->queryAggregation(_rType) : aReturn);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::dispose() throw(uno::RuntimeException)
+{
+ SectionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::disposing()
+{
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_aContainerListeners.disposeAndClear( aDisposeEvent );
+ m_xContext.clear();
+
+ uno::Reference< report::XReportDefinition> xReport = getReportDefinition();
+ ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport);
+ osl_incrementInterlockedCount( &m_refCount );
+ if ( pModel )
+ {
+ uno::Reference< report::XSection> xSection = this;
+ pModel->DeletePage(pModel->getPage(xSection)->GetPageNum());
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OSection::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Section"));
+}
+//------------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> OSection::getSupportedServiceNames_Static(void) throw( uno::RuntimeException )
+{
+ uno::Sequence< ::rtl::OUString> aSupported(1);
+ aSupported.getArray()[0] = SERVICE_SECTION;
+ return aSupported;
+}
+//-------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString> SAL_CALL OSection::getSupportedServiceNames() throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OSection::supportsService( const ::rtl::OUString& _rServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(_rServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+void OSection::init()
+{
+ uno::Reference< report::XReportDefinition> xReport = getReportDefinition();
+ ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport);
+ OSL_ENSURE(pModel,"No odel set at the report definition!");
+ if ( pModel )
+ {
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ m_xProxy.set(pModel->createNewPage(this)->getUnoPage(),uno::UNO_QUERY);
+ ::comphelper::query_aggregation(m_xProxy,m_xDrawPage);
+ // set ourself as delegator
+ if ( m_xProxy.is() )
+ m_xProxy->setDelegator( static_cast<cppu::OWeakObject*>(this) );
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+}
+// -----------------------------------------------------------------------------
+// XSection
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getVisible() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bVisible;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_VISIBLE,_visible,m_bVisible);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OSection::getName() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_sName;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_NAME,_name,m_sName);
+}
+// -----------------------------------------------------------------------------
+::sal_uInt32 SAL_CALL OSection::getHeight() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nHeight;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setHeight( ::sal_uInt32 _height ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_HEIGHT,_height,m_nHeight);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OSection::getBackColor() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bBacktransparent ? COL_TRANSPARENT : m_nBackgroundColor;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setBackColor( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException)
+{
+ setBackTransparent(_backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT));
+ set(PROPERTY_BACKCOLOR,_backgroundcolor,m_nBackgroundColor);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getBackTransparent() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bBacktransparent;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setBackTransparent( ::sal_Bool _backtransparent ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_BACKTRANSPARENT,_backtransparent,m_bBacktransparent);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OSection::getConditionalPrintExpression() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_sConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_sConditionalPrintExpression);
+}
+// -----------------------------------------------------------------------------
+void OSection::checkNotPageHeaderFooter()
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< report::XReportDefinition > xRet = m_xReportDefinition;
+ if ( xRet.is() )
+ {
+ if ( xRet->getPageHeaderOn() && xRet->getPageHeader() == *this )
+ throw beans::UnknownPropertyException();
+ if ( xRet->getPageFooterOn() && xRet->getPageFooter() == *this )
+ throw beans::UnknownPropertyException();
+ }
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OSection::getForceNewPage() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ checkNotPageHeaderFooter();
+ return m_nForceNewPage;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setForceNewPage( ::sal_Int16 _forcenewpage ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ if ( _forcenewpage < report::ForceNewPage::NONE || _forcenewpage > report::ForceNewPage::BEFORE_AFTER_SECTION )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::ForceNewPage"))
+ ,*this
+ ,1
+ ,m_xContext);
+ checkNotPageHeaderFooter();
+
+ set(PROPERTY_FORCENEWPAGE,_forcenewpage,m_nForceNewPage);
+}
+// -----------------------------------------------------------------------------
+::sal_Int16 SAL_CALL OSection::getNewRowOrCol() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkNotPageHeaderFooter();
+ return m_nNewRowOrCol;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setNewRowOrCol( ::sal_Int16 _newroworcol ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ if ( _newroworcol < report::ForceNewPage::NONE || _newroworcol > report::ForceNewPage::BEFORE_AFTER_SECTION )
+ throwIllegallArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com::sun::star::report::ForceNewPage"))
+ ,*this
+ ,1
+ ,m_xContext);
+ checkNotPageHeaderFooter();
+
+ set(PROPERTY_NEWROWORCOL,_newroworcol,m_nNewRowOrCol);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getKeepTogether() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkNotPageHeaderFooter();
+ return m_bKeepTogether;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setKeepTogether( ::sal_Bool _keeptogether ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ checkNotPageHeaderFooter();
+ }
+ set(PROPERTY_KEEPTOGETHER,_keeptogether,m_bKeepTogether);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getCanGrow() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); ///TODO: unsupported at the moment
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setCanGrow( ::sal_Bool /*_cangrow*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); ///TODO: unsupported at the moment
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getCanShrink() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); ///TODO: unsupported at the moment
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setCanShrink( ::sal_Bool /*_canshrink*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); ///TODO: unsupported at the moment
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::getRepeatSection() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< report::XGroup > xGroup = m_xGroup;
+ if ( !xGroup.is() )
+ throw beans::UnknownPropertyException();
+ return m_bRepeatSection;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setRepeatSection( ::sal_Bool _repeatsection ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< report::XGroup > xGroup = m_xGroup;
+ if ( !xGroup.is() )
+ throw beans::UnknownPropertyException();
+ }
+ set(PROPERTY_REPEATSECTION,_repeatsection,m_bRepeatSection);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XGroup > SAL_CALL OSection::getGroup() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xGroup;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportDefinition > SAL_CALL OSection::getReportDefinition() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< report::XReportDefinition > xRet = m_xReportDefinition;
+ uno::Reference< report::XGroup > xGroup = m_xGroup;
+ if ( !xRet.is() && xGroup.is() )
+ {
+ uno::Reference< report::XGroups> xGroups(xGroup->getParent(),uno::UNO_QUERY);
+ if ( xGroups.is() )
+ xRet = xGroups->getReportDefinition();
+ }
+
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+const ::std::vector< ::rtl::OUString >& lcl_getControlModelMap()
+{
+ static ::std::vector< ::rtl::OUString > s_sControlModels;
+ if ( s_sControlModels.empty() )
+ {
+ s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FixedText")) );
+ s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FixedLine")) );
+ s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageControl")) );
+ s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormattedField")) );
+ s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Shape")) );
+ } // if ( s_sMap.empty() )
+ return s_sControlModels;
+
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportComponent > SAL_CALL OSection::createReportComponent( const ::rtl::OUString& _sReportComponentSpecifier ) throw (uno::Exception, lang::IllegalArgumentException,uno::RuntimeException)
+{
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+ const ::std::vector< ::rtl::OUString >& aRet = lcl_getControlModelMap();
+ ::std::vector< ::rtl::OUString >::const_iterator aFind = ::std::find(aRet.begin(),aRet.end(),_sReportComponentSpecifier);
+ if ( aFind == aRet.end() )
+ throw lang::IllegalArgumentException();
+
+ uno::Reference< report::XReportComponent > xRet;
+ uno::Reference< lang::XMultiServiceFactory> xFac(getReportDefinition(),uno::UNO_QUERY_THROW);
+ switch( aFind - aRet.begin() )
+ {
+ case 0:
+ xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))),uno::UNO_QUERY);
+ break;
+ case 1:
+ xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))),uno::UNO_QUERY);
+ break;
+ case 2:
+ xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))),uno::UNO_QUERY);
+ break;
+ case 3:
+ xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))),uno::UNO_QUERY);
+ break;
+ case 4:
+ xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"))),uno::UNO_QUERY);
+ break;
+ default:
+ //xRet = new OShape(m_xContext);
+ break;
+ } // switch( aRet.begin() - aFind )
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OSection::getAvailableReportComponentNames( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ const ::std::vector< ::rtl::OUString >& aRet = lcl_getControlModelMap();
+ const ::rtl::OUString* pRet = aRet.empty() ? 0 : &aRet[0];
+ return uno::Sequence< ::rtl::OUString >(pRet, aRet.size());
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OSection::getParent( ) throw (uno::RuntimeException)
+{
+ uno::Reference< uno::XInterface > xRet;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ xRet = m_xReportDefinition;
+ if ( !xRet.is() )
+ xRet = m_xGroup;
+ }
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::setParent( const uno::Reference< uno::XInterface >& /*Parent*/ ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ throw lang::NoSupportException();
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OSection::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.addInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aContainerListeners.removeInterface(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OSection::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XReportComponent>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OSection::hasElements( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xDrawPage.is() ? m_xDrawPage->hasElements() : sal_False;
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OSection::getCount( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xDrawPage.is() ? m_xDrawPage->getCount() : 0;
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OSection::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_xDrawPage->getByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XEnumerationAccess
+uno::Reference< container::XEnumeration > SAL_CALL OSection::createEnumeration( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this));
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OSection::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+ return SectionPropertySet::getPropertySetInfo();
+}
+// -------------------------------------------------------------------------
+void SAL_CALL OSection::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ SectionPropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OSection::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return SectionPropertySet::getPropertyValue( PropertyName);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ SectionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ SectionPropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ SectionPropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ SectionPropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void OSection::lcl_copySection(const uno::Reference< report::XSection>& _xSource,uno::Reference< report::XSection>& _xDest)
+{
+ if ( _xSource.is() )
+ {
+ ::comphelper::copyProperties(_xSource.get(),_xDest.get());
+ sal_Int32 nCount = _xSource->getCount();
+ for(sal_Int32 i = 0;i != nCount;++i)
+ {
+ uno::Reference<util::XCloneable> xClone(_xSource->getByIndex(i),uno::UNO_QUERY);
+ OSL_ENSURE(xClone.is(),"No XCloneable interface found!");
+ if ( xClone.is() )
+ {
+ uno::Reference< drawing::XShape> xShape(xClone->createClone(),uno::UNO_QUERY);
+ _xDest->add(xShape);
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::add( const uno::Reference< drawing::XShape >& xShape ) throw (uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_bInInsertNotify = true;
+ OSL_ENSURE(m_xDrawPage.is(),"No DrawPage!");
+ m_xDrawPage->add(xShape);
+ m_bInInsertNotify = false;
+ }
+ notifyElementAdded(xShape);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OSection::remove( const uno::Reference< drawing::XShape >& xShape ) throw (uno::RuntimeException)
+{
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_bInRemoveNotify = true;
+ OSL_ENSURE(m_xDrawPage.is(),"No DrawPage!");
+ m_xDrawPage->remove(xShape);
+ m_bInRemoveNotify = false;
+ }
+ notifyElementRemoved(xShape);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// com::sun::star::lang::XUnoTunnel
+//------------------------------------------------------------------
+sal_Int64 OSection::getSomething( const uno::Sequence< sal_Int8 > & rId ) throw (uno::RuntimeException)
+{
+ if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ return reinterpret_cast<sal_Int64>(this);
+ uno::Reference< lang::XUnoTunnel> xTunnel;
+ ::comphelper::query_aggregation(m_xProxy,xTunnel);
+ return xTunnel->getSomething(rId);
+}
+
+// -----------------------------------------------------------------------------
+OSection* OSection::getImplementation( const uno::Reference< uno::XInterface >& _rxComponent )
+{
+ OSection* pContent( NULL );
+
+ uno::Reference< lang::XUnoTunnel > xUnoTunnel( _rxComponent, uno::UNO_QUERY );
+ if ( xUnoTunnel.is() )
+ pContent = reinterpret_cast< OSection* >( xUnoTunnel->getSomething( getUnoTunnelImplementationId() ) );
+
+ return pContent;
+}
+//------------------------------------------------------------------------
+uno::Sequence< sal_Int8 > OSection::getUnoTunnelImplementationId()
+{
+ static ::cppu::OImplementationId * pId = 0;
+ if (! pId)
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if (! pId)
+ {
+ static ::cppu::OImplementationId aId;
+ pId = &aId;
+ }
+ }
+ return pId->getImplementationId();
+}
+// -----------------------------------------------------------------------------
+void OSection::notifyElementAdded(const uno::Reference< drawing::XShape >& xShape )
+{
+ if ( !m_bInInsertNotify )
+ {
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::Any(), uno::makeAny(xShape), uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementInserted,aEvent);
+ }
+}
+// -----------------------------------------------------------------------------
+void OSection::notifyElementRemoved(const uno::Reference< drawing::XShape >& xShape)
+{
+ if ( !m_bInRemoveNotify )
+ {
+ // notify our container listeners
+ container::ContainerEvent aEvent(static_cast<container::XContainer*>(this), uno::Any(), uno::makeAny(xShape), uno::Any());
+ m_aContainerListeners.notifyEach(&container::XContainerListener::elementRemoved,aEvent);
+ }
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx
new file mode 100644
index 000000000000..5855e09f3761
--- /dev/null
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -0,0 +1,512 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Shape.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_SHAPE_HXX
+#include "Shape.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef RPT_FORMATCONDITION_HXX
+#include "FormatCondition.hxx"
+#endif
+#ifndef _COM_SUN_STAR_TEXT_PARAGRAPHVERTALIGN_HPP_
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#endif
+#include "ReportHelperImpl.hxx"
+#include <boost/bind.hpp>
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+uno::Sequence< ::rtl::OUString > lcl_getShapeOptionals()
+{
+ ::rtl::OUString pProps[] = {
+ PROPERTY_DATAFIELD
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+
+DBG_NAME( rpt_OShape )
+// -----------------------------------------------------------------------------
+OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext)
+:ShapeBase(m_aMutex)
+,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nZOrder(0)
+{
+ DBG_CTOR( rpt_OShape,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
+}
+// -----------------------------------------------------------------------------
+OShape::OShape(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape)
+:ShapeBase(m_aMutex)
+,ShapePropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getShapeOptionals())
+,m_aProps(m_aMutex,static_cast< container::XContainer*>( this ),_xContext)
+,m_nZOrder(0)
+{
+ DBG_CTOR( rpt_OShape,NULL);
+ m_aProps.aComponent.m_sName = RPT_RESSTRING(RID_STR_SHAPE,m_aProps.aComponent.m_xContext->getServiceManager());
+ m_aProps.aComponent.m_xFactory = _xFactory;
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ uno::Reference<beans::XPropertySet> xProp(_xShape,uno::UNO_QUERY);
+ if ( xProp.is() )
+ {
+ xProp->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
+ xProp.clear();
+ }
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+// -----------------------------------------------------------------------------
+OShape::~OShape()
+{
+ DBG_DTOR( rpt_OShape,NULL);
+}
+// -----------------------------------------------------------------------------
+//IMPLEMENT_FORWARD_XINTERFACE2(OShape,ShapeBase,ShapePropertySet)
+IMPLEMENT_FORWARD_REFCOUNT( OShape, ShapeBase )
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL OShape::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ShapeBase::queryInterface(_rType);
+ if ( !aReturn.hasValue() )
+ aReturn = ShapePropertySet::queryInterface(_rType);
+
+ if ( !aReturn.hasValue() && OReportControlModel::isInterfaceForbidden(_rType) )
+ return aReturn;
+
+ return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn);
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::dispose() throw(uno::RuntimeException)
+{
+ ShapePropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+ uno::Reference< report::XShape> xHoldAlive = this;
+ {
+ m_aProps.dispose(m_refCount);
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OShape::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.Shape"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OShape::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > OShape::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_SHAPE;
+
+ return aServices;
+}
+//------------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OShape::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return *(new OShape(xContext));
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL OShape::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OShape::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OShape)
+REPORTCOMPONENT_IMPL2(OShape)
+REPORTCONTROLFORMAT_IMPL2(OShape,m_aProps.aFormatProperties)
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OShape::getControlBackground() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setControlBackground( ::sal_Int32 /*_backgroundcolor*/ ) throw (uno::RuntimeException,beans::UnknownPropertyException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OShape::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setControlBackgroundTransparent( ::sal_Bool /*_controlbackgroundtransparent*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySetInfo > SAL_CALL OShape::getPropertySetInfo( ) throw(uno::RuntimeException)
+{
+
+ //return ShapePropertySet::getPropertySetInfo();
+ return cppu::OPropertySetHelper::createPropertySetInfo( getInfoHelper() );
+}
+// -----------------------------------------------------------------------------
+cppu::IPropertyArrayHelper& OShape::getInfoHelper()
+{
+ if ( !m_pAggHelper.get() )
+ {
+ uno::Sequence<beans::Property> aAggSeq;
+ if ( m_aProps.aComponent.m_xProperty.is() )
+ aAggSeq = m_aProps.aComponent.m_xProperty->getPropertySetInfo()->getProperties();
+ m_pAggHelper.reset(new OPropertyArrayAggregationHelper(ShapePropertySet::getPropertySetInfo()->getProperties(),aAggSeq));
+ }
+ return *(m_pAggHelper.get());
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ m_aProps.aComponent.m_xProperty->setPropertyValue( aPropertyName,aValue);
+ // can be in both
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ ShapePropertySet::setPropertyValue( aPropertyName, aValue );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OShape::getPropertyValue( const ::rtl::OUString& PropertyName ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ return m_aProps.aComponent.m_xProperty->getPropertyValue( PropertyName);
+ // can be in both
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ return ShapePropertySet::getPropertyValue( PropertyName);
+ return uno::Any();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
+ // can be in both
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ ShapePropertySet::addPropertyChangeListener( aPropertyName, xListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ ShapePropertySet::removePropertyChangeListener( aPropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::addVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ ShapePropertySet::addVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ getInfoHelper();
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::AGGREGATE_PROPERTY )
+ m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY )
+ ShapePropertySet::removeVetoableChangeListener( PropertyName, aListener );
+}
+// -----------------------------------------------------------------------------
+// XReportControlModel
+::rtl::OUString SAL_CALL OShape::getDataField() throw ( beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setDataField( const ::rtl::OUString& /*_datafield*/ ) throw (lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OShape::getPrintWhenGroupChange() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.bPrintWhenGroupChange;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setPrintWhenGroupChange( ::sal_Bool _printwhengroupchange ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_PRINTWHENGROUPCHANGE,_printwhengroupchange,m_aProps.bPrintWhenGroupChange);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OShape::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_aProps.aConditionalPrintExpression;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ set(PROPERTY_CONDITIONALPRINTEXPRESSION,_conditionalprintexpression,m_aProps.aConditionalPrintExpression);
+}
+// -----------------------------------------------------------------------------
+
+// XCloneable
+uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno::RuntimeException)
+{
+ uno::Reference< report::XReportComponent> xSource = this;
+ uno::Reference< report::XShape> xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_SHAPE),uno::UNO_QUERY_THROW);
+ return xSet.get();
+}
+// -----------------------------------------------------------------------------
+// XChild
+uno::Reference< uno::XInterface > SAL_CALL OShape::getParent( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getParent(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setParent( const uno::Reference< uno::XInterface >& Parent ) throw (lang::NoSupportException, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
+ // not supported by the shape
+ //uno::Reference< container::XChild > xChild;
+ //comphelper::query_aggregation(m_aProps.aComponent.m_xProxy,xChild);
+ //if ( xChild.is() )
+ // xChild->setParent(Parent);
+}
+uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException)
+{
+ return new OFormatCondition(m_aProps.aComponent.m_xContext);
+}
+// -----------------------------------------------------------------------------
+// XContainer
+void SAL_CALL OShape::addContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.addContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::removeContainerListener( const uno::Reference< container::XContainerListener >& xListener ) throw (uno::RuntimeException)
+{
+ m_aProps.removeContainerListener(xListener);
+}
+// -----------------------------------------------------------------------------
+// XElementAccess
+uno::Type SAL_CALL OShape::getElementType( ) throw (uno::RuntimeException)
+{
+ return ::getCppuType(static_cast< uno::Reference<report::XFormatCondition>*>(NULL));
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OShape::hasElements( ) throw (uno::RuntimeException)
+{
+ return m_aProps.hasElements();
+}
+// -----------------------------------------------------------------------------
+// XIndexContainer
+void SAL_CALL OShape::insertByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.insertByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::removeByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.removeByIndex(Index);
+}
+// -----------------------------------------------------------------------------
+// XIndexReplace
+void SAL_CALL OShape::replaceByIndex( ::sal_Int32 Index, const uno::Any& Element ) throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ m_aProps.replaceByIndex(Index,Element);
+}
+// -----------------------------------------------------------------------------
+// XIndexAccess
+::sal_Int32 SAL_CALL OShape::getCount( ) throw (uno::RuntimeException)
+{
+ return m_aProps.getCount();
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OShape::getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException)
+{
+ return m_aProps.getByIndex( Index );
+}
+// -----------------------------------------------------------------------------
+// XShape
+awt::Point SAL_CALL OShape::getPosition( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getPosition(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setPosition( const awt::Point& aPosition ) throw (uno::RuntimeException)
+{
+ OShapeHelper::setPosition(aPosition,this);
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OShape::getSize( ) throw (uno::RuntimeException)
+{
+ return OShapeHelper::getSize(this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setSize( const awt::Size& aSize ) throw (beans::PropertyVetoException, uno::RuntimeException)
+{
+ OShapeHelper::setSize(aSize,this);
+}
+// -----------------------------------------------------------------------------
+
+// XShapeDescriptor
+::rtl::OUString SAL_CALL OShape::getShapeType( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_aProps.aComponent.m_xShape.is() )
+ return m_aProps.aComponent.m_xShape->getShapeType();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OShape::getZOrder() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_ZORDER) >>= m_nZOrder;
+ return m_nZOrder;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setZOrder( ::sal_Int32 _zorder ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_ZORDER,uno::makeAny(_zorder));
+ set(PROPERTY_ZORDER,_zorder,m_nZOrder);
+}
+// -----------------------------------------------------------------------------
+drawing::HomogenMatrix3 SAL_CALL OShape::getTransformation() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_TRANSFORMATION) >>= m_Transformation;
+ return m_Transformation;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setTransformation( const drawing::HomogenMatrix3& _transformation ) throw (uno::RuntimeException)
+{
+ m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_TRANSFORMATION,uno::makeAny(_transformation));
+ set(PROPERTY_TRANSFORMATION,_transformation,m_Transformation);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OShape::getCustomShapeEngine() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEENGINE) >>= m_CustomShapeEngine;
+
+ return m_CustomShapeEngine;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setCustomShapeEngine( const ::rtl::OUString& _customshapeengine ) throw (uno::RuntimeException)
+{
+ m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEENGINE,uno::makeAny(_customshapeengine));
+ set(PROPERTY_CUSTOMSHAPEENGINE,_customshapeengine,m_CustomShapeEngine);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OShape::getCustomShapeData() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEDATA) >>= m_CustomShapeData;
+ return m_CustomShapeData;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setCustomShapeData( const ::rtl::OUString& _customshapedata ) throw (uno::RuntimeException)
+{
+ m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEDATA,uno::makeAny(_customshapedata));
+ set(PROPERTY_CUSTOMSHAPEDATA,_customshapedata,m_CustomShapeData);
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< beans::PropertyValue > SAL_CALL OShape::getCustomShapeGeometry() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_aProps.aComponent.m_xProperty->getPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY) >>= m_CustomShapeGeometry;
+ return m_CustomShapeGeometry;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setCustomShapeGeometry( const uno::Sequence< beans::PropertyValue >& _customshapegeometry ) throw (uno::RuntimeException)
+{
+ m_aProps.aComponent.m_xProperty->setPropertyValue(PROPERTY_CUSTOMSHAPEGEOMETRY,uno::makeAny(_customshapegeometry));
+ set(PROPERTY_CUSTOMSHAPEGEOMETRY,_customshapegeometry,m_CustomShapeGeometry);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+
+// =============================================================================
+}// namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/Tools.cxx b/reportdesign/source/core/api/Tools.cxx
new file mode 100644
index 000000000000..6e1be58179e3
--- /dev/null
+++ b/reportdesign/source/core/api/Tools.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Tools.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_TOOLS_HXX
+#include "Tools.hxx"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#include "core_resource.hxx"
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+using namespace com::sun::star;
+
+uno::Reference< report::XSection> lcl_getSection(const uno::Reference< uno::XInterface>& _xReportComponent)
+{
+ uno::Reference< container::XChild> xChild(_xReportComponent,uno::UNO_QUERY);
+ uno::Reference< report::XSection> xRet(_xReportComponent,uno::UNO_QUERY);
+ while( !xRet.is() && xChild.is() )
+ {
+ uno::Reference< uno::XInterface> xTemp = xChild->getParent();
+ xChild.set(xTemp,uno::UNO_QUERY);
+ xRet.set(xTemp,uno::UNO_QUERY);
+ }
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+void throwIllegallArgumentException( const ::rtl::OUString& _sTypeName
+ ,const uno::Reference< uno::XInterface >& ExceptionContext_
+ ,const ::sal_Int16& ArgumentPosition_
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context_
+ )
+{
+ ::rtl::OUString sErrorMessage(RPT_RESSTRING(RID_STR_ERROR_WRONG_ARGUMENT,Context_->getServiceManager()));
+ sErrorMessage = sErrorMessage.replaceAt(sErrorMessage.indexOf('#'),2,_sTypeName);
+ throw lang::IllegalArgumentException(sErrorMessage,ExceptionContext_,ArgumentPosition_);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< util::XCloneable > cloneObject(const uno::Reference< report::XReportComponent>& _xReportComponent
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,const ::rtl::OUString& _sServiceName)
+{
+ OSL_ENSURE(_xReportComponent.is() && _xFactory.is() ,"reportcomponent is null -> GPF");
+ uno::Reference< report::XReportComponent> xClone(_xFactory->createInstance(_sServiceName),uno::UNO_QUERY_THROW);
+ ::comphelper::copyProperties(_xReportComponent.get(),xClone.get());
+ return xClone.get();
+}
+// -----------------------------------------------------------------------------
+
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/makefile.mk b/reportdesign/source/core/api/makefile.mk
new file mode 100644
index 000000000000..d27c357c79f7
--- /dev/null
+++ b/reportdesign/source/core/api/makefile.mk
@@ -0,0 +1,71 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=api
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- Files -------------------------------------
+SLOFILES= \
+ $(SLO)$/FormattedField.obj \
+ $(SLO)$/Groups.obj \
+ $(SLO)$/Group.obj \
+ $(SLO)$/Section.obj \
+ $(SLO)$/services.obj \
+ $(SLO)$/FixedText.obj \
+ $(SLO)$/ImageControl.obj \
+ $(SLO)$/ReportDefinition.obj \
+ $(SLO)$/ReportComponent.obj \
+ $(SLO)$/ReportEngineJFree.obj \
+ $(SLO)$/Tools.obj \
+ $(SLO)$/Function.obj \
+ $(SLO)$/Functions.obj \
+ $(SLO)$/ReportControlModel.obj \
+ $(SLO)$/FormatCondition.obj \
+ $(SLO)$/ReportVisitor.obj \
+ $(SLO)$/Shape.obj \
+ $(SLO)$/FixedLine.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/reportdesign/source/core/api/services.cxx b/reportdesign/source/core/api/services.cxx
new file mode 100644
index 000000000000..e2592253e31b
--- /dev/null
+++ b/reportdesign/source/core/api/services.cxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: services.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:14 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SAL_TYPES_H_
+#include "sal/types.h"
+#endif
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _CPPUHELPER_IMPLEMENATIONENTRY_HXX_
+#include <cppuhelper/implementationentry.hxx>
+#endif
+
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#include "ReportDefinition.hxx"
+#endif
+#ifndef RPT_FORMATTEDFIELD_HXX
+#include "FormattedField.hxx"
+#endif
+#include "FixedText.hxx"
+#include "ImageControl.hxx"
+#include "FormatCondition.hxx"
+#include "ReportEngineJFree.hxx"
+#include "Function.hxx"
+#include "Shape.hxx"
+#include "FixedLine.hxx"
+
+/********************************************************************************************/
+
+using namespace ::rtl;
+using namespace ::reportdesign;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+
+//***************************************************************************************
+//
+// registry functions
+namespace
+{
+
+cppu::ImplementationEntry entries[] = {
+ { &OReportDefinition::create, &OReportDefinition::getImplementationName_Static, &OReportDefinition::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OFormattedField::create, &OFormattedField::getImplementationName_Static, &OFormattedField::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OFixedText::create, &OFixedText::getImplementationName_Static, &OFixedText::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OImageControl::create, &OImageControl::getImplementationName_Static, &OImageControl::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OFormatCondition::create, &OFormatCondition::getImplementationName_Static, &OFormatCondition::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OReportEngineJFree::create, &OReportEngineJFree::getImplementationName_Static, &OReportEngineJFree::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OFunction::create, &OFunction::getImplementationName_Static, &OFunction::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OShape::create, &OShape::getImplementationName_Static, &OShape::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OFixedLine::create, &OFixedLine::getImplementationName_Static, &OFixedLine::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+}
+
+extern "C"
+{
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+ char const * implName, void * serviceManager, void * registryKey)
+{
+ return cppu::component_getFactoryHelper(
+ implName, serviceManager, registryKey, entries);
+}
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ char const ** envTypeName, uno_Environment **)
+{
+ *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
+ void * serviceManager, void * registryKey)
+{
+ return cppu::component_writeInfoHelper(
+ serviceManager, registryKey, entries);
+}
+} // extern "C"
diff --git a/reportdesign/source/core/inc/FixedLine.hxx b/reportdesign/source/core/inc/FixedLine.hxx
new file mode 100644
index 000000000000..29cb1e6dd511
--- /dev/null
+++ b/reportdesign/source/core/inc/FixedLine.hxx
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedLine.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPT_FIXEDLINE_HXX
+#define RPT_FIXEDLINE_HXX
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFIXEDLINE_HPP_
+#include <com/sun/star/report/XFixedLine.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XFixedLine > FixedLinePropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFixedLine
+ ,com::sun::star::lang::XServiceInfo > FixedLineBase;
+
+ /** \class OFixedLine Defines the implementation of a \interface com:::sun::star::report::XFixedLine
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFixedLine : public comphelper::OBaseMutex,
+ public FixedLineBase,
+ public FixedLinePropertySet
+ {
+ friend class OShapeHelper;
+ OReportControlModel m_aProps;
+ ::com::sun::star::drawing::LineStyle m_LineStyle;
+ ::com::sun::star::drawing::LineDash m_LineDash;
+ sal_Int32 m_nOrientation;
+ ::sal_Int32 m_LineColor;
+ ::sal_Int16 m_LineTransparence;
+ ::sal_Int32 m_LineWidth;
+
+ private:
+ OFixedLine(const OFixedLine&);
+ OFixedLine& operator=(const OFixedLine&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OFixedLine();
+ public:
+ explicit OFixedLine(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OFixedLine(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+
+ // XShape
+ SHAPE_HEADER()
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlModel
+ REPORTCONTROLMODEL_HEADER()
+
+ // XFixedLine
+ virtual ::sal_Int32 SAL_CALL getOrientation() throw (::com::sun::star::beans::UnknownPropertyException,::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setOrientation( ::sal_Int32 _orientation ) throw (::com::sun::star::beans::UnknownPropertyException,::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::drawing::LineStyle SAL_CALL getLineStyle() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLineStyle( ::com::sun::star::drawing::LineStyle _linestyle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::drawing::LineDash SAL_CALL getLineDash() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLineDash( const ::com::sun::star::drawing::LineDash& _linedash ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getLineColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLineColor( ::sal_Int32 _linecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getLineTransparence() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLineTransparence( ::sal_Int16 _linetransparence ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getLineWidth() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLineWidth( ::sal_Int32 _linewidth ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::report::XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_FIXEDLINE_HXX
+
diff --git a/reportdesign/source/core/inc/FixedText.hxx b/reportdesign/source/core/inc/FixedText.hxx
new file mode 100644
index 000000000000..0a5e43b8edaa
--- /dev/null
+++ b/reportdesign/source/core/inc/FixedText.hxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FixedText.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_FIXEDTEXT_HXX
+#define RPT_FIXEDTEXT_HXX
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFIXEDTEXT_HPP_
+#include <com/sun/star/report/XFixedText.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XFixedText > FixedTextPropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFixedText
+ ,com::sun::star::lang::XServiceInfo > FixedTextBase;
+
+ /** \class OFixedText Defines the implementation of a \interface com:::sun::star::report::XFixedText
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFixedText : public comphelper::OBaseMutex,
+ public FixedTextBase,
+ public FixedTextPropertySet
+ {
+ friend class OShapeHelper;
+ OReportControlModel m_aProps;
+ ::rtl::OUString m_sLabel;
+ ::sal_Bool m_bMultiLine;
+ private:
+ OFixedText(const OFixedText&);
+ OFixedText& operator=(const OFixedText&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( _member != _Value )
+ {
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ }
+ l.notify();
+ }
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OFixedText();
+ public:
+ explicit OFixedText(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OFixedText(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+ // XShape
+ SHAPE_HEADER()
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlModel
+ REPORTCONTROLMODEL_HEADER()
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XFixedText
+ virtual ::rtl::OUString SAL_CALL getLabel() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLabel( const ::rtl::OUString& _label ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getMultiLine() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMultiLine( ::sal_Bool _multiline ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::report::XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_FIXEDTEXT_HXX
+
diff --git a/reportdesign/source/core/inc/FormatCondition.hxx b/reportdesign/source/core/inc/FormatCondition.hxx
new file mode 100644
index 000000000000..35cc247f5c81
--- /dev/null
+++ b/reportdesign/source/core/inc/FormatCondition.hxx
@@ -0,0 +1,137 @@
+#ifndef RPT_FORMATCONDITION_HXX
+#define RPT_FORMATCONDITION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormatCondition.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATCONDITION_HPP_
+#include <com/sun/star/report/XFormatCondition.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XFormatCondition > FormatConditionPropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFormatCondition
+ ,com::sun::star::lang::XServiceInfo > FormatConditionBase;
+
+ /** \class OFormatCondition Defines the implementation of a \interface com:::sun::star::report::XFormatCondition
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFormatCondition : public comphelper::OBaseMutex,
+ public FormatConditionBase,
+ public FormatConditionPropertySet
+ {
+ OFormatProperties m_aFormatProperties;
+ ::rtl::OUString m_sFormula;
+ sal_Bool m_bEnabled;
+ private:
+ OFormatCondition(const OFormatCondition&);
+ OFormatCondition& operator=(const OFormatCondition&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+ protected:
+ virtual ~OFormatCondition();
+ public:
+ explicit OFormatCondition(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ );
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XFormatCondition
+ virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFormula( const ::rtl::OUString& _formula ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+ };
+}
+#endif //RPT_FORMATCONDITION_HXX
+
diff --git a/reportdesign/source/core/inc/FormattedField.hxx b/reportdesign/source/core/inc/FormattedField.hxx
new file mode 100644
index 000000000000..4075111ac745
--- /dev/null
+++ b/reportdesign/source/core/inc/FormattedField.hxx
@@ -0,0 +1,189 @@
+#ifndef RPT_FORMATTEDFIELD_HXX
+#define RPT_FORMATTEDFIELD_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: FormattedField.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_FUNCTION_HPP_
+#include <com/sun/star/report/Function.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XFormattedField > FormattedFieldPropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFormattedField
+ ,com::sun::star::lang::XServiceInfo > FormattedFieldBase;
+
+ /** \class OFormattedField Defines the implementation of a \interface com:::sun::star::report::XFormattedField
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFormattedField : public comphelper::OBaseMutex,
+ public FormattedFieldBase,
+ public FormattedFieldPropertySet
+ {
+ friend class OShapeHelper;
+
+ OReportControlModel m_aProps;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
+ m_xFormatsSupplier;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction> m_xFunction;
+ ::sal_Int32 m_nFormatKey;
+
+ private:
+ OFormattedField(const OFormattedField&);
+ OFormattedField& operator=(const OFormattedField&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( _member != _Value )
+ {
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ }
+ l.notify();
+ }
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OFormattedField();
+ public:
+ explicit OFormattedField(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OFormattedField(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+
+ // XShape
+ SHAPE_HEADER()
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlModel
+ REPORTCONTROLMODEL_HEADER()
+
+ // XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XFormattedField
+ virtual ::sal_Int32 SAL_CALL getFormatKey() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFormatKey(::sal_Int32 the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > SAL_CALL getFormatsSupplier() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFormatsSupplier( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& _formatssupplier ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_FORMATTEDFIELD_HXX
+
diff --git a/reportdesign/source/core/inc/Function.hxx b/reportdesign/source/core/inc/Function.hxx
new file mode 100644
index 000000000000..6e301547d779
--- /dev/null
+++ b/reportdesign/source/core/inc/Function.hxx
@@ -0,0 +1,147 @@
+#ifndef RPT_FUNCTION_HXX
+#define RPT_FUNCTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Function.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFunction_HPP_
+#include <com/sun/star/report/XFunction.hpp>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include <cppuhelper/basemutex.hxx>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XFunction > FunctionPropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFunction
+ ,com::sun::star::lang::XServiceInfo > FunctionBase;
+
+ /** \class OFunction Defines the implementation of a \interface com:::sun::star::report::XFunction
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFunction : public cppu::BaseMutex,
+ public FunctionBase,
+ public FunctionPropertySet
+ {
+ com::sun::star::beans::Optional< ::rtl::OUString> m_sInitialFormula;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XFunctions > m_xParent;
+ ::rtl::OUString m_sName;
+ ::rtl::OUString m_sFormula;
+ ::sal_Bool m_bPreEvaluated;
+ ::sal_Bool m_bDeepTraversing;
+ private:
+ OFunction(const OFunction&);
+ OFunction& operator=(const OFunction&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+ protected:
+ virtual ~OFunction();
+ public:
+ explicit OFunction(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::report::XFunction:
+ virtual ::sal_Bool SAL_CALL getPreEvaluated() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPreEvaluated(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getDeepTraversing() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDeepTraversing(::sal_Bool the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getFormula() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFormula(const ::rtl::OUString & the_value) throw (::com::sun::star::uno::RuntimeException);
+ virtual com::sun::star::beans::Optional< ::rtl::OUString> SAL_CALL getInitialFormula() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setInitialFormula(const com::sun::star::beans::Optional< ::rtl::OUString> & the_value) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_FUNCTION_HXX
+
diff --git a/reportdesign/source/core/inc/Functions.hxx b/reportdesign/source/core/inc/Functions.hxx
new file mode 100644
index 000000000000..44644782f9f3
--- /dev/null
+++ b/reportdesign/source/core/inc/Functions.hxx
@@ -0,0 +1,121 @@
+#ifndef REPORTDESIGN_API_FUNCTIONS_HXX
+#define REPORTDESIGN_API_FUNCTIONS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Functions.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTIONS_HPP_
+#include <com/sun/star/report/XFunctions.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTIONSSUPPLIER_HPP_
+#include <com/sun/star/report/XFunctionsSupplier.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE1_HXX_
+#include <cppuhelper/compbase1.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#include <list>
+
+
+namespace reportdesign
+{
+ typedef ::cppu::WeakComponentImplHelper1< com::sun::star::report::XFunctions> FunctionsBase;
+ /** \class OFunctions Defines the implementation of a \interface com:::sun::star::report::XFunctions
+ * \ingroup reportdesign_api
+ *
+ */
+ class OFunctions : public comphelper::OBaseMutex,
+ public FunctionsBase
+ {
+ typedef ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > > TFunctions;
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XFunctionsSupplier > m_xParent;
+ TFunctions m_aFunctions;
+ private:
+ OFunctions& operator=(const OFunctions&);
+ OFunctions(const OFunctions&);
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OFunctions();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ explicit OFunctions( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier >& _xParent
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
+
+ void copyFunctions(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions >& _xSource);
+
+ // XFunctions
+ // Methods
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > SAL_CALL createFunction( ) throw (::com::sun::star::uno::RuntimeException);
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::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);
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+ };
+}
+#endif // REPORTDESIGN_API_FUNCTIONS_HXX
+
diff --git a/reportdesign/source/core/inc/Group.hxx b/reportdesign/source/core/inc/Group.hxx
new file mode 100644
index 000000000000..8d140c0469ad
--- /dev/null
+++ b/reportdesign/source/core/inc/Group.hxx
@@ -0,0 +1,183 @@
+#ifndef REPORTDESIGN_API_GROUP_HXX
+#define REPORTDESIGN_API_GROUP_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Group.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XGROUP_HPP_
+#include <com/sun/star/report/XGroup.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef RPT_SHARED_GROUPS_PROPERTIES_HXX
+#include "GroupProperties.hxx"
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace reportdesign
+{
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XGroup
+ , ::com::sun::star::lang::XServiceInfo> GroupBase;
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XGroup> GroupPropertySet;
+
+ /** \class OGroup Defines the implementation of a \interface com:::sun::star::report::XGroup
+ * \ingroup reportdesign_api
+ *
+ */
+ class OGroup : public comphelper::OMutexAndBroadcastHelper
+ ,public GroupBase
+ ,public GroupPropertySet
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XGroups > m_xParent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xHeader;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> m_xFooter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > m_xFunctions;
+ ::rptshared::GroupProperties m_aProps;
+
+ private:
+ OGroup& operator=(const OGroup&);
+ OGroup(const OGroup&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( _member != _Value )
+ {
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ }
+ l.notify();
+ }
+ void setSection( const ::rtl::OUString& _sProperty
+ ,const sal_Bool& _bOn
+ ,const ::rtl::OUString& _sName
+ ,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _member);
+ protected:
+ virtual ~OGroup();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ OGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups >& _xParent
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
+
+ void copyGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xSource);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XGroup
+ virtual ::sal_Bool SAL_CALL getSortAscending() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setSortAscending( ::sal_Bool _sortascending ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getHeaderOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHeaderOn( ::sal_Bool _headeron ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getFooterOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFooterOn( ::sal_Bool _footeron ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getHeader() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > SAL_CALL getFooter() throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getGroupOn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupOn( ::sal_Int16 _groupon ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getGroupInterval() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupInterval( ::sal_Int32 _groupinterval ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getKeepTogether() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setKeepTogether( ::sal_Int16 _keeptogether ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups > SAL_CALL getGroups() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getExpression() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setExpression( const ::rtl::OUString& _expression ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getStartNewColumn() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setStartNewColumn( ::sal_Bool _startnewcolumn ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getResetPageNumber() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setResetPageNumber( ::sal_Bool _resetpagenumber ) throw (::com::sun::star::uno::RuntimeException);
+
+ //XFunctionsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > SAL_CALL getFunctions() throw (::com::sun::star::uno::RuntimeException);
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext(){ return m_xContext; }
+ };
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+#endif //
diff --git a/reportdesign/source/core/inc/Groups.hxx b/reportdesign/source/core/inc/Groups.hxx
new file mode 100644
index 000000000000..9619b60a0033
--- /dev/null
+++ b/reportdesign/source/core/inc/Groups.hxx
@@ -0,0 +1,120 @@
+#ifndef REPORTDESIGN_API_GROUPS_HXX
+#define REPORTDESIGN_API_GROUPS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Groups.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XGROUPS_HPP_
+#include <com/sun/star/report/XGroups.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE1_HXX_
+#include <cppuhelper/compbase1.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#include <list>
+
+
+namespace reportdesign
+{
+ typedef ::cppu::WeakComponentImplHelper1< com::sun::star::report::XGroups> GroupsBase;
+ /** \class OGroups Defines the implementation of a \interface com:::sun::star::report::XGroups
+ * \ingroup reportdesign_api
+ *
+ */
+ class OGroups : public comphelper::OBaseMutex,
+ public GroupsBase
+ {
+ typedef ::std::list< ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > > TGroups;
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XReportDefinition > m_xParent;
+ TGroups m_aGroups;
+ private:
+ OGroups& operator=(const OGroups&);
+ OGroups(const OGroups&);
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OGroups();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ OGroups( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xParent
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
+
+ void copyGroups(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups >& _xSource);
+
+ // XGroups
+ // Attributes
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > SAL_CALL getReportDefinition() throw (::com::sun::star::uno::RuntimeException);
+ // Methods
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > SAL_CALL createGroup( ) throw (::com::sun::star::uno::RuntimeException);
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::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);
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+ };
+}
+#endif // REPORTDESIGN_API_GROUPS_HXX
+
diff --git a/reportdesign/source/core/inc/ImageControl.hxx b/reportdesign/source/core/inc/ImageControl.hxx
new file mode 100644
index 000000000000..7f8fdf7307ed
--- /dev/null
+++ b/reportdesign/source/core/inc/ImageControl.hxx
@@ -0,0 +1,184 @@
+#ifndef RPT_IMAGECONTROL_HXX
+#define RPT_IMAGECONTROL_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ImageControl.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XIMAGECONTROL_HPP_
+#include <com/sun/star/report/XImageControl.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XImageControl > ImageControlPropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XImageControl
+ ,com::sun::star::lang::XServiceInfo > ImageControlBase;
+
+ /** \class OImageControl Defines the implementation of a \interface com:::sun::star::report::XImageControl
+ * \ingroup reportdesign_api
+ *
+ */
+ class OImageControl : public comphelper::OBaseMutex,
+ public ImageControlBase,
+ public ImageControlPropertySet
+ {
+ friend class OShapeHelper;
+ OReportControlModel m_aProps;
+ ::rtl::OUString m_aImageURL;
+ ::sal_Bool m_bScaleImage;
+ ::sal_Bool m_bPreserveIRI;
+ private:
+ OImageControl(const OImageControl&);
+ OImageControl& operator=(const OImageControl&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+ void checkIndex(sal_Int32 _nIndex);
+ protected:
+ virtual ~OImageControl();
+ public:
+ explicit OImageControl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OImageControl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+ // XShape
+ SHAPE_HEADER()
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlModel
+ REPORTCONTROLMODEL_HEADER()
+
+ // XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XImageControl
+ virtual ::sal_Bool SAL_CALL getScaleImage() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setScaleImage( ::sal_Bool _scaleimage ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setImageURL( const ::rtl::OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getPreserveIRI() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPreserveIRI( ::sal_Bool _preserveiri ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XImageProducerSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer > SAL_CALL getImageProducer( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_IMAGECONTROL_HXX
+
diff --git a/reportdesign/source/core/inc/ReportComponent.hxx b/reportdesign/source/core/inc/ReportComponent.hxx
new file mode 100644
index 000000000000..5ddafce280cc
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportComponent.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportComponent.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCOMPONENT_HXX
+#define RPT_REPORTCOMPONENT_HXX
+
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
+#include <com/sun/star/container/XChild.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_
+#include <com/sun/star/drawing/XShape.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XAGGREGATION_HPP_
+#include <com/sun/star/uno/XAggregation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _CPPUHELPER_WEAKREF_HXX_
+#include <cppuhelper/weakref.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+
+namespace reportdesign
+{
+ class OReportComponentProperties
+ {
+ public:
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::container::XChild > m_xParent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ m_xFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > m_xShape;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxy;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xProperty;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xTypeProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > m_xUnoTunnel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > m_xServiceInfo;
+ ::rtl::OUString m_sName;
+ ::sal_Int32 m_nHeight;
+ ::sal_Int32 m_nWidth;
+ ::sal_Int32 m_nPosX;
+ ::sal_Int32 m_nPosY;
+ ::sal_Int32 m_nBorderColor;
+ ::sal_Int16 m_nBorder;
+ ::sal_Bool m_bPrintRepeatedValues;
+
+ OReportComponentProperties(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ )
+ :m_xContext(_xContext)
+ ,m_nHeight(0)
+ ,m_nWidth(0)
+ ,m_nPosX(0)
+ ,m_nPosY(0)
+ ,m_nBorderColor(0)
+ ,m_nBorder(2)
+ ,m_bPrintRepeatedValues(sal_True)
+ {}
+ ~OReportComponentProperties();
+
+ void setShape(::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xTunnel
+ ,oslInterlockedCount& _rRefCount);
+
+ void dispose(oslInterlockedCount& _rRefCount);
+ };
+}
+#endif // RPT_REPORTCOMPONENT_HXX
+
diff --git a/reportdesign/source/core/inc/ReportControlModel.hxx b/reportdesign/source/core/inc/ReportControlModel.hxx
new file mode 100644
index 000000000000..25a88f5142bc
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportControlModel.hxx
@@ -0,0 +1,161 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportControlModel.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#define RPT_REPORTCONTROLMODEL_HXX
+
+#ifndef RPT_REPORTCOMPONENT_HXX
+#include "ReportComponent.hxx"
+#endif
+#ifndef _COM_SUN_STAR_STYLE_VERTICALALIGNMENT_HPP_
+#include "com/sun/star/style/VerticalAlignment.hpp"
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include "com/sun/star/awt/FontDescriptor.hpp"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATCONDITION_HPP_
+#include "com/sun/star/report/XFormatCondition.hpp"
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_
+#include "com/sun/star/container/XContainer.hpp"
+#endif
+#ifndef _COM_SUN_STAR_LANG_INDEXOUTOFBOUNDSEXCEPTION_HPP_
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#endif
+#include <com/sun/star/lang/Locale.hpp>
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
+#include <cppuhelper/interfacecontainer.h>
+#endif
+
+
+namespace reportdesign
+{
+ bool operator==( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs );
+
+ inline bool operator!=( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs )
+ {
+ return !( _lhs == _rhs );
+ }
+
+ struct OFormatProperties
+ {
+ ::sal_Int16 nAlign;
+ ::com::sun::star::awt::FontDescriptor aFontDescriptor;
+ ::com::sun::star::lang::Locale aCharLocale;
+ ::sal_Int16 nFontEmphasisMark;
+ ::sal_Int16 nFontRelief;
+ ::sal_Int32 nTextColor;
+ ::sal_Int32 nTextLineColor;
+ ::sal_Int32 nCharUnderlineColor;
+ ::sal_Int32 nBackgroundColor;
+ ::rtl::OUString sCharCombinePrefix;
+ ::rtl::OUString sCharCombineSuffix;
+ ::rtl::OUString sHyperLinkURL;
+ ::rtl::OUString sHyperLinkTarget;
+ ::rtl::OUString sHyperLinkName;
+ ::rtl::OUString sVisitedCharStyleName;
+ ::rtl::OUString sUnvisitedCharStyleName;
+ short aVerticalAlignment;
+ ::sal_Int16 nCharEscapement;
+ ::sal_Int16 nCharCaseMap;
+ ::sal_Int16 nCharKerning;
+ ::sal_Int8 nCharEscapementHeight;
+ ::sal_Bool m_bBackgroundTransparent;
+ ::sal_Bool bCharFlash;
+ ::sal_Bool bCharAutoKerning;
+ ::sal_Bool bCharCombineIsOn;
+ ::sal_Bool bCharHidden;
+ ::sal_Bool bCharShadowed;
+ ::sal_Bool bCharContoured;
+ OFormatProperties();
+ };
+ class OReportControlModel
+ {
+ void checkIndex(sal_Int32 _nIndex);
+ OReportControlModel(OReportControlModel&);
+ void operator =(OReportControlModel&);
+ public:
+ ::cppu::OInterfaceContainerHelper aContainerListeners;
+ OReportComponentProperties aComponent;
+ OFormatProperties aFormatProperties;
+ ::com::sun::star::container::XContainer* m_pOwner;
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition> >
+ m_aFormatConditions;
+ osl::Mutex& m_rMutex;
+ ::rtl::OUString aDataField;
+ ::rtl::OUString aConditionalPrintExpression;
+ sal_Bool bPrintWhenGroupChange;
+
+ OReportControlModel(osl::Mutex& _rMutex
+ ,::com::sun::star::container::XContainer* _pOwner
+ ,::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
+ :aContainerListeners(_rMutex)
+ ,aComponent(_xContext)
+ ,m_pOwner(_pOwner)
+ ,m_rMutex(_rMutex)
+ ,bPrintWhenGroupChange(sal_False)
+ {}
+
+ void dispose(oslInterlockedCount& _rRefCount);
+
+ // XContainer
+ void addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ void removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XElementAccess
+ ::sal_Bool hasElements( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XIndexReplace
+ void replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ void insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ void removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ ::sal_Int32 getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Any getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ static bool isInterfaceForbidden(const ::com::sun::star::uno::Type& _rType);
+ };
+}
+#endif // RPT_REPORTCONTROLMODEL_HXX
+
diff --git a/reportdesign/source/core/inc/ReportDrawPage.hxx b/reportdesign/source/core/inc/ReportDrawPage.hxx
new file mode 100644
index 000000000000..d974a69f1c67
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportDrawPage.hxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportDrawPage.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef REPORTDRAWPAGE_HXX_INCLUDED
+#define REPORTDRAWPAGE_HXX_INCLUDED
+
+#ifndef _SVX_UNOWPAGE_HXX
+#include <svx/unopage.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+
+namespace reportdesign
+{
+ class OReportDrawPage : public SvxDrawPage
+ {
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XSection > m_xSection;
+ OReportDrawPage(const OReportDrawPage&);
+ void operator =(const OReportDrawPage&);
+ protected:
+ virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape )throw ();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
+ public:
+ OReportDrawPage(SdrPage* pPage,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ virtual ~OReportDrawPage() throw(){}
+ };
+}
+#endif //REPORTDRAWPAGE_HXX_INCLUDED
+
diff --git a/reportdesign/source/core/inc/ReportEngineJFree.hxx b/reportdesign/source/core/inc/ReportEngineJFree.hxx
new file mode 100644
index 000000000000..6eab0f0843f0
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportEngineJFree.hxx
@@ -0,0 +1,178 @@
+#ifndef REPORTDESIGN_API_REPORTENGINEJFREE_HXX
+#define REPORTDESIGN_API_REPORTENGINEJFREE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportEngineJFree.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XREPORTENGINE_HPP_
+#include <com/sun/star/report/XReportEngine.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_XROWSET_HPP_
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#include <comphelper/implementationreference.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+
+namespace reportdesign
+{
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XReportEngine
+ ,com::sun::star::lang::XServiceInfo> ReportEngineBase;
+ typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportEngine> ReportEnginePropertySet;
+
+ class OReportEngineJFree : public comphelper::OMutexAndBroadcastHelper,
+ public ReportEngineBase,
+ public ReportEnginePropertySet
+ {
+ typedef ::std::multimap< ::rtl::OUString, ::com::sun::star::uno::Any , ::comphelper::UStringMixLess> TComponentMap;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReport;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator> m_StatusIndicator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection;
+ private:
+ OReportEngineJFree(const OReportEngineJFree&);
+ OReportEngineJFree& operator=(const OReportEngineJFree&);
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+
+ /** transform the report defintion format into a jfree report format.
+ *
+ * \return The URL of the newly created file.
+ */
+ ::rtl::OUString transform();
+
+ /** returns the file url for a new model
+ *
+ * \return The new file url.
+ */
+ ::rtl::OUString getNewOutputName();
+
+ /** set the rowset properties.
+ *
+ */
+ void setRowSetProperties();
+
+ /** generates the order statement defined by the groups of the report
+ *
+ * \return the ORDER BY part
+ */
+ ::rtl::OUString getOrderStatement() const;
+ protected:
+ virtual ~OReportEngineJFree();
+ public:
+ typedef ::comphelper::ImplementationReference< OReportEngineJFree ,::com::sun::star::report::XReportEngine,::com::sun::star::uno::XWeak > TReportEngine;
+
+ OReportEngineJFree(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportEngine
+ // Attributes
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > SAL_CALL getReportDefinition() throw (::com::sun::star::uno::RuntimeException) ;
+ virtual void SAL_CALL setReportDefinition( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _reportdefinition ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getActiveConnection() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveConnection( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _activeconnection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator() throw (::com::sun::star::uno::RuntimeException) ;
+ virtual void SAL_CALL setStatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& _statusindicator ) throw (::com::sun::star::uno::RuntimeException) ;
+ // Methods
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL createDocumentModel( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL createDocumentAlive( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _frame ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::util::URL SAL_CALL createDocument( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) ;
+ virtual void SAL_CALL interrupt( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) ;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+ };
+}
+#endif //REPORTDESIGN_API_REPORTENGINEJFREE_HXX
diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx
new file mode 100644
index 000000000000..6d262a2c6cfa
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -0,0 +1,879 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportHelperImpl.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORTHELPERIMPL_HXX
+#define INCLUDED_REPORTHELPERIMPL_HXX
+// ::com::sun::star::report::XReportComponent:
+#define REPORTCOMPONENT_IMPL(clazz) \
+::rtl::OUString SAL_CALL clazz::getName() throw (uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return m_aProps.aComponent.m_sName; \
+} \
+void SAL_CALL clazz::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException,beans::PropertyVetoException) \
+{ \
+ set(PROPERTY_NAME,_name,m_aProps.aComponent.m_sName); \
+} \
+::sal_Int32 SAL_CALL clazz::getHeight() throw (uno::RuntimeException) \
+{ \
+ return getSize().Height; \
+} \
+void SAL_CALL clazz::setHeight( ::sal_Int32 _height ) throw (uno::RuntimeException) \
+{ \
+ awt::Size aSize = getSize(); \
+ aSize.Height = _height; \
+ setSize(aSize); \
+} \
+::sal_Int32 SAL_CALL clazz::getPositionX() throw (uno::RuntimeException) \
+{ \
+ return getPosition().X; \
+} \
+void SAL_CALL clazz::setPositionX( ::sal_Int32 _positionx ) throw (uno::RuntimeException) \
+{ \
+ awt::Point aPos = getPosition(); \
+ aPos.X = _positionx; \
+ setPosition(aPos); \
+} \
+::sal_Int32 SAL_CALL clazz::getPositionY() throw (uno::RuntimeException) \
+{ \
+ return getPosition().Y; \
+} \
+void SAL_CALL clazz::setPositionY( ::sal_Int32 _positiony ) throw (uno::RuntimeException) \
+{ \
+ awt::Point aPos = getPosition(); \
+ aPos.Y = _positiony; \
+ setPosition(aPos); \
+} \
+::sal_Int32 SAL_CALL clazz::getWidth() throw (uno::RuntimeException) \
+{ \
+ return getSize().Width; \
+} \
+void SAL_CALL clazz::setWidth( ::sal_Int32 _width ) throw (uno::RuntimeException) \
+{ \
+ awt::Size aSize = getSize(); \
+ aSize.Width = _width; \
+ setSize(aSize); \
+} \
+::sal_Bool SAL_CALL clazz::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return m_aProps.aComponent.m_bPrintRepeatedValues; \
+} \
+void SAL_CALL clazz::setPrintRepeatedValues( ::sal_Bool _printrepeatedvalues ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_PRINTREPEATEDVALUES,_printrepeatedvalues,m_aProps.aComponent.m_bPrintRepeatedValues); \
+} \
+uno::Reference< report::XSection > SAL_CALL clazz::getSection() throw (uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ uno::Reference< container::XChild > xParent(getParent( ),uno::UNO_QUERY); \
+ return lcl_getSection(xParent); \
+}
+#define REPORTCOMPONENT_IMPL2(clazz) \
+::sal_Int16 SAL_CALL clazz::getControlBorder() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return m_aProps.aComponent.m_nBorder; \
+} \
+void SAL_CALL clazz::setControlBorder( ::sal_Int16 _border ) throw (uno::RuntimeException,lang::IllegalArgumentException,beans::UnknownPropertyException)\
+{ \
+ set(PROPERTY_CONTROLBORDER,_border,m_aProps.aComponent.m_nBorder); \
+} \
+::sal_Int32 SAL_CALL clazz::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return m_aProps.aComponent.m_nBorderColor; \
+} \
+void SAL_CALL clazz::setControlBorderColor( ::sal_Int32 _bordercolor ) throw (uno::RuntimeException, lang::IllegalArgumentException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CONTROLBORDERCOLOR,_bordercolor,m_aProps.aComponent.m_nBorderColor); \
+} \
+
+// ::com::sun::star::report::XReportControlFormat:
+#define REPORTCONTROLFORMAT_IMPL1(clazz,varName) \
+::sal_Int32 SAL_CALL clazz::getControlBackground() throw (::com::sun::star::beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.m_bBackgroundTransparent ? COL_TRANSPARENT : varName.nBackgroundColor; \
+} \
+ \
+void SAL_CALL clazz::setControlBackground( ::sal_Int32 _backgroundcolor ) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ setControlBackgroundTransparent(_backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT)); \
+ set(PROPERTY_CONTROLBACKGROUND,_backgroundcolor,varName.nBackgroundColor); \
+} \
+ \
+::sal_Bool SAL_CALL clazz::getControlBackgroundTransparent() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.m_bBackgroundTransparent; \
+} \
+ \
+void SAL_CALL clazz::setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CONTROLBACKGROUNDTRANSPARENT,_controlbackgroundtransparent,varName.m_bBackgroundTransparent); \
+}
+
+#define REPORTCONTROLFORMAT_IMPL2(clazz,varName) \
+::sal_Int16 SAL_CALL clazz::getCharStrikeout() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Strikeout; \
+} \
+ \
+void SAL_CALL clazz::setCharStrikeout(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARSTRIKEOUT,the_value,varName.aFontDescriptor.Strikeout); \
+} \
+ \
+::sal_Bool SAL_CALL clazz::getCharWordMode() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.WordLineMode; \
+} \
+ \
+void SAL_CALL clazz::setCharWordMode(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARWORDMODE,the_value,varName.aFontDescriptor.WordLineMode); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharRotation() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return static_cast<sal_Int16>(varName.aFontDescriptor.Orientation); \
+} \
+ \
+void SAL_CALL clazz::setCharRotation(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ float newValue = the_value; \
+ set(PROPERTY_CHARROTATION,newValue,varName.aFontDescriptor.Orientation); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharScaleWidth() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return static_cast<sal_Int16>(varName.aFontDescriptor.CharacterWidth); \
+} \
+ \
+void SAL_CALL clazz::setCharScaleWidth(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ float newValue = the_value; \
+ set(PROPERTY_CHARSCALEWIDTH,newValue,varName.aFontDescriptor.CharacterWidth); \
+} \
+::sal_Int16 SAL_CALL clazz::getParaAdjust() throw (uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nAlign; \
+} \
+ \
+void SAL_CALL clazz::setParaAdjust( ::sal_Int16 _align ) throw (uno::RuntimeException) \
+{ \
+ set(PROPERTY_PARAADJUST,_align,varName.nAlign); \
+} \
+ \
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor; \
+} \
+ \
+void SAL_CALL clazz::setFontDescriptor( const awt::FontDescriptor& _fontdescriptor ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_FONTDESCRIPTOR,_fontdescriptor,varName.aFontDescriptor); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getControlTextEmphasis() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nFontEmphasisMark; \
+} \
+ \
+void SAL_CALL clazz::setControlTextEmphasis( ::sal_Int16 _fontemphasismark ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_CONTROLTEXTEMPHASISMARK,_fontemphasismark,varName.nFontEmphasisMark); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharRelief() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nFontRelief; \
+} \
+ \
+void SAL_CALL clazz::setCharRelief( ::sal_Int16 _fontrelief ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARRELIEF,_fontrelief,varName.nFontRelief); \
+} \
+ \
+::sal_Int32 SAL_CALL clazz::getCharColor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nTextColor; \
+} \
+ \
+void SAL_CALL clazz::setCharColor( ::sal_Int32 _textcolor ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARCOLOR,_textcolor,varName.nTextColor); \
+} \
+ \
+::sal_Int32 SAL_CALL clazz::getCharUnderlineColor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nTextLineColor; \
+} \
+ \
+void SAL_CALL clazz::setCharUnderlineColor( ::sal_Int32 _textlinecolor ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARUNDERLINECOLOR,_textlinecolor,varName.nTextLineColor); \
+} \
+ \
+short SAL_CALL clazz::getParaVertAlignment() throw (uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aVerticalAlignment; \
+} \
+ \
+void SAL_CALL clazz::setParaVertAlignment( short _verticalalign ) throw (lang::IllegalArgumentException,uno::RuntimeException) \
+{ \
+ if ( _verticalalign < text::ParagraphVertAlign::AUTOMATIC || _verticalalign > text::ParagraphVertAlign::BOTTOM ) \
+ throw lang::IllegalArgumentException(); \
+ set(PROPERTY_VERTICALALIGN,_verticalalign,varName.aVerticalAlignment); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharEmphasis() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ return getControlTextEmphasis(); \
+} \
+ \
+void SAL_CALL clazz::setCharEmphasis( ::sal_Int16 _charemphasis ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHAREMPHASIS,_charemphasis,varName.nFontEmphasisMark); \
+} \
+ \
+::rtl::OUString SAL_CALL clazz::getCharFontName() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Name; \
+} \
+ \
+void SAL_CALL clazz::setCharFontName( const ::rtl::OUString& _charfontname ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARFONTNAME,_charfontname,varName.aFontDescriptor.Name); \
+} \
+ \
+::rtl::OUString SAL_CALL clazz::getCharFontStyleName() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.StyleName; \
+} \
+ \
+void SAL_CALL clazz::setCharFontStyleName( const ::rtl::OUString& _charfontstylename ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARFONTSTYLENAME,_charfontstylename,varName.aFontDescriptor.StyleName); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharFontFamily() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Family; \
+} \
+ \
+void SAL_CALL clazz::setCharFontFamily( ::sal_Int16 _charfontfamily ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARFONTFAMILY,_charfontfamily,varName.aFontDescriptor.Family); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharFontCharSet() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.CharSet; \
+} \
+ \
+void SAL_CALL clazz::setCharFontCharSet( ::sal_Int16 _charfontcharset ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARFONTCHARSET,_charfontcharset,varName.aFontDescriptor.CharSet); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharFontPitch() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Pitch; \
+} \
+ \
+void SAL_CALL clazz::setCharFontPitch( ::sal_Int16 _charfontpitch ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARFONTPITCH,_charfontpitch,varName.aFontDescriptor.Pitch); \
+} \
+ \
+float SAL_CALL clazz::getCharHeight() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Height; \
+} \
+ \
+void SAL_CALL clazz::setCharHeight( float _charheight ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARHEIGHT,static_cast<sal_Int16>(_charheight),varName.aFontDescriptor.Height); \
+} \
+ \
+::sal_Int16 SAL_CALL clazz::getCharUnderline() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Underline; \
+} \
+ \
+void SAL_CALL clazz::setCharUnderline( ::sal_Int16 _charunderline ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARUNDERLINE,_charunderline,varName.aFontDescriptor.Underline); \
+} \
+ \
+float SAL_CALL clazz::getCharWeight() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Weight; \
+} \
+ \
+void SAL_CALL clazz::setCharWeight( float _charweight ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARWEIGHT,_charweight,varName.aFontDescriptor.Weight); \
+} \
+ \
+awt::FontSlant SAL_CALL clazz::getCharPosture() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aFontDescriptor.Slant; \
+} \
+ \
+void SAL_CALL clazz::setCharPosture( awt::FontSlant _charposture ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_CHARPOSTURE,_charposture,varName.aFontDescriptor.Slant); \
+}\
+::sal_Bool SAL_CALL clazz::getCharFlash() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharFlash; \
+} \
+void SAL_CALL clazz::setCharFlash(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ set(PROPERTY_CHARFLASH,the_value,varName.bCharFlash); \
+}\
+::sal_Bool SAL_CALL clazz::getCharAutoKerning() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharAutoKerning; \
+} \
+void SAL_CALL clazz::setCharAutoKerning(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ set(PROPERTY_CHARAUTOKERNING,the_value,varName.bCharAutoKerning); \
+}\
+::sal_Int8 SAL_CALL clazz::getCharEscapementHeight() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nCharEscapementHeight; \
+} \
+void SAL_CALL clazz::setCharEscapementHeight(::sal_Int8 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARESCAPEMENTHEIGHT,the_value,varName.nCharEscapementHeight); \
+}\
+lang::Locale SAL_CALL clazz::getCharLocale() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aCharLocale; \
+} \
+void SAL_CALL clazz::setCharLocale(const lang::Locale & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ BoundListeners l; \
+ { \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ if ( varName.aCharLocale.Language != the_value.Language \
+ || varName.aCharLocale.Country != the_value.Country \
+ || varName.aCharLocale.Variant != the_value.Variant ) \
+ { \
+ prepareSet(PROPERTY_CHARLOCALE, ::com::sun::star::uno::makeAny(varName.aCharLocale), ::com::sun::star::uno::makeAny(the_value), &l); \
+ varName.aCharLocale = the_value; \
+ } \
+ } \
+ l.notify(); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharEscapement() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nCharEscapement; \
+} \
+void SAL_CALL clazz::setCharEscapement(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARESCAPEMENT,the_value,varName.nCharEscapement); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharCaseMap() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nCharCaseMap; \
+} \
+void SAL_CALL clazz::setCharCaseMap(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARCASEMAP,the_value,varName.nCharCaseMap); \
+}\
+::sal_Bool SAL_CALL clazz::getCharCombineIsOn() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharCombineIsOn; \
+} \
+void SAL_CALL clazz::setCharCombineIsOn(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARCOMBINEISON,the_value,varName.bCharCombineIsOn); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharCombinePrefix() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sCharCombinePrefix; \
+} \
+void SAL_CALL clazz::setCharCombinePrefix(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARCOMBINEPREFIX,the_value,varName.sCharCombinePrefix); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharCombineSuffix() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sCharCombineSuffix; \
+} \
+void SAL_CALL clazz::setCharCombineSuffix(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARCOMBINESUFFIX,the_value,varName.sCharCombineSuffix); \
+}\
+::sal_Bool SAL_CALL clazz::getCharHidden() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharHidden; \
+} \
+void SAL_CALL clazz::setCharHidden(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARHIDDEN,the_value,varName.bCharHidden); \
+}\
+::sal_Bool SAL_CALL clazz::getCharShadowed() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharShadowed; \
+} \
+void SAL_CALL clazz::setCharShadowed(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARSHADOWED,the_value,varName.bCharShadowed); \
+}\
+::sal_Bool SAL_CALL clazz::getCharContoured() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.bCharContoured; \
+} \
+void SAL_CALL clazz::setCharContoured(::sal_Bool the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CHARCONTOURED,the_value,varName.bCharContoured); \
+}\
+::rtl::OUString SAL_CALL clazz::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sHyperLinkURL; \
+} \
+void SAL_CALL clazz::setHyperLinkURL(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_HYPERLINKURL,the_value,varName.sHyperLinkURL); \
+}\
+::rtl::OUString SAL_CALL clazz::getHyperLinkTarget() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sHyperLinkTarget; \
+} \
+void SAL_CALL clazz::setHyperLinkTarget(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_HYPERLINKTARGET,the_value,varName.sHyperLinkTarget); \
+}\
+::rtl::OUString SAL_CALL clazz::getHyperLinkName() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sHyperLinkName; \
+} \
+void SAL_CALL clazz::setHyperLinkName(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_HYPERLINKNAME,the_value,varName.sHyperLinkName); \
+}\
+::rtl::OUString SAL_CALL clazz::getVisitedCharStyleName() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sVisitedCharStyleName; \
+} \
+void SAL_CALL clazz::setVisitedCharStyleName(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_VISITEDCHARSTYLENAME,the_value,varName.sVisitedCharStyleName); \
+}\
+::rtl::OUString SAL_CALL clazz::getUnvisitedCharStyleName() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.sUnvisitedCharStyleName; \
+} \
+void SAL_CALL clazz::setUnvisitedCharStyleName(const ::rtl::OUString & the_value) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_UNVISITEDCHARSTYLENAME,the_value,varName.sUnvisitedCharStyleName); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharKerning() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nCharKerning; \
+}\
+void SAL_CALL clazz::setCharKerning(::sal_Int16 the_value) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ set(PROPERTY_CHARKERNING,the_value,varName.nCharKerning); \
+}
+
+#define NO_REPORTCONTROLFORMAT_IMPL(clazz) \
+::sal_Int16 SAL_CALL clazz::getCharStrikeout() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setCharStrikeout(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharWordMode() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setCharWordMode(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int16 SAL_CALL clazz::getCharRotation() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setCharRotation(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int16 SAL_CALL clazz::getCharScaleWidth() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setCharScaleWidth(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharFlash() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharFlash(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharAutoKerning() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharAutoKerning(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int8 SAL_CALL clazz::getCharEscapementHeight() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharEscapementHeight(::sal_Int8 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+lang::Locale SAL_CALL clazz::getCharLocale() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharLocale(const lang::Locale & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int16 SAL_CALL clazz::getCharEscapement() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharEscapement(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int16 SAL_CALL clazz::getCharCaseMap() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharCaseMap(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharCombineIsOn() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharCombineIsOn(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::rtl::OUString SAL_CALL clazz::getCharCombinePrefix() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharCombinePrefix(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::rtl::OUString SAL_CALL clazz::getCharCombineSuffix() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharCombineSuffix(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharHidden() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharHidden(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharShadowed() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharShadowed(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Bool SAL_CALL clazz::getCharContoured() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setCharContoured(::sal_Bool /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::rtl::OUString SAL_CALL clazz::getVisitedCharStyleName() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setVisitedCharStyleName(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::rtl::OUString SAL_CALL clazz::getUnvisitedCharStyleName() throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setUnvisitedCharStyleName(const ::rtl::OUString & /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException) \
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+::sal_Int16 SAL_CALL clazz::getCharKerning() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setCharKerning(::sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{ \
+ throw beans::UnknownPropertyException();\
+}\
+\
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setFontDescriptor( const awt::FontDescriptor& /*_fontdescriptor*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getControlTextEmphasis() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setControlTextEmphasis( ::sal_Int16 /*_fontemphasismark*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharRelief() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharRelief( ::sal_Int16 /*_fontrelief*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int32 SAL_CALL clazz::getCharColor() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharColor( ::sal_Int32 /*_textcolor*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int32 SAL_CALL clazz::getCharUnderlineColor() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharUnderlineColor( ::sal_Int32 /*_textlinecolor*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+short SAL_CALL clazz::getParaVertAlignment() throw (uno::RuntimeException)\
+{\
+ ::osl::MutexGuard aGuard(m_aMutex);\
+ return m_aProps.aFormatProperties.aVerticalAlignment;\
+}\
+\
+void SAL_CALL clazz::setParaVertAlignment( short _verticalalign ) throw (lang::IllegalArgumentException,uno::RuntimeException)\
+{\
+ if ( _verticalalign < text::ParagraphVertAlign::AUTOMATIC || _verticalalign > text::ParagraphVertAlign::BOTTOM )\
+ throw lang::IllegalArgumentException();\
+ set(PROPERTY_VERTICALALIGN,_verticalalign,m_aProps.aFormatProperties.aVerticalAlignment);\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharEmphasis() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharEmphasis( ::sal_Int16 /*_charemphasis*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::rtl::OUString SAL_CALL clazz::getCharFontName() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharFontName( const ::rtl::OUString& /*_charfontname*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::rtl::OUString SAL_CALL clazz::getCharFontStyleName() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharFontStyleName( const ::rtl::OUString& /*_charfontstylename*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharFontFamily() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharFontFamily( ::sal_Int16 /*_charfontfamily*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharFontCharSet() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharFontCharSet( ::sal_Int16 /*_charfontcharset*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharFontPitch() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharFontPitch( ::sal_Int16 /*_charfontpitch*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+float SAL_CALL clazz::getCharHeight() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharHeight( float /*_charheight*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+::sal_Int16 SAL_CALL clazz::getCharUnderline() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharUnderline( ::sal_Int16 /*_charunderline*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+float SAL_CALL clazz::getCharWeight() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharWeight( float /*_charweight*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+awt::FontSlant SAL_CALL clazz::getCharPosture() throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setCharPosture( awt::FontSlant /*_charposture*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}
+
+// ::com::sun::star::report::XReportControlFormat:
+#define REPORTCONTROLFORMAT_IMPL(clazz,varName) \
+ REPORTCONTROLFORMAT_IMPL1(clazz,varName) \
+ REPORTCONTROLFORMAT_IMPL2(clazz,varName)
+
+
+#endif //INCLUDED_REPORTHELPERIMPL_HXX
+
diff --git a/reportdesign/source/core/inc/ReportUndoFactory.hxx b/reportdesign/source/core/inc/ReportUndoFactory.hxx
new file mode 100644
index 000000000000..454814951a86
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportUndoFactory.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportUndoFactory.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORT_UNDOFACTORY_HXX_INCLUDED
+#define REPORT_UNDOFACTORY_HXX_INCLUDED
+
+#include <svx/svdundo.hxx>
+#include <memory>
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+
+namespace rptui
+{
+ class OReportUndoFactory : public SdrUndoFactory
+ {
+ OModuleClient m_aModuleClient;
+ ::std::auto_ptr<SdrUndoFactory> m_pUndoFactory;
+
+ OReportUndoFactory(const OReportUndoFactory&);
+ OReportUndoFactory& operator=(const OReportUndoFactory&);
+ public:
+ OReportUndoFactory();
+ virtual ~OReportUndoFactory();
+
+ // shapes
+ virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoMoveObject( SdrObject& rObject, const Size& rDist );
+ virtual SdrUndoAction* CreateUndoGeoObject( SdrObject& rObject );
+ virtual SdrUndoAction* CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1 = false, bool bSaveText = false );
+ virtual SdrUndoAction* CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect = false);
+ virtual SdrUndoAction* CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect = false);
+
+ virtual SdrUndoAction* CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1);
+
+ virtual SdrUndoAction* CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect = false );
+ virtual SdrUndoAction* CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer );
+ virtual SdrUndoAction* CreateUndoObjectSetText( SdrObject& rNewObj );
+
+ // layer
+ virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
+ virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel);
+ virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
+
+ // page
+ virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoNewPage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoCopyPage(SdrPage& rPage);
+ virtual SdrUndoAction* CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1);
+
+ // master page
+ virtual SdrUndoAction* CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage);
+ virtual SdrUndoAction* CreateUndoPageChangeMasterPage(SdrPage& rChangedPage);
+
+ };
+//==============================================================================
+} // rptui
+//==============================================================================
+
+#endif // REPORT_UNDOFACTORY_HXX_INCLUDED
+
diff --git a/reportdesign/source/core/inc/RptObjectListener.hxx b/reportdesign/source/core/inc/RptObjectListener.hxx
new file mode 100644
index 000000000000..8cdf038f9242
--- /dev/null
+++ b/reportdesign/source/core/inc/RptObjectListener.hxx
@@ -0,0 +1,79 @@
+#ifndef _REPORT_RPTUILIST_HXX
+#define _REPORT_RPTUILIST_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptObjectListener.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
+#include <com/sun/star/container/XContainerListener.hpp>
+#endif
+
+namespace rptui
+{
+class OObjectBase;
+
+//============================================================================
+// OObjectListener
+//============================================================================
+
+typedef ::cppu::WeakImplHelper1< ::com::sun::star::beans::XPropertyChangeListener > TPropertyChangeListenerHelper;
+
+class OObjectListener: public TPropertyChangeListenerHelper
+{
+private:
+ OObjectBase* m_pObject;
+ OObjectListener(const OObjectListener&);
+ void operator =(const OObjectListener&);
+protected:
+ virtual ~OObjectListener();
+public:
+ OObjectListener(OObjectBase* _pObject);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
+};
+}
+#endif // _REPORT_RPTUILIST_HXX
diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx
new file mode 100644
index 000000000000..231cb0c5bfae
--- /dev/null
+++ b/reportdesign/source/core/inc/Section.hxx
@@ -0,0 +1,236 @@
+#ifndef REPORTDESIGN_API_SECTION_HXX
+#define REPORTDESIGN_API_SECTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Section.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _CPPUHELPER_COMPBASE3_HXX_
+#include <cppuhelper/compbase3.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
+#include <com/sun/star/drawing/XShapes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XAGGREGATION_HPP_
+#include <com/sun/star/uno/XAggregation.hpp>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#include <comphelper/implementationreference.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#endif
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace reportdesign
+{
+ typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::report::XSection
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XUnoTunnel> SectionBase;
+ typedef ::cppu::PropertySetMixin<com::sun::star::report::XSection> SectionPropertySet;
+
+ class OSection : public comphelper::OMutexAndBroadcastHelper,
+ public SectionBase,
+ public SectionPropertySet
+ {
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > m_xDrawPage;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxy;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XGroup > m_xGroup;
+ ::com::sun::star::uno::WeakReference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition;
+ ::rtl::OUString m_sName;
+ ::rtl::OUString m_sConditionalPrintExpression;
+ ::sal_uInt32 m_nHeight;
+ ::sal_Int32 m_nBackgroundColor;
+ ::sal_Int16 m_nForceNewPage;
+ ::sal_Int16 m_nNewRowOrCol;
+ ::sal_Bool m_bKeepTogether;
+ ::sal_Bool m_bCanGrow;
+ ::sal_Bool m_bCanShrink;
+ ::sal_Bool m_bRepeatSection;
+ ::sal_Bool m_bVisible;
+ ::sal_Bool m_bBacktransparent;
+ bool m_bInRemoveNotify;
+ bool m_bInInsertNotify;
+
+ private:
+ OSection(const OSection&);
+ OSection& operator=(const OSection&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( _member != _Value )
+ {
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ }
+ l.notify();
+ }
+
+ /** checks if this section is eiter the page header or footer and if so it throws an UnknownPropertyException
+ *
+ */
+ void checkNotPageHeaderFooter();
+
+ void init();
+ protected:
+ virtual ~OSection();
+
+ /** this function is called upon disposing the component
+ */
+ virtual void SAL_CALL disposing();
+ public:
+ typedef ::comphelper::ImplementationReference< OSection ,::com::sun::star::report::XSection,::com::sun::star::uno::XWeak > TSection;
+
+ OSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xParent
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context,bool _bPageSection=false);
+ OSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xParent
+ ,const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context,bool _bPageSection=false);
+
+ DECLARE_XINTERFACE( )
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XSection
+ virtual ::sal_Bool SAL_CALL getVisible() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setVisible( ::sal_Bool _visible ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& _name ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_uInt32 SAL_CALL getHeight() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHeight( ::sal_uInt32 _height ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getBackColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setBackColor( ::sal_Int32 _backgroundcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getBackTransparent() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setBackTransparent( ::sal_Bool _backtransparent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getConditionalPrintExpression() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setConditionalPrintExpression( const ::rtl::OUString& _conditionalprintexpression ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getForceNewPage() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setForceNewPage( ::sal_Int16 _forcenewpage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL getNewRowOrCol() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setNewRowOrCol( ::sal_Int16 _newroworcol ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getKeepTogether() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setKeepTogether( ::sal_Bool _keeptogether ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getCanGrow() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCanGrow( ::sal_Bool _cangrow ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getCanShrink() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCanShrink( ::sal_Bool _canshrink ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getRepeatSection() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRepeatSection( ::sal_Bool _repeatsection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > SAL_CALL getGroup() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > SAL_CALL getReportDefinition() throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > SAL_CALL createReportComponent( const ::rtl::OUString& _sReportComponentSpecifier ) throw (::com::sun::star::uno::Exception, ::com::sun::star::lang::IllegalArgumentException,::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableReportComponentNames( ) throw (::com::sun::star::uno::RuntimeException);
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+ // XShapes
+ virtual void SAL_CALL add( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL remove( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape ) throw (::com::sun::star::uno::RuntimeException);
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static OSection* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+
+ static void lcl_copySection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSource
+ ,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xDest);
+
+ void notifyElementAdded(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
+ void notifyElementRemoved(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape);
+ };
+}
+#endif //REPORTDESIGN_API_SECTION_HXX
diff --git a/reportdesign/source/core/inc/Shape.hxx b/reportdesign/source/core/inc/Shape.hxx
new file mode 100644
index 000000000000..44a94fef23bf
--- /dev/null
+++ b/reportdesign/source/core/inc/Shape.hxx
@@ -0,0 +1,196 @@
+#ifndef RPT_SHAPE_HXX
+#define RPT_SHAPE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Shape.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
+#include <cppuhelper/propertysetmixin.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#include "ReportControlModel.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include <cppuhelper/compbase2.hxx>
+#endif
+#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
+#include <comphelper/broadcasthelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#include "ReportHelperDefines.hxx"
+#include <comphelper/propagg.hxx>
+#include <memory>
+
+namespace reportdesign
+{
+ typedef ::cppu::PropertySetMixin< com::sun::star::report::XShape > ShapePropertySet;
+ typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XShape
+ ,com::sun::star::lang::XServiceInfo > ShapeBase;
+
+ /** \class OShape Defines the implementation of a \interface com:::sun::star::report::XShape
+ * \ingroup reportdesign_api
+ *
+ */
+ class OShape : public comphelper::OBaseMutex,
+ public ShapeBase,
+ public ShapePropertySet
+ {
+ friend class OShapeHelper;
+ ::std::auto_ptr< ::comphelper::OPropertyArrayAggregationHelper> m_pAggHelper;
+ OReportControlModel m_aProps;
+ com::sun::star::drawing::HomogenMatrix3 m_Transformation;
+ ::sal_Int32 m_nZOrder;
+
+ ::rtl::OUString m_CustomShapeEngine;
+ ::rtl::OUString m_CustomShapeData;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
+ m_CustomShapeGeometry;
+
+ private:
+ OShape(const OShape&);
+ OShape& operator=(const OShape&);
+
+ template <typename T> void set( const ::rtl::OUString& _sProperty
+ ,const T& _Value
+ ,T& _member)
+ {
+ BoundListeners l;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
+ _member = _Value;
+ }
+ l.notify();
+ }
+ void checkIndex(sal_Int32 _nIndex);
+ cppu::IPropertyArrayHelper& getInfoHelper();
+ protected:
+ virtual ~OShape();
+ public:
+ explicit OShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
+ explicit OShape(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
+ ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
+
+ DECLARE_XINTERFACE( )
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ // com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XReportComponent
+ REPORTCOMPONENT_HEADER()
+
+ // XShape
+ SHAPE_HEADER()
+
+ virtual ::rtl::OUString SAL_CALL getCustomShapeEngine() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCustomShapeEngine( const ::rtl::OUString& _customshapeengine ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getCustomShapeData() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCustomShapeData( const ::rtl::OUString& _customshapedata ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCustomShapeGeometry() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCustomShapeGeometry( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _customshapegeometry ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XShapeDescriptor
+ virtual ::rtl::OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XReportControlModel
+ REPORTCONTROLMODEL_HEADER()
+
+ // XReportControlFormat
+ REPORTCONTROLFORMAT_HEADER()
+ // XShape
+ virtual ::sal_Int32 SAL_CALL getZOrder() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setZOrder( ::sal_Int32 _zorder ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::drawing::HomogenMatrix3 SAL_CALL getTransformation() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTransformation( const ::com::sun::star::drawing::HomogenMatrix3& _transformation ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::addEventListener(aListener);
+ }
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
+ {
+ cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
+ }
+
+ // XChild
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+ // XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) 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);
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // XIndexAccess
+ virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif //RPT_SHAPE_HXX
+
diff --git a/reportdesign/source/core/inc/Tools.hxx b/reportdesign/source/core/inc/Tools.hxx
new file mode 100644
index 000000000000..95961d034b4a
--- /dev/null
+++ b/reportdesign/source/core/inc/Tools.hxx
@@ -0,0 +1,161 @@
+#ifndef REPORTDESIGN_TOOLS_HXX
+#define REPORTDESIGN_TOOLS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Tools.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#include "Section.hxx"
+#include "corestrings.hrc"
+
+namespace reportdesign
+{
+ template <class T> void lcl_createSectionIfNeeded(sal_Bool _bOn,const T& _xParent,::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection/*in/out*/,bool _bPageSection = false)
+ {
+ if ( _bOn && !_xSection.is() )
+ _xSection = new OSection(_xParent,_xParent->getContext(),_bPageSection);
+ else if ( !_bOn )
+ //_xSection.clear();
+ ::comphelper::disposeComponent(_xSection);
+ }
+
+ /** gets the properties which should be removed form the property set implementation.
+ *
+ * \return A sequence of all properties which should be removed for none char able implementations.
+ */
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > lcl_getCharOptionals();
+
+ /** uses the XChild interface to get the section from any child of it.
+ *
+ * \param _xReportComponent A report component which is a child of the section.
+ * \return The sectin where this report component resists in.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> lcl_getSection(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
+
+ /** throws an illegal argument exception. The message text is the resource RID_STR_ERROR_WRONG_ARGUMENT + the type as reference.
+ *
+ * \param _sTypeName The reference where to look for the correct values.
+ * \param ExceptionContext_ The exception context.
+ * \param ArgumentPosition_ The argument position.
+ * \param Context_ The context to get the factory service.
+ */
+ void throwIllegallArgumentException(const ::rtl::OUString& _sTypeName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& ExceptionContext_
+ ,const ::sal_Int16& ArgumentPosition_
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& Context_);
+
+ /** clones the given object
+ *
+ * \param _xReportComponent the object to be cloned
+ * \param _xFactory the factory to create the clone
+ * \param _sServiceName the service of the to be cloned object
+ * \return the clone
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > cloneObject(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xReportComponent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xFactory
+ ,const ::rtl::OUString& _sServiceName);
+
+ class OShapeHelper
+ {
+ public:
+ template<typename T> static void setSize(const ::com::sun::star::awt::Size& aSize,T* _pShape)
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ _pShape->m_aProps.aComponent.m_xShape->setSize(aSize);
+ _pShape->set(PROPERTY_WIDTH,aSize.Width,_pShape->m_aProps.aComponent.m_nWidth);
+ _pShape->set(PROPERTY_HEIGHT,aSize.Height,_pShape->m_aProps.aComponent.m_nHeight);
+ }
+ template<typename T> static ::com::sun::star::awt::Size getSize( T* _pShape )
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ return _pShape->m_aProps.aComponent.m_xShape->getSize();
+ return ::com::sun::star::awt::Size(_pShape->m_aProps.aComponent.m_nWidth,_pShape->m_aProps.aComponent.m_nHeight);
+ }
+
+ template<typename T> static void setPosition( const ::com::sun::star::awt::Point& aPosition ,T* _pShape)
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ _pShape->m_aProps.aComponent.m_xShape->setPosition(aPosition);
+ _pShape->set(PROPERTY_POSITIONX,aPosition.X,_pShape->m_aProps.aComponent.m_nPosX);
+ _pShape->set(PROPERTY_POSITIONY,aPosition.Y,_pShape->m_aProps.aComponent.m_nPosY);
+ }
+ template<typename T> static ::com::sun::star::awt::Point getPosition(T* _pShape)
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ return _pShape->m_aProps.aComponent.m_xShape->getPosition();
+ return ::com::sun::star::awt::Point(_pShape->m_aProps.aComponent.m_nPosX,_pShape->m_aProps.aComponent.m_nPosY);
+ }
+ template<typename T> static void setParent( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface >& Parent, T* _pShape)
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ _pShape->m_aProps.aComponent.m_xParent = ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild >(Parent,::com::sun::star::uno::UNO_QUERY);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild > xChild;
+ comphelper::query_aggregation(_pShape->m_aProps.aComponent.m_xProxy,xChild);
+ if ( xChild.is() )
+ xChild->setParent(Parent);
+ }
+ template<typename T> static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > getParent( T* _pShape )
+ {
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild > xChild;
+ comphelper::query_aggregation(_pShape->m_aProps.aComponent.m_xProxy,xChild);
+ if ( xChild.is() )
+ return xChild->getParent();
+ return _pShape->m_aProps.aComponent.m_xParent;
+ }
+ };
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+#endif // REPORTDESIGN_TOOLS_HXX
+
diff --git a/reportdesign/source/core/inc/core_resource.hrc b/reportdesign/source/core/inc/core_resource.hrc
new file mode 100644
index 000000000000..0e149ad7bf52
--- /dev/null
+++ b/reportdesign/source/core/inc/core_resource.hrc
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: core_resource.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#define REPORTDESIGN_CORE_RESOURCE_HRC_
+
+#ifndef _SOLAR_HRC
+#include <svtools/solar.hrc>
+#endif
+
+//------------------------------------------------------------------------------
+#define RID_CORE_STRINGS_START RID_RPT_START
+
+//------------------------------------------------------------------------------
+//- String-IDs
+#define RID_STR_DETAIL ( RID_CORE_STRINGS_START + 0 )
+#define RID_STR_PAGE_HEADER ( RID_CORE_STRINGS_START + 1 )
+#define RID_STR_PAGE_FOOTER ( RID_CORE_STRINGS_START + 2 )
+#define RID_STR_REPORT_HEADER ( RID_CORE_STRINGS_START + 3 )
+#define RID_STR_REPORT_FOOTER ( RID_CORE_STRINGS_START + 4 )
+#define RID_STR_PROPERTY_CHANGE_NOT_ALLOWED ( RID_CORE_STRINGS_START + 5 )
+#define RID_STR_ERROR_WRONG_ARGUMENT ( RID_CORE_STRINGS_START + 6 )
+#define RID_STR_ARGUMENT_IS_NULL ( RID_CORE_STRINGS_START + 7 )
+#define RID_STR_SHAPE ( RID_CORE_STRINGS_START + 8 )
+#define RID_STR_REPORT ( RID_CORE_STRINGS_START + 9 )
+#define RID_STR_IMAGECONTROL ( RID_CORE_STRINGS_START + 10 )
+#define RID_STR_FIXEDTEXT ( RID_CORE_STRINGS_START + 11 )
+#define RID_STR_FORMATTEDFIELD ( RID_CORE_STRINGS_START + 12 )
+#define RID_STR_GROUP_HEADER ( RID_CORE_STRINGS_START + 13 )
+#define RID_STR_GROUP_FOOTER ( RID_CORE_STRINGS_START + 14 )
+#define RID_STR_FIXEDLINE ( RID_CORE_STRINGS_START + 15 )
+
+
+#endif // REPORTDESIGN_CORE_RESOURCE_HRC_
+
diff --git a/reportdesign/source/core/inc/core_resource.hxx b/reportdesign/source/core/inc/core_resource.hxx
new file mode 100644
index 000000000000..f34fd457fa79
--- /dev/null
+++ b/reportdesign/source/core/inc/core_resource.hxx
@@ -0,0 +1,90 @@
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#define REPORTDESIGN_CORE_RESOURCE_HXX_
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: core_resource.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:15 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTICOMPONENTFACTORY_HPP_
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#endif
+
+class SimpleResMgr;
+//.........................................................................
+namespace reportdesign
+{
+
+#define RPT_RESSTRING(id,_rM) ResourceManager::loadString(id,_rM)
+
+ //==================================================================
+ //= ResourceManager
+ //= handling ressources within the DBA-Core library
+ //==================================================================
+ class ResourceManager
+ {
+ static SimpleResMgr* m_pImpl;
+
+ private:
+ // no instantiation allowed
+ ResourceManager() { }
+ ~ResourceManager() { }
+
+ // we'll instantiate one static member of the following class, which, in it's dtor,
+ // ensures that m_pImpl will be deleted
+ class EnsureDelete
+ {
+ public:
+ EnsureDelete() { }
+ ~EnsureDelete();
+ };
+ friend class EnsureDelete;
+
+ protected:
+ static void ensureImplExists(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >& _rM);
+
+ public:
+ /** loads the string with the specified resource id from the FormLayer resource file
+ */
+ static ::rtl::OUString loadString(sal_uInt16 _nResId,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory >& _rM);
+ };
+
+//.........................................................................
+}
+//.........................................................................
+
+#endif // REPORTDESIGN_CORE_RESOURCE_HXX_
+
diff --git a/reportdesign/source/core/resource/core_resource.cxx b/reportdesign/source/core/resource/core_resource.cxx
new file mode 100644
index 000000000000..7695d7fc52df
--- /dev/null
+++ b/reportdesign/source/core/resource/core_resource.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: core_resource.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "core_resource.hxx"
+
+#ifndef _TOOLS_SIMPLERESMGR_HXX_
+#include <tools/simplerm.hxx>
+#endif
+
+// ---- needed as long as we have no contexts for components ---
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+//---------------------------------------------------
+#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
+#include <comphelper/configurationhelper.hxx>
+#endif
+#ifndef _OSL_THREAD_H_
+#include <osl/thread.h>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XMACROEXPANDER_HPP_
+#include <com/sun/star/util/XMacroExpander.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _RTL_URI_HXX_
+#include <rtl/uri.hxx>
+#endif
+
+#ifndef _SOLAR_HRC
+#include <svtools/solar.hrc>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+//.........................................................................
+namespace reportdesign
+{
+ using namespace ::com::sun::star;
+ //==================================================================
+ //= ResourceManager
+ //==================================================================
+ SimpleResMgr* ResourceManager::m_pImpl = NULL;
+
+ //------------------------------------------------------------------
+ ResourceManager::EnsureDelete::~EnsureDelete()
+ {
+ delete ResourceManager::m_pImpl;
+ }
+
+ //------------------------------------------------------------------
+ void ResourceManager::ensureImplExists(const uno::Reference< lang::XMultiComponentFactory >& /* _rM */)
+ {
+ if (!m_pImpl)
+ {
+ // now that we have an impl class make sure it's deleted on unloading the library
+ static ResourceManager::EnsureDelete s_aDeleteTheImplClass;
+
+ ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
+
+ rtl::OString sResLibName = rtl::OString( "rpt" );
+ sResLibName += ::rtl::OString::valueOf(static_cast<sal_Int32>(SOLARUPD)); // current build number
+ m_pImpl = SimpleResMgr::Create(sResLibName, aLocale);
+ }
+ }
+
+ //------------------------------------------------------------------
+ ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId,const uno::Reference< lang::XMultiComponentFactory >& _rM)
+ {
+ ::rtl::OUString sReturn;
+
+ ensureImplExists(_rM);
+ if (m_pImpl)
+ sReturn = m_pImpl->ReadString(_nResId);
+
+ return sReturn;
+ }
+
+//.........................................................................
+}
+//.........................................................................
+
diff --git a/reportdesign/source/core/resource/makefile.mk b/reportdesign/source/core/resource/makefile.mk
new file mode 100644
index 000000000000..2c4d958bdef3
--- /dev/null
+++ b/reportdesign/source/core/resource/makefile.mk
@@ -0,0 +1,56 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=core_resource
+ENABLE_EXCEPTIONS=TRUE
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- Files --------------------------------------------------------
+
+SRS1NAME=core_strings
+SRC1FILES= \
+ strings.src \
+
+SLOFILES= $(SLO)$/core_resource.obj \
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/reportdesign/source/core/resource/strings.src b/reportdesign/source/core/resource/strings.src
new file mode 100644
index 000000000000..40dbe118aabc
--- /dev/null
+++ b/reportdesign/source/core/resource/strings.src
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: strings.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "core_resource.hrc"
+
+String RID_STR_DETAIL
+{
+ Text [ de ] = "Detail";
+ Text [ en-US ] = "Detail";
+};
+String RID_STR_PAGE_HEADER
+{
+ Text [ de ] = "Seitenkopf";
+ Text [ en-US ] = "Page Header";
+};
+String RID_STR_PAGE_FOOTER
+{
+ Text [ de ] = "Seitenfuß";
+ Text [ en-US ] = "Page Footer";
+};
+String RID_STR_GROUP_HEADER
+{
+ Text [ de ] = "Gruppenkopf";
+ Text [ en-US ] = "Group Header";
+};
+String RID_STR_GROUP_FOOTER
+{
+ Text [ de ] = "Gruppenfuß";
+ Text [ en-US ] = "Group Footer";
+};
+String RID_STR_REPORT_HEADER
+{
+ Text [ de ] = "Berichtskopf";
+ Text [ en-US ] = "Report Header";
+};
+String RID_STR_REPORT_FOOTER
+{
+ Text [ de ] = "Berichtsfuß";
+ Text [ en-US ] = "Report Footer";
+};
+
+String RID_STR_PROPERTY_CHANGE_NOT_ALLOWED
+{
+ Text [ de ] = "Der Name '#1' ist bereits vergeben und kann nicht erneut vergeben werden.";
+ Text [ en-US ] = "The name '#1' already exists and can not be asssigned again.";
+};
+
+String RID_STR_ERROR_WRONG_ARGUMENT
+{
+ Text [ de ] = "Sie haben versucht ein ungültiges Argument zu setzen. Gültige Argumente entnehmen Sie bitte '#1'.";
+ Text [ en-US ] = "You tried to set an illegal argument. Please have a look at '#1' for valid arguments.";
+};
+String RID_STR_ARGUMENT_IS_NULL
+{
+ Text [ de ] = "Das Element ist ungültig.";
+ Text [ en-US ] = "The element is invalid.";
+};
+String RID_STR_FIXEDTEXT
+{
+ Text [ de ] = "LabelField";
+ Text [ en-US ] = "LabelField";
+};
+String RID_STR_FORMATTEDFIELD
+{
+ Text [ de ] = "FormattedField";
+ Text [ en-US ] = "FormattedField";
+};
+String RID_STR_IMAGECONTROL
+{
+ Text [ de ] = "ImageControl";
+ Text [ en-US ] = "ImageControl";
+};
+String RID_STR_REPORT
+{
+ Text [ de ] = "Report";
+ Text [ en-US ] = "Report";
+};
+String RID_STR_SHAPE
+{
+ Text [ de ] = "Shape";
+ Text [ en-US ] = "Shape";
+};
+String RID_STR_FIXEDLINE
+{
+ Text [ de ] = "FixedLine";
+ Text [ en-US ] = "FixedLine";
+};
diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx
new file mode 100644
index 000000000000..030bb0427c60
--- /dev/null
+++ b/reportdesign/source/core/sdr/ModuleHelper.cxx
@@ -0,0 +1,168 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ModuleHelper.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
+#include <comphelper/configurationhelper.hxx>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _OSL_THREAD_H_
+#include <osl/thread.h>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XMACROEXPANDER_HPP_
+#include <com/sun/star/util/XMacroExpander.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _RTL_URI_HXX_
+#include <rtl/uri.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _SOLAR_HRC
+#include <svtools/solar.hrc>
+#endif
+
+#define EXPAND_PROTOCOL "vnd.sun.star.expand:"
+#define ENTER_MOD_METHOD() \
+ ::osl::MutexGuard aGuard(s_aMutex); \
+ ensureImpl()
+
+//.........................................................................
+namespace rptui
+{
+//.........................................................................
+ using namespace ::com::sun::star;
+//=========================================================================
+//= OModuleImpl
+//=========================================================================
+/** implementation for <type>OModule</type>. not threadsafe, has to be guarded by it's owner
+*/
+class OModuleImpl
+{
+ ResMgr* m_pRessources;
+
+public:
+ /// ctor
+ OModuleImpl();
+ ~OModuleImpl();
+
+ /// get the manager for the ressources of the module
+ ResMgr* getResManager();
+};
+
+DBG_NAME( rpt_OModuleImpl )
+//-------------------------------------------------------------------------
+OModuleImpl::OModuleImpl()
+ :m_pRessources(NULL)
+{
+ DBG_CTOR( rpt_OModuleImpl,NULL);
+
+}
+
+//-------------------------------------------------------------------------
+OModuleImpl::~OModuleImpl()
+{
+ if (m_pRessources)
+ delete m_pRessources;
+
+ DBG_DTOR( rpt_OModuleImpl,NULL);
+}
+
+//-------------------------------------------------------------------------
+ResMgr* OModuleImpl::getResManager()
+{
+ // note that this method is not threadsafe, which counts for the whole class !
+
+ if (!m_pRessources)
+ {
+ // create a manager with a fixed prefix
+ rtl::OString sName = rtl::OString( "rptui" );
+ sName += ::rtl::OString::valueOf(static_cast<sal_Int32>(SOLARUPD)); // current build number
+ m_pRessources = ResMgr::CreateResMgr(sName);
+ }
+ return m_pRessources;
+}
+
+//=========================================================================
+//= OModule
+//=========================================================================
+::osl::Mutex OModule::s_aMutex;
+sal_Int32 OModule::s_nClients = 0;
+OModuleImpl* OModule::s_pImpl = NULL;
+//-------------------------------------------------------------------------
+ResMgr* OModule::getResManager()
+{
+ ENTER_MOD_METHOD();
+ return s_pImpl->getResManager();
+}
+
+//-------------------------------------------------------------------------
+void OModule::registerClient()
+{
+ ::osl::MutexGuard aGuard(s_aMutex);
+ ++s_nClients;
+}
+
+//-------------------------------------------------------------------------
+void OModule::revokeClient()
+{
+ ::osl::MutexGuard aGuard(s_aMutex);
+ if (!--s_nClients && s_pImpl)
+ {
+ delete s_pImpl;
+ s_pImpl = NULL;
+ }
+}
+
+//-------------------------------------------------------------------------
+void OModule::ensureImpl()
+{
+ if (s_pImpl)
+ return;
+ s_pImpl = new OModuleImpl();
+}
+
+//.........................................................................
+} // namespace dbaui
+//.........................................................................
diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx
new file mode 100644
index 000000000000..f5756681f38c
--- /dev/null
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PropertyForward.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_PROPERTYSETFORWARD_HXX
+#include "PropertyForward.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SDBCX_XAPPEND_HPP_
+#include <com/sun/star/sdbcx/XAppend.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#include "corestrings.hrc"
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+ using namespace reportdesign;
+
+DBG_NAME( rpt_OPropertyMediator )
+OPropertyMediator::OPropertyMediator(const Reference< XPropertySet>& _xSource
+ ,const Reference< XPropertySet>& _xDest
+ ,const TPropertyNamePair& _aNameMap
+ ,sal_Bool _bReverse)
+ : OPropertyForward_Base(m_aMutex)
+ ,m_aNameMap(_aNameMap)
+ ,m_xSource(_xSource)
+ ,m_xDest(_xDest)
+ ,m_bInChange(sal_False)
+{
+ DBG_CTOR( rpt_OPropertyMediator,NULL);
+ osl_incrementInterlockedCount(&m_refCount);
+ OSL_ENSURE(m_xDest.is(),"Dest is NULL!");
+ OSL_ENSURE(m_xSource.is(),"Source is NULL!");
+ if ( m_xDest.is() && m_xSource.is() )
+ {
+ try
+ {
+ m_xDestInfo = m_xDest->getPropertySetInfo();
+ m_xSourceInfo = m_xSource->getPropertySetInfo();
+ if ( _bReverse )
+ {
+ ::comphelper::copyProperties(m_xDest,m_xSource);
+ TPropertyNamePair::iterator aIter = m_aNameMap.begin();
+ TPropertyNamePair::iterator aEnd = m_aNameMap.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ Any aValue = _xDest->getPropertyValue(aIter->second);
+ Property aProp = m_xSourceInfo->getPropertyByName(aIter->first);
+ if (0 == (aProp.Attributes & PropertyAttribute::READONLY))
+ {
+ if ( 0 != (aProp.Attributes & PropertyAttribute::MAYBEVOID) || aValue.hasValue() )
+ _xSource->setPropertyValue(aIter->first,aValue);
+ }
+ }
+ }
+ else
+ {
+ ::comphelper::copyProperties(m_xSource,m_xDest);
+ TPropertyNamePair::iterator aIter = m_aNameMap.begin();
+ TPropertyNamePair::iterator aEnd = m_aNameMap.end();
+ for (; aIter != aEnd; ++aIter)
+ _xDest->setPropertyValue(aIter->second,_xSource->getPropertyValue(aIter->first));
+ }
+ startListening();
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(sal_False, "OPropertyMediator::OPropertyMediator: caught an exception!");
+ }
+ } // if ( m_xDest.is() && m_xSource.is() )
+ osl_decrementInterlockedCount(&m_refCount);
+}
+// -----------------------------------------------------------------------------
+OPropertyMediator::~OPropertyMediator()
+{
+ DBG_DTOR( rpt_OPropertyMediator,NULL);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt ) throw(RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !m_bInChange )
+ {
+ m_bInChange = sal_True;
+ try
+ {
+ sal_Bool bDest = (evt.Source == m_xDest);
+ Reference<XPropertySet> xProp = bDest ? m_xSource : m_xDest;
+ Reference<XPropertySetInfo> xPropInfo = bDest ? m_xSourceInfo : m_xDestInfo;
+ if ( xProp.is() )
+ {
+ if ( xPropInfo.is() )
+ {
+ if ( xPropInfo->hasPropertyByName(evt.PropertyName) )
+ xProp->setPropertyValue(evt.PropertyName,evt.NewValue);
+ else
+ {
+ TPropertyNamePair::iterator aFind = m_aNameMap.find(evt.PropertyName);
+ ::rtl::OUString sPropName;
+ if ( aFind != m_aNameMap.end() )
+ sPropName = aFind->second;
+ else
+ {
+ aFind = ::std::find_if(
+ m_aNameMap.begin(),
+ m_aNameMap.end(),
+ ::std::compose1(
+ ::std::bind2nd(::std::equal_to< ::rtl::OUString >(), evt.PropertyName),
+ ::std::select2nd<TPropertyNamePair::value_type>()
+ )
+ );
+ if ( aFind != m_aNameMap.end() )
+ sPropName = aFind->first;
+ }
+ if ( sPropName.getLength() && xPropInfo->hasPropertyByName(sPropName) )
+ xProp->setPropertyValue(sPropName,evt.NewValue);
+ else if ( evt.PropertyName == PROPERTY_CHARFONTNAME
+ || evt.PropertyName == PROPERTY_CHARFONTSTYLENAME
+ || evt.PropertyName == PROPERTY_CHARSTRIKEOUT
+ || evt.PropertyName == PROPERTY_CHARWORDMODE
+ || evt.PropertyName == PROPERTY_CHARROTATION
+ || evt.PropertyName == PROPERTY_CHARSCALEWIDTH
+ || evt.PropertyName == PROPERTY_CHARFONTFAMILY
+ || evt.PropertyName == PROPERTY_CHARFONTCHARSET
+ || evt.PropertyName == PROPERTY_CHARFONTPITCH
+ || evt.PropertyName == PROPERTY_CHARHEIGHT
+ || evt.PropertyName == PROPERTY_CHARUNDERLINE
+ || evt.PropertyName == PROPERTY_CHARWEIGHT
+ || evt.PropertyName == PROPERTY_CHARPOSTURE)
+ {
+ xProp->setPropertyValue(PROPERTY_FONTDESCRIPTOR,m_xSource->getPropertyValue(PROPERTY_FONTDESCRIPTOR));
+ }
+ }
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched!");
+ }
+ m_bInChange = sal_False;
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OPropertyMediator::disposing( const ::com::sun::star::lang::EventObject& /*_rSource*/ ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ disposing();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OPropertyMediator::disposing()
+{
+ stopListening();
+ m_xSource.clear();
+ m_xSourceInfo.clear();
+ m_xDest.clear();
+ m_xDestInfo.clear();
+}
+// -----------------------------------------------------------------------------
+void OPropertyMediator::stopListening()
+{
+ if ( m_xSource.is() )
+ m_xSource->removePropertyChangeListener(::rtl::OUString(), this);
+ if ( m_xDest.is() )
+ m_xDest->removePropertyChangeListener(::rtl::OUString(), this);
+}
+// -----------------------------------------------------------------------------
+void OPropertyMediator::startListening()
+{
+ if ( m_xSource.is() )
+ m_xSource->addPropertyChangeListener(::rtl::OUString(), this);
+ if ( m_xDest.is() )
+ m_xDest->addPropertyChangeListener(::rtl::OUString(), this);
+}
+// -----------------------------------------------------------------------------
+//........................................................................
+} // namespace dbaccess
+//........................................................................
+
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
new file mode 100644
index 000000000000..fed466d4128a
--- /dev/null
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportDrawPage.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "ReportDrawPage.hxx"
+#include "RptObject.hxx"
+#include "RptDef.hxx"
+#include "corestrings.hrc"
+
+#include <com/sun/star/report/XFixedLine.hpp>
+
+#include <tools/diagnose_ex.h>
+#include <svx/unoshape.hxx>
+
+namespace reportdesign
+{
+ using namespace ::com::sun::star;
+ using namespace rptui;
+
+OReportDrawPage::OReportDrawPage(SdrPage* _pPage
+ ,const uno::Reference< report::XSection >& _xSection)
+: SvxDrawPage(_pPage)
+,m_xSection(_xSection)
+{
+}
+
+SdrObject* OReportDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xDescr ) throw ()
+{
+ uno::Reference< report::XReportComponent> xReportComponent(xDescr,uno::UNO_QUERY);
+ if ( xReportComponent.is() )
+ return OObjectBase::createObject(xReportComponent);
+ return SvxDrawPage::_CreateSdrObject( xDescr );
+}
+
+uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pObj ) const throw ()
+{
+ OObjectBase* pBaseObj = dynamic_cast<OObjectBase*>(pObj);
+ if ( !pBaseObj )
+ return SvxDrawPage::_CreateShape( pObj );
+
+ uno::Reference< report::XSection> xSection = m_xSection;
+ uno::Reference< lang::XMultiServiceFactory> xFactory;
+ if ( xSection.is() )
+ xFactory.set(xSection->getReportDefinition(),uno::UNO_QUERY);
+ uno::Reference< drawing::XShape > xRet;
+ if ( xFactory.is() )
+ {
+ bool bChangeOrientation = false;
+ ::rtl::OUString sServiceName;
+ if ( pObj->ISA(OCustomShape) )
+ {
+ sServiceName = SERVICE_SHAPE;
+ }
+ else if ( pObj->ISA(OUnoObject) )
+ {
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObj);
+ switch(pUnoObj->getObjectId())
+ {
+ case OBJ_DLG_FORMATTEDFIELD:
+ sServiceName = SERVICE_FORMATTEDFIELD;
+ break;
+ case OBJ_DLG_HFIXEDLINE:
+ sServiceName = SERVICE_FIXEDLINE;
+ bChangeOrientation = true;
+ break;
+ case OBJ_DLG_VFIXEDLINE:
+ sServiceName = SERVICE_FIXEDLINE;
+ break;
+ case OBJ_DLG_FIXEDTEXT:
+ sServiceName = SERVICE_FIXEDTEXT;
+ break;
+ case OBJ_DLG_IMAGECONTROL:
+ sServiceName = SERVICE_IMAGECONTROL;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal case value");
+ break;
+ }
+ }
+
+ uno::Reference< drawing::XShape > xShape( SvxDrawPage::_CreateShape( pObj ) );
+
+ try
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] <<= xShape; xShape.clear(); // keep exactly *one* reference!
+ xRet.set( xFactory->createInstanceWithArguments( sServiceName, aArgs ), uno::UNO_QUERY_THROW );
+
+ if ( bChangeOrientation )
+ {
+ uno::Reference< report::XFixedLine > xFixedLine( xRet, uno::UNO_QUERY_THROW );
+ xFixedLine->setOrientation(0);
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ return xRet;
+}
+
+}
diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
new file mode 100644
index 000000000000..db7d7ee0a7b0
--- /dev/null
+++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportUndoFactory.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "ReportUndoFactory.hxx"
+#include "RptObject.hxx"
+#include "UndoActions.hxx"
+#include "RptResId.hrc"
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+// -----------------------------------------------------------------------------
+SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,USHORT _nCommentId)
+{
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject);
+ if ( !pObj )
+ return NULL;
+ uno::Reference< report::XReportComponent> xReportComponent = pObj->getReportComponent();
+ uno::Reference< report::XSection> xSection = pObj->getSection();
+ uno::Reference< report::XGroup> xGroup = xSection->getGroup();
+ SdrUndoAction* pUndo = NULL;
+ if ( xGroup.is() )
+ pUndo = new OUndoGroupSectionAction(*rObject.GetModel(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,_nCommentId);
+ else
+ pUndo = new OUndoReportSectionAction(*rObject.GetModel(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,_nCommentId);
+ return pUndo;
+}
+// -----------------------------------------------------------------------------
+DBG_NAME( rpt_OReportUndoFactory )
+// -----------------------------------------------------------------------------
+OReportUndoFactory::OReportUndoFactory() : m_pUndoFactory(new SdrUndoFactory)
+{
+ DBG_CTOR( rpt_OReportUndoFactory,NULL);
+}
+// -----------------------------------------------------------------------------
+OReportUndoFactory::~OReportUndoFactory()
+{
+ DBG_DTOR( rpt_OReportUndoFactory,NULL);
+}
+///////////////////////////////////////////////////////////////////////
+// shapes
+SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
+{
+ return m_pUndoFactory->CreateUndoMoveObject( rObject );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
+{
+ return m_pUndoFactory->CreateUndoMoveObject( rObject, rDist );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
+{
+ return m_pUndoFactory->CreateUndoGeoObject( rObject );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
+{
+ return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? TRUE : FALSE, bSaveText ? TRUE : FALSE );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
+{
+ return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? TRUE : FALSE );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+{
+ return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+{
+ return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL);
+ //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? TRUE : FALSE );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
+{
+ return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
+{
+ return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? TRUE : FALSE );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
+{
+ return m_pUndoFactory->CreateUndoObjectOrdNum( rObject, nOldOrdNum1, nNewOrdNum1 );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
+{
+ return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? TRUE : FALSE );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
+{
+ return m_pUndoFactory->CreateUndoObjectLayerChange( rObject, aOldLayer, aNewLayer );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj )
+{
+ return m_pUndoFactory->CreateUndoObjectSetText( rNewObj );
+}
+
+// layer
+SdrUndoAction* OReportUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
+{
+ return m_pUndoFactory->CreateUndoNewLayer( nLayerNum, rNewLayerAdmin, rNewModel );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
+{
+ return m_pUndoFactory->CreateUndoDeleteLayer( nLayerNum, rNewLayerAdmin, rNewModel );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
+{
+ return m_pUndoFactory->CreateUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 );
+}
+
+// page
+SdrUndoAction* OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
+{
+ return m_pUndoFactory->CreateUndoDeletePage( rPage );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoNewPage(SdrPage& rPage)
+{
+ return m_pUndoFactory->CreateUndoNewPage( rPage );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoCopyPage(SdrPage& rPage)
+{
+ return m_pUndoFactory->CreateUndoCopyPage( rPage );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
+{
+ return m_pUndoFactory->CreateUndoSetPageNum( rNewPg, nOldPageNum1, nNewPageNum1 );
+}
+ // master page
+SdrUndoAction* OReportUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage)
+{
+ return m_pUndoFactory->CreateUndoPageRemoveMasterPage( rChangedPage );
+}
+
+SdrUndoAction* OReportUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage)
+{
+ return m_pUndoFactory->CreateUndoPageChangeMasterPage(rChangedPage);
+}
+
+//==================================================================
+} //rptui
+//==================================================================
+
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
new file mode 100644
index 000000000000..5f3497666a85
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptModel.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
+#include <dbaccess/singledoccontroller.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPTUI_UNDOACTIONS_HXX
+#include "UndoActions.hxx"
+#endif
+#include "UndoEnv.hxx"
+#include "ReportUndoFactory.hxx"
+#define ITEMID_COLOR 1
+#define ITEMID_BRUSH 2
+#define ITEMID_FONT 3
+#define ITEMID_FONTHEIGHT 4
+
+#include <svx/tbcontrl.hxx>
+#include "rptui_slotid.hrc"
+#include "RptDef.hxx"
+#include "corestrings.hrc"
+
+namespace rptui
+{
+
+using namespace com::sun::star;
+DBG_NAME( rpt_OReportModel )
+TYPEINIT1(OReportModel,SdrModel);
+
+//----------------------------------------------------------------------------
+
+OReportModel::OReportModel() :
+ SdrModel(NULL,NULL)
+ ,m_pController(NULL)
+{
+ DBG_CTOR( rpt_OReportModel,0);
+ SetAllowShapePropertyChangeListener(true);
+ m_pUndoEnv = new OXUndoEnvironment(*this);
+ m_pUndoEnv->acquire();
+ SetSdrUndoFactory(new OReportUndoFactory);
+
+ // SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT);
+ //SvxFontHeightToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT);
+ //SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR);
+ //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2);
+ //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND);
+ //SvxColorToolBoxControl::RegisterControl(SID_BACKGROUND_COLOR);
+}
+
+//----------------------------------------------------------------------------
+OReportModel::~OReportModel()
+{
+ DBG_DTOR( rpt_OReportModel,0);
+ detachController();
+ m_pUndoEnv->release();
+}
+// -----------------------------------------------------------------------------
+void OReportModel::detachController()
+{
+ m_pController = NULL;
+ m_pUndoEnv->EndListening( *this );
+ ClearUndoBuffer();
+ m_pUndoEnv->Clear(OXUndoEnvironment::Accessor());
+}
+//----------------------------------------------------------------------------
+SdrPage* OReportModel::AllocPage(FASTBOOL /*bMasterPage*/)
+{
+ DBG_CHKTHIS( rpt_OReportModel, 0);
+ OSL_ENSURE(0,"Who called me!");
+ return NULL;
+}
+
+//----------------------------------------------------------------------------
+
+void OReportModel::SetChanged( sal_Bool bChanged )
+{
+ SdrModel::SetChanged( bChanged );
+ SetModified( bChanged );
+}
+
+//----------------------------------------------------------------------------
+
+Window* OReportModel::GetCurDocViewWin()
+{
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+OXUndoEnvironment& OReportModel::GetUndoEnv()
+{
+ return *m_pUndoEnv;
+}
+//----------------------------------------------------------------------------
+void OReportModel::SetModified(sal_Bool _bModified)
+{
+ if ( m_pController )
+ m_pController->setModified(_bModified);
+}
+// -----------------------------------------------------------------------------
+SdrPage* OReportModel::RemovePage(USHORT nPgNum)
+{
+ OReportPage* pPage = dynamic_cast<OReportPage*>(SdrModel::RemovePage(nPgNum));
+ //if ( pPage )
+ //{
+ // m_pUndoEnv->RemoveSection(pPage);
+ //}
+ return pPage;
+}
+// -----------------------------------------------------------------------------
+OReportPage* OReportModel::createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection)
+{
+ OReportPage* pPage = new OReportPage( *this ,_xSection);
+ InsertPage(pPage);
+ m_pUndoEnv->AddSection(_xSection);
+ return pPage;
+}
+// -----------------------------------------------------------------------------
+OReportPage* OReportModel::getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection)
+{
+ OReportPage* pPage = NULL;
+ USHORT nCount = GetPageCount();
+ for (USHORT i = 0; i < nCount && !pPage ; ++i)
+ {
+ OReportPage* pRptPage = PTR_CAST( OReportPage, GetPage(i) );
+ if ( pRptPage && pRptPage->getSection() == _xSection )
+ pPage = pRptPage;
+ }
+ return pPage;
+}
+// -----------------------------------------------------------------------------
+SvxNumType OReportModel::GetPageNumType() const
+{
+ uno::Reference< report::XReportDefinition > xReportDefinition( getReportDefinition() );
+ if ( xReportDefinition.is() )
+ return (SvxNumType)getStyleProperty<sal_Int16>(xReportDefinition,reportdesign::PROPERTY_NUMBERINGTYPE);
+ return SVX_ARABIC;
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportDefinition > OReportModel::getReportDefinition() const
+{
+ if ( !m_pController )
+ return NULL;
+
+ uno::Reference< report::XReportDefinition > xReportDefinition( m_pController->getModel(), uno::UNO_QUERY );
+ OSL_ENSURE( xReportDefinition.is(), "OReportModel::getReportDefinition: invalid model at our controller!" );
+ return xReportDefinition;
+}
+
+//==================================================================
+} //rptui
+//==================================================================
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
new file mode 100644
index 000000000000..0698cbbad1ba
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -0,0 +1,921 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptObject.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#include <vector>
+#include <algorithm>
+
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include <RptDef.hxx>
+#endif
+#ifndef _SVX_UNOSHAPE_HXX
+#include <svx/unoshape.hxx>
+#endif
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#ifndef _REPORT_RPTUILIST_HXX
+#include "RptObjectListener.hxx"
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include <toolkit/helper/convert.hxx>
+#endif
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
+#include <dbaccess/singledoccontroller.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+
+#ifndef _REPORT_DLGRESID_HRC
+#include <RptResId.hrc>
+#endif
+
+#ifndef _SVX_XFLCLIT_HXX
+#include <svx/xflclit.hxx>
+#endif
+#ifndef _SVX_XLNCLIT_HXX
+#include <svx/xlnclit.hxx>
+#endif
+#ifndef _SVX_XLNDSIT_HXX
+#include <svx/xlndsit.hxx>
+#endif
+#ifndef _SVX_XLINEIT0_HXX
+#include <svx/xlineit0.hxx>
+#endif
+#ifndef _SDERITM_HXX
+#include <svx/sderitm.hxx>
+#endif
+#ifndef _SVX_XLNWTIT_HXX
+#include <svx/xlnwtit.hxx>
+#endif
+#ifndef _SVX_XLNTRIT_HXX
+#include <svx/xlntrit.hxx>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_
+#include <com/sun/star/style/XStyle.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XTABCONTROLLERMODEL_HPP_
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XUNOCONTROLCONTAINER_HPP_
+#include <com/sun/star/awt/XUnoControlContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XVCLCONTAINERPEER_HPP_
+#include <com/sun/star/awt/XVclContainerPeer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
+#include <com/sun/star/awt/XWindow.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XSCRIPTEVENTSSUPPLIER_HPP_
+#include <com/sun/star/script/XScriptEventsSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_
+#include <com/sun/star/container/XContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#include <com/sun/star/report/XFixedLine.hpp>
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef RPTUI_PROPERTYSETFORWARD_HXX
+#include "PropertyForward.hxx"
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef RPTUI_UNDOACTIONS_HXX
+#include "UndoActions.hxx"
+#endif
+#include "UndoEnv.hxx"
+#include <algorithm>
+#include <functional>
+
+namespace rptui
+{
+
+using namespace ::com::sun::star;
+using namespace uno;
+using namespace beans;
+using namespace reportdesign;
+using namespace container;
+using namespace script;
+//----------------------------------------------------------------------------
+sal_uInt16 OObjectBase::getObjectType(const uno::Reference< report::XReportComponent>& _xComponent)
+{
+ uno::Reference< lang::XServiceInfo > xServiceInfo( _xComponent , uno::UNO_QUERY );
+ OSL_ENSURE(xServiceInfo.is(),"Who deletes the XServiceInfo interface!");
+ if ( xServiceInfo.is() )
+ {
+ if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ))
+ return OBJ_DLG_FIXEDTEXT;
+ if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE ))
+ {
+ uno::Reference< report::XFixedLine> xFixedLine(_xComponent,uno::UNO_QUERY);
+ return xFixedLine->getOrientation() ? OBJ_DLG_HFIXEDLINE : OBJ_DLG_VFIXEDLINE;
+ }
+ if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL))
+ return OBJ_DLG_IMAGECONTROL;
+ if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ))
+ return OBJ_DLG_FORMATTEDFIELD;
+ if ( xServiceInfo->supportsService( SERVICE_SHAPE ))
+ return OBJ_CUSTOMSHAPE;
+ }
+ return 0;
+}
+// -----------------------------------------------------------------------------
+SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportComponent>& _xComponent)
+{
+ SdrObject* pNewObj = NULL;
+ sal_uInt16 nType = OObjectBase::getObjectType(_xComponent);
+ switch( nType )
+ {
+ case OBJ_DLG_FIXEDTEXT:
+ pNewObj = new OUnoObject( _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
+ ,OBJ_DLG_FIXEDTEXT);
+ break;
+ case OBJ_DLG_IMAGECONTROL:
+ pNewObj = new OUnoObject(_xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
+ ,OBJ_DLG_IMAGECONTROL);
+ break;
+ case OBJ_DLG_FORMATTEDFIELD:
+ pNewObj = new OUnoObject( _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
+ ,OBJ_DLG_FORMATTEDFIELD);
+ break;
+ case OBJ_DLG_HFIXEDLINE:
+ case OBJ_DLG_VFIXEDLINE:
+ pNewObj = new OUnoObject( _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
+ ,nType);
+ break;
+ case OBJ_CUSTOMSHAPE:
+ pNewObj = new OCustomShape(_xComponent);
+ break;
+ default:
+ OSL_ENSURE(0,"Unknown object id");
+ break;
+ }
+ return pNewObj;
+}
+// -----------------------------------------------------------------------------
+const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
+{
+ switch(_nObjectId)
+ {
+ case OBJ_DLG_IMAGECONTROL:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,PROPERTY_BACKGROUNDCOLOR));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,PROPERTY_BORDER));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,PROPERTY_BORDERCOLOR));
+ //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN));
+ }
+ return s_aNameMap;
+ }
+
+ case OBJ_DLG_FIXEDTEXT:
+ case OBJ_DLG_FORMATTEDFIELD:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARCOLOR,PROPERTY_TEXTCOLOR));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,PROPERTY_BACKGROUNDCOLOR));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARUNDERLINECOLOR,PROPERTY_TEXTLINECOLOR));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARRELIEF,PROPERTY_FONTRELIEF));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARFONTHEIGHT,PROPERTY_FONTHEIGHT));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARSTRIKEOUT,PROPERTY_FONTSTRIKEOUT));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLTEXTEMPHASISMARK,PROPERTY_FONTEMPHASISMARK));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,PROPERTY_BORDER));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,PROPERTY_BORDERCOLOR));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN));
+ }
+ return s_aNameMap;
+ }
+
+ case OBJ_CUSTOMSHAPE:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ s_aNameMap.insert(TPropertyNamePair::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")),PROPERTY_CONTROLBACKGROUND));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN));
+ }
+ return s_aNameMap;
+ }
+
+ default:
+ break;
+ }
+ static TPropertyNamePair s_aEmptyNameMap;
+ return s_aEmptyNameMap;
+}
+// -----------------------------------------------------------------------------
+
+DBG_NAME( rpt_OObjectBase )
+OObjectBase::OObjectBase(const uno::Reference< report::XReportComponent>& _xComponent)
+:m_bIsListening(sal_False)
+{
+ DBG_CTOR( rpt_OObjectBase,NULL);
+ m_xReportComponent = _xComponent;
+}
+//----------------------------------------------------------------------------
+OObjectBase::OObjectBase(const ::rtl::OUString& _sComponentName)
+:m_sComponentName(_sComponentName)
+,m_bIsListening(sal_False)
+{
+ DBG_CTOR( rpt_OObjectBase,NULL);
+}
+//----------------------------------------------------------------------------
+OObjectBase::~OObjectBase()
+{
+ DBG_DTOR( rpt_OObjectBase,NULL);
+ m_xMediator.reset();
+ if ( isListening() )
+ EndListening();
+ m_xReportComponent.clear();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection> OObjectBase::getSection() const
+{
+ uno::Reference< report::XSection> xSection;
+ OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
+ if ( pPage )
+ xSection = pPage->getSection();
+ return xSection;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportComponent> OObjectBase::getReportComponent() const
+{
+ return m_xReportComponent;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySet> OObjectBase::getAwtComponent()
+{
+ return uno::Reference< beans::XPropertySet>();
+}
+// -----------------------------------------------------------------------------
+sal_Bool OObjectBase::IsInside(const Rectangle& _rRect,const Point& rPnt,USHORT nTol) const
+{
+ sal_Bool bRet = sal_False;
+ Rectangle aRect( _rRect );
+ if ( !aRect.IsEmpty() )
+ {
+ aRect.Left() -= nTol;
+ aRect.Top() -= nTol;
+ aRect.Right() = ( aRect.Right() == RECT_EMPTY ? _rRect.Left() + nTol : aRect.Right() + nTol );
+ aRect.Bottom() = ( aRect.Bottom() == RECT_EMPTY ? _rRect.Top() + nTol : aRect.Bottom() + nTol );
+
+ bRet = aRect.IsInside( rPnt );
+ }
+ return bRet;
+}
+//----------------------------------------------------------------------------
+void OObjectBase::StartListening()
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+ OSL_ENSURE(!isListening(), "OUnoObject::StartListening: already listening!");
+
+ if ( !isListening() && m_xReportComponent.is() )
+ {
+ m_bIsListening = sal_True;
+
+ if ( !m_xPropertyChangeListener.is() )
+ {
+ m_xPropertyChangeListener = new OObjectListener( this );
+ // register listener to all properties
+ m_xReportComponent->addPropertyChangeListener( ::rtl::OUString() , m_xPropertyChangeListener );
+ }
+ }
+}
+//----------------------------------------------------------------------------
+void OObjectBase::EndListening(sal_Bool /*bRemoveListener*/)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+ OSL_ENSURE(!m_xReportComponent.is() || isListening(), "OUnoObject::EndListening: not listening currently!");
+
+ if ( isListening() && m_xReportComponent.is() )
+ {
+ m_bIsListening = sal_False;
+
+ // XPropertyChangeListener
+ if ( m_xPropertyChangeListener.is() )
+ {
+ // remove listener
+ try
+ {
+ m_xReportComponent->removePropertyChangeListener( ::rtl::OUString() , m_xPropertyChangeListener );
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"OObjectBase::EndListening: Exception caught!");
+ }
+ }
+ m_xPropertyChangeListener.clear();
+ }
+}
+//----------------------------------------------------------------------------
+void OObjectBase::SetPropsFromRect(const Rectangle& _rRect)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+ // set properties
+ OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
+ if ( pPage && !_rRect.IsEmpty() )
+ {
+ uno::Reference<report::XSection> xSection = pPage->getSection();
+ if ( xSection.is() && (static_cast<sal_uInt32>(_rRect.getHeight() + _rRect.Top()) > xSection->getHeight()) )
+ xSection->setHeight(_rRect.getHeight() + _rRect.Top());
+
+ // TODO
+ //pModel->GetRefDevice()->Invalidate(INVALIDATE_CHILDREN);
+ }
+}
+//----------------------------------------------------------------------------
+void OObjectBase::PositionAndSizeChange( const beans::PropertyChangeEvent& evt )
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+ OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
+ OSL_ENSURE( pPage, "OUnoObject::PositionAndSizeChange: no page!" );
+ if ( pPage )
+ {
+ sal_Int32 nPageX = 0;
+ sal_Int32 nPageY = 0;
+ Size aPageSize = pPage->GetSize();
+ sal_Int32 nPageWidth = aPageSize.Width();
+ sal_Int32 nPageHeight = aPageSize.Height();
+ if ( m_xReportComponent.is() )
+ {
+ sal_Int32 nX = m_xReportComponent->getPositionX();
+ sal_Int32 nY = m_xReportComponent->getPositionY();
+ sal_Int32 nWidth = m_xReportComponent->getWidth();
+ sal_Int32 nHeight = m_xReportComponent->getHeight();
+
+ sal_Int32 nValue;
+ evt.NewValue >>= nValue;
+ sal_Int32 nNewValue = nValue;
+
+ if ( evt.PropertyName == PROPERTY_POSITIONX )
+ {
+ if ( nNewValue + nWidth > nPageX + nPageWidth )
+ nNewValue = nPageX + nPageWidth - nWidth;
+ if ( nNewValue < nPageX )
+ nNewValue = nPageX;
+ }
+ else if ( evt.PropertyName == PROPERTY_POSITIONY )
+ {
+ if ( nNewValue + nHeight > nPageY + nPageHeight )
+ nNewValue = nPageY + nPageHeight - nHeight;
+ if ( nNewValue < nPageY )
+ nNewValue = nPageY;
+ }
+ else if ( evt.PropertyName == PROPERTY_WIDTH )
+ {
+ if ( nX + nNewValue > nPageX + nPageWidth )
+ nNewValue = nPageX + nPageWidth - nX;
+ if ( nNewValue < 1 )
+ nNewValue = 1;
+ }
+ else if ( evt.PropertyName == PROPERTY_HEIGHT )
+ {
+ if ( nY + nNewValue > nPageY + nPageHeight )
+ nNewValue = nPageY + nPageHeight - nY;
+ if ( nNewValue < 1 )
+ nNewValue = 1;
+ }
+
+ if ( nNewValue != nValue )
+ {
+ Any aNewValue;
+ aNewValue <<= nNewValue;
+ EndListening( sal_False );
+ m_xReportComponent->setPropertyValue( evt.PropertyName, aNewValue );
+ StartListening();
+ }
+ }
+ }
+}
+//----------------------------------------------------------------------------
+void OObjectBase::_propertyChange( const beans::PropertyChangeEvent& /*evt*/ ) throw( uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+}
+//----------------------------------------------------------------------------
+void OObjectBase::SetObjectItemHelper(const SfxPoolItem& /*rItem*/)
+{
+ // do nothing
+}
+
+//----------------------------------------------------------------------------
+void OObjectBase::_elementInserted(const container::ContainerEvent& /*Event*/) throw(uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+}
+
+//----------------------------------------------------------------------------
+void OObjectBase::_elementReplaced(const container::ContainerEvent& /*Event*/) throw(uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+}
+
+//----------------------------------------------------------------------------
+void OObjectBase::_elementRemoved(const container::ContainerEvent& /*Event*/) throw(uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+}
+
+//----------------------------------------------------------------------------
+sal_Bool OObjectBase::supportsService( const sal_Char* _pServiceName ) const
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+ sal_Bool bSupports = sal_False;
+
+ Reference< lang::XServiceInfo > xServiceInfo( m_xReportComponent , UNO_QUERY );
+ // TODO: cache xServiceInfo as member?
+ if ( xServiceInfo.is() )
+ bSupports = xServiceInfo->supportsService( ::rtl::OUString::createFromAscii( _pServiceName ) );
+
+ return bSupports;
+}
+
+//----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OObjectBase::getUnoShapeOf( SdrObject& _rSdrObject )
+{
+ uno::Reference< uno::XInterface > xShape( _rSdrObject.getWeakUnoShape() );
+ if ( xShape.is() )
+ return xShape;
+
+ xShape = _rSdrObject.SdrObject::getUnoShape();
+ if ( !xShape.is() )
+ return xShape;
+
+ // UNDO in the report designer is implemented at the level of the XShapes, not
+ // at the level of SdrObjects. That is, if an object is removed from the report
+ // design, then this happens by removing the XShape from the UNO DrawPage, and
+ // putting this XShape (resp. the ReportComponent which wraps it) into an UNDO
+ // action.
+ // Unfortunately, the SvxDrawPage implementation usually deletes SdrObjects
+ // which are removed from it, which is deadly for us. To prevent this,
+ // we given the XShape implementation the ownership of the SdrObject, which
+ // ensures the SvxDrawPage won't delete it.
+ SvxShape* pShape = SvxShape::getImplementation( xShape );
+ OSL_ENSURE( pShape, "OObjectBase::getUnoShapeOf: can't access the SvxShape!" );
+ if ( pShape )
+ pShape->TakeSdrObjectOwnership();
+
+ m_xKeepShapeAlive = xShape;
+ return xShape;
+}
+
+//----------------------------------------------------------------------------
+TYPEINIT1(OCustomShape, SdrObjCustomShape);
+DBG_NAME( rpt_OCustomShape );
+OCustomShape::OCustomShape(const uno::Reference< report::XReportComponent>& _xComponent
+ )
+ :SdrObjCustomShape()
+ ,OObjectBase(_xComponent)
+{
+ DBG_CTOR( rpt_OCustomShape, NULL);
+ // start listening
+ mxUnoShape = uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY);
+}
+//----------------------------------------------------------------------------
+OCustomShape::OCustomShape(const ::rtl::OUString& _sComponentName)
+ :SdrObjCustomShape()
+ ,OObjectBase(_sComponentName)
+{
+ DBG_CTOR( rpt_OCustomShape, NULL);
+}
+
+//----------------------------------------------------------------------------
+OCustomShape::~OCustomShape()
+{
+ DBG_DTOR( rpt_OCustomShape, NULL);
+ //mxUnoShape = uno::WeakReference< uno::XInterface >();
+}
+//----------------------------------------------------------------------------
+SdrPage* OCustomShape::GetImplPage() const
+{
+ return GetPage();
+}
+//----------------------------------------------------------------------------
+void OCustomShape::SetSnapRectImpl(const Rectangle& _rRect)
+{
+ SetSnapRect( _rRect );
+}
+//----------------------------------------------------------------------------
+sal_Int32 OCustomShape::GetStep() const
+{
+ // get step property
+ sal_Int32 nStep = 0;
+ OSL_ENSURE(0,"Who called me!");
+ return nStep;
+}
+//----------------------------------------------------------------------------
+void OCustomShape::NbcMove( const Size& rSize )
+{
+ SdrObjCustomShape::NbcMove( rSize );
+
+ // set geometry properties
+ SetPropsFromRect(GetSnapRect());
+}
+//----------------------------------------------------------------------------
+void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+{
+ SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
+
+ SetPropsFromRect(GetSnapRect());
+}
+//----------------------------------------------------------------------------
+void OCustomShape::NbcSetLogicRect(const Rectangle& rRect)
+{
+ SdrObjCustomShape::NbcSetLogicRect(rRect);
+ SetPropsFromRect(rRect);
+}
+//----------------------------------------------------------------------------
+
+FASTBOOL OCustomShape::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+{
+ FASTBOOL bResult = SdrObjCustomShape::EndCreate(rStat, eCmd);
+ if ( bResult )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ if ( !m_xReportComponent.is() )
+ m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
+ }
+ }
+
+ return bResult;
+}
+//----------------------------------------------------------------------------
+SdrObject* OCustomShape::CheckHit( const Point& rPnt, USHORT nTol,const SetOfByte* pSet ) const
+{
+ // #109994# fixed here, because the drawing layer doesn't handle objects
+ // with a width or height of 0 in a proper way
+ if ( IsInside(aOutRect,rPnt,nTol) )
+ return const_cast<OCustomShape*>(this);
+
+ return SdrObjCustomShape::CheckHit( rPnt, nTol, pSet );
+}
+
+//----------------------------------------------------------------------------
+void OCustomShape::SetObjectItemHelper(const SfxPoolItem& rItem)
+{
+ SetObjectItem(rItem);
+ // TODO
+ //getSectionWindow()->getView()->AdjustMarkHdl();
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySet> OCustomShape::getAwtComponent()
+{
+ return uno::Reference< beans::XPropertySet>(m_xReportComponent,uno::UNO_QUERY);
+}
+
+//----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OCustomShape::getUnoShape()
+{
+ return OObjectBase::getUnoShapeOf( *this );
+}
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+TYPEINIT1(OUnoObject, SdrUnoObj);
+DBG_NAME( rpt_OUnoObject );
+OUnoObject::OUnoObject(const uno::Reference< report::XReportComponent>& _xComponent
+ ,const uno::Reference< awt::XControlModel >& _xControlModel
+ ,sal_uInt16 _nObjectType)
+ :SdrUnoObj(String(), sal_False)
+ ,OObjectBase(_xComponent)
+ ,m_nObjectType(_nObjectType)
+{
+ DBG_CTOR( rpt_OUnoObject, NULL);
+ SetUnoControlModel( _xControlModel );
+ mxUnoShape = uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY);
+ //CreateMediator();
+}
+//----------------------------------------------------------------------------
+OUnoObject::OUnoObject(const ::rtl::OUString& _sComponentName
+ ,const ::rtl::OUString& rModelName
+ ,sal_uInt16 _nObjectType)
+ :SdrUnoObj(rModelName, sal_True)
+ ,OObjectBase(_sComponentName)
+ ,m_nObjectType(_nObjectType)
+{
+ DBG_CTOR( rpt_OUnoObject, NULL);
+}
+//----------------------------------------------------------------------------
+OUnoObject::OUnoObject(const uno::Reference< report::XReportComponent>& _xComponent
+ ,const ::rtl::OUString& rModelName
+ ,sal_uInt16 _nObjectType)
+ :SdrUnoObj(rModelName, sal_True)
+ ,OObjectBase(_xComponent)
+ ,m_nObjectType(_nObjectType)
+{
+ DBG_CTOR( rpt_OUnoObject, NULL);
+ mxUnoShape = uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY);
+}
+//----------------------------------------------------------------------------
+OUnoObject::~OUnoObject()
+{
+ DBG_DTOR( rpt_OUnoObject, NULL);
+ //mxUnoShape = uno::WeakReference< uno::XInterface >();
+}
+//----------------------------------------------------------------------------
+SdrPage* OUnoObject::GetImplPage() const
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ return GetPage();
+}
+//----------------------------------------------------------------------------
+void OUnoObject::SetSnapRectImpl(const Rectangle& _rRect)
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ SetSnapRect( _rRect );
+}
+//----------------------------------------------------------------------------
+sal_Int32 OUnoObject::GetStep() const
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ // get step property
+ sal_Int32 nStep = 0;
+ OSL_ENSURE(0,"Who called me!");
+ return nStep;
+}
+
+//----------------------------------------------------------------------------
+void OUnoObject::NbcMove( const Size& rSize )
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ SdrUnoObj::NbcMove( rSize );
+
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+
+ // start listening
+ OObjectBase::StartListening();
+}
+
+//----------------------------------------------------------------------------
+
+void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ SdrUnoObj::NbcResize( rRef, xFract, yFract );
+
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+
+ // start listening
+ OObjectBase::StartListening();
+
+}
+//----------------------------------------------------------------------------
+void OUnoObject::NbcSetLogicRect(const Rectangle& rRect)
+{
+ SdrUnoObj::NbcSetLogicRect(rRect);
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ // set geometry properties
+ SetPropsFromRect(rRect);
+
+ // start listening
+ OObjectBase::StartListening();
+}
+//----------------------------------------------------------------------------
+
+FASTBOOL OUnoObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ FASTBOOL bResult = SdrUnoObj::EndCreate(rStat, eCmd);
+ if ( bResult )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ if ( !m_xReportComponent.is() )
+ m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
+ // set labels
+ if ( m_xReportComponent.is() && supportsService( "com.sun.star.report.FixedText" ) )
+ m_xReportComponent->setPropertyValue( PROPERTY_LABEL, uno::makeAny(GetDefaultName()) );
+ }
+ }
+
+ return bResult;
+}
+//----------------------------------------------------------------------------
+::rtl::OUString OUnoObject::GetDefaultName() const
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ sal_uInt16 nResId = 0;
+ ::rtl::OUString aDefaultName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HERE WE HAVE TO INSERT OUR NAME!"));
+ if ( supportsService( "com.sun.star.report.FixedText" ) )
+ {
+ nResId = RID_STR_CLASS_FIXEDTEXT;
+ }
+ else if ( supportsService( "com.sun.star.report.FixedLine" ) )
+ {
+ nResId = RID_STR_CLASS_FIXEDLINE;
+ }
+ else if ( supportsService( "com.sun.star.report.ImageControl" ) )
+ {
+ nResId = RID_STR_CLASS_IMAGECONTROL;
+ }
+ else if ( supportsService( "com.sun.star.report.FormattedField" ) )
+ {
+ nResId = RID_STR_CLASS_FORMATTEDFIELD;
+ }
+
+ if (nResId)
+ aDefaultName = ::rtl::OUString( String(ModuleRes(nResId)) );
+
+ return aDefaultName;
+}
+//----------------------------------------------------------------------------
+SdrObject* OUnoObject::CheckHit( const Point& rPnt, USHORT nTol,const SetOfByte* pSet ) const
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ if ( IsInside(aOutRect,rPnt,nTol) )
+ return const_cast<OUnoObject*>(this);
+
+ return SdrUnoObj::CheckHit( rPnt, nTol, pSet );
+}
+// -----------------------------------------------------------------------------
+void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt ) throw( uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OUnoObject,NULL);
+ OObjectBase::_propertyChange(evt);
+ if (isListening())
+ {
+ if ( evt.PropertyName == PROPERTY_CHARCOLOR )
+ {
+ Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xControlModel.is() )
+ {
+ OObjectBase::EndListening(sal_False);
+ try
+ {
+ xControlModel->setPropertyValue(PROPERTY_TEXTCOLOR,evt.NewValue);
+ }
+ catch(uno::Exception&)
+ {
+ }
+ OObjectBase::StartListening();
+ }
+ }
+ else if ( evt.PropertyName == PROPERTY_NAME )
+ {
+ Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xControlModel.is() && xControlModel->getPropertySetInfo()->hasPropertyByName(PROPERTY_NAME) )
+ {
+ // get old name
+ ::rtl::OUString aOldName;
+ evt.OldValue >>= aOldName;
+
+ // get new name
+ ::rtl::OUString aNewName;
+ evt.NewValue >>= aNewName;
+
+ if ( !aNewName.equals(aOldName) )
+ {
+ // set old name property
+ OObjectBase::EndListening(sal_False);
+ if ( m_xMediator.is() )
+ m_xMediator.get()->stopListening();
+ try
+ {
+ xControlModel->setPropertyValue( PROPERTY_NAME, evt.NewValue );
+ }
+ catch(uno::Exception&)
+ {
+ }
+ if ( m_xMediator.is() )
+ m_xMediator.get()->startListening();
+ OObjectBase::StartListening();
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OUnoObject::CreateMediator(sal_Bool _bReverse)
+{
+ if ( !m_xMediator.is() )
+ {
+ if ( !m_xReportComponent.is() )
+ m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
+
+ Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
+ if ( !m_xMediator.is() && m_xReportComponent.is() && xControlModel.is() )
+ m_xMediator = TMediator::createFromQuery(new OPropertyMediator(m_xReportComponent.get(),xControlModel,getPropertyNameMap(getObjectId()),_bReverse));
+ OObjectBase::StartListening();
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< beans::XPropertySet> OUnoObject::getAwtComponent()
+{
+ return Reference<XPropertySet>(GetUnoControlModel(),uno::UNO_QUERY);
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OUnoObject::getUnoShape()
+{
+ return OObjectBase::getUnoShapeOf( *this );
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< style::XStyle> getUsedStyle(const uno::Reference< report::XReportDefinition>& _xReport)
+{
+ uno::Reference<container::XNameAccess> xStyles = _xReport->getStyleFamilies();
+ uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PageStyles"))),uno::UNO_QUERY);
+
+ uno::Reference< style::XStyle> xReturn;
+ uno::Sequence< ::rtl::OUString> aSeq = xPageStyles->getElementNames();
+ const ::rtl::OUString* pIter = aSeq.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aSeq.getLength();
+ for(;pIter != pEnd && !xReturn.is() ;++pIter)
+ {
+ uno::Reference< style::XStyle> xStyle(xPageStyles->getByName(*pIter),uno::UNO_QUERY);
+ if ( xStyle->isInUse() )
+ xReturn = xStyle;
+ }
+ return xReturn;
+}
+//----------------------------------------------------------------------------
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/core/sdr/RptObjectListener.cxx b/reportdesign/source/core/sdr/RptObjectListener.cxx
new file mode 100644
index 000000000000..8493356b821c
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptObjectListener.cxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptObjectListener.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_RPTUILIST_HXX
+#include "RptObjectListener.hxx"
+#endif
+
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+
+namespace rptui
+{
+//============================================================================
+// OObjectListener
+//============================================================================
+
+//----------------------------------------------------------------------------
+
+OObjectListener::OObjectListener(OObjectBase* _pObject)
+ :m_pObject(_pObject)
+{
+}
+
+//----------------------------------------------------------------------------
+
+OObjectListener::~OObjectListener()
+{
+}
+
+// XEventListener
+//----------------------------------------------------------------------------
+
+void SAL_CALL OObjectListener::disposing( const ::com::sun::star::lang::EventObject& ) throw( ::com::sun::star::uno::RuntimeException)
+{
+ /*
+ // disconnect the listener
+ if (m_pObject)
+ {
+ (m_pObject->m_xPropertyChangeListener).clear();
+ }
+ */
+}
+
+// XPropertyChangeListener
+//----------------------------------------------------------------------------
+
+void SAL_CALL OObjectListener::propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw( ::com::sun::star::uno::RuntimeException)
+{
+ m_pObject->_propertyChange( evt );
+}
+
+//----------------------------------------------------------------------------
+
+//============================================================================
+// DlgEdHint
+//============================================================================
+
+TYPEINIT1( DlgEdHint, SfxHint );
+
+//----------------------------------------------------------------------------
+
+DlgEdHint::DlgEdHint( DlgEdHintKind eHint )
+ :eHintKind( eHint )
+{
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdHint::DlgEdHint( DlgEdHintKind eHint, OUnoObject* pObj )
+ :eHintKind( eHint )
+ ,pDlgEdObj( pObj )
+{
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdHint::~DlgEdHint()
+{
+}
+//----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx
new file mode 100644
index 000000000000..37ed09429cee
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: RptPage.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#ifndef REPORTDESIGN_API_SECTION_HXX
+#include "Section.hxx"
+#endif
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef _SVX_UNOAPI_HXX_
+#include <svx/unoapi.hxx>
+#endif
+#ifndef _SVX_UNOSHAPE_HXX
+#include <svx/unoshape.hxx>
+#endif
+#ifndef REPORTDRAWPAGE_HXX_INCLUDED
+#include "ReportDrawPage.hxx"
+#endif
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+TYPEINIT1( OReportPage, SdrPage );
+
+//----------------------------------------------------------------------------
+DBG_NAME( rpt_OReportPage )
+OReportPage::OReportPage( OReportModel& _rModel
+ ,const uno::Reference< report::XSection >& _xSection
+ ,FASTBOOL bMasterPage )
+ :SdrPage( _rModel, bMasterPage )
+ ,rModel(_rModel)
+ ,m_xSection(_xSection)
+{
+ DBG_CTOR( rpt_OReportPage,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+OReportPage::OReportPage( const OReportPage& rPage )
+ :SdrPage( rPage )
+ ,rModel(rPage.rModel)
+{
+ DBG_CTOR( rpt_OReportPage,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+OReportPage::~OReportPage()
+{
+ DBG_DTOR( rpt_OReportPage,NULL);
+ Clear();
+}
+
+//----------------------------------------------------------------------------
+
+SdrPage* OReportPage::Clone() const
+{
+ DBG_CHKTHIS( rpt_OReportPage,NULL);
+ return new OReportPage( *this );
+}
+
+//----------------------------------------------------------------------------
+ULONG OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& _xObject)
+{
+ DBG_CHKTHIS( rpt_OReportPage,NULL);
+ ULONG nCount = GetObjCount();
+ ULONG i = 0;
+ if ( nCount != CONTAINER_ENTRY_NOTFOUND )
+ {
+ for (; i < nCount; ++i)
+ {
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(GetObj(i));
+ OSL_ENSURE(pObj,"Invalid object found!");
+ if ( pObj && pObj->getReportComponent() == _xObject )
+ {
+ break;
+ }
+ } // for (; i < nCount; ++i)
+ }
+ return i;
+}
+//----------------------------------------------------------------------------
+void OReportPage::removeSdrObject(const uno::Reference< report::XReportComponent >& _xObject)
+{
+ DBG_CHKTHIS( rpt_OReportPage,NULL);
+ ULONG nPos = getIndexOf(_xObject);
+ if ( nPos < GetObjCount() )
+ {
+ OObjectBase* pBase = dynamic_cast<OObjectBase*>(GetObj(nPos));
+ OSL_ENSURE(pBase,"Why is this not a OObjectBase?");
+ if ( pBase )
+ pBase->EndListening();
+ /*delete */RemoveObject(nPos);
+ }
+}
+// -----------------------------------------------------------------------------
+SdrObject* OReportPage::RemoveObject(ULONG nObjNum)
+{
+ SdrObject* pObj = SdrPage::RemoveObject(nObjNum);
+ // this code is evil, but what else shall I do
+ reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection);
+ uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY);
+ pSection->notifyElementRemoved(xShape);
+ if (pObj->ISA(OUnoObject))
+ {
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObj);
+ uno::Reference< container::XChild> xChild(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xChild.is() )
+ xChild->setParent(NULL);
+ }
+ return pObj;
+}
+//----------------------------------------------------------------------------
+//namespace
+//{
+// ::rtl::OUString lcl_getControlName(const uno::Reference< lang::XServiceInfo >& _xServiceInfo)
+// {
+// if ( _xServiceInfo->supportsService( SERVICE_FIXEDTEXT ))
+// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"));
+// if ( _xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ))
+// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"));
+// if ( _xServiceInfo->supportsService( SERVICE_IMAGECONTROL))
+// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"));
+//
+// return ::rtl::OUString();
+// }
+//}
+//----------------------------------------------------------------------------
+void OReportPage::insertObject(const uno::Reference< report::XReportComponent >& _xObject)
+{
+ DBG_CHKTHIS( rpt_OReportPage,NULL);
+ OSL_ENSURE(_xObject.is(),"Object is not valid to create a SdrObject!");
+ if ( !_xObject.is() ) // || !m_pView )
+ return;
+ ULONG nPos = getIndexOf(_xObject);
+ if ( nPos < GetObjCount() )
+ return; // Object already in list
+
+ SvxShape* pShape = SvxShape::getImplementation( _xObject );
+ OObjectBase* pObject = pShape ? dynamic_cast< OObjectBase* >( pShape->GetSdrObject() ) : NULL;
+ OSL_ENSURE( pObject, "OReportPage::insertObject: no implementation object found for the given shape/component!" );
+ if ( pObject )
+ pObject->StartListening();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XSection > OReportPage::getSection() const
+{
+ return m_xSection;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OReportPage::createUnoPage()
+{
+ return static_cast<cppu::OWeakObject*>( new reportdesign::OReportDrawPage(this,m_xSection) );
+}
+// -----------------------------------------------------------------------------
+void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason)
+{
+ SdrPage::NbcInsertObject(pObj, nPos, pReason);
+
+ OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( pObj );
+ if ( pUnoObj )
+ {
+ pUnoObj->CreateMediator();
+ uno::Reference< container::XChild> xChild(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xChild.is() && !xChild->getParent().is() )
+ xChild->setParent(m_xSection);
+ }
+
+ // this code is evil, but what else shall I do
+ reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection);
+ uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY);
+ pSection->notifyElementAdded(xShape);
+
+ // now that the shape is inserted into its structures, we can allow the OObjectBase
+ // to release the reference to it
+ OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( pObj );
+ OSL_ENSURE( pObjectBase, "OReportPage::NbcInsertObject: what is being inserted here?" );
+ if ( pObjectBase )
+ pObjectBase->releaseUnoShape();
+}
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx
new file mode 100644
index 000000000000..2eff63517c7e
--- /dev/null
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -0,0 +1,989 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UndoActions.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "UndoActions.hxx"
+#include "UndoEnv.hxx"
+#include "formatnormalizer.hxx"
+#include "corestrings.hrc"
+#include "rptui_slotid.hrc"
+#include "RptDef.hxx"
+#include "ModuleHelper.hxx"
+#include "RptObject.hxx"
+#include "RptPage.hxx"
+#include "RptResId.hrc"
+#include "RptModel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+/** === end UNO includes === **/
+
+#include <connectivity/dbtools.hxx>
+#include <svtools/smplhint.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/stl_types.hxx>
+#include <vcl/svapp.hxx>
+#include <dbaccess/singledoccontroller.hxx>
+#include <svx/unoshape.hxx>
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+ using namespace uno;
+ using namespace lang;
+ using namespace script;
+ using namespace beans;
+ using namespace awt;
+ using namespace util;
+ using namespace container;
+ using namespace report;
+//----------------------------------------------------------------------------
+::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> OGroupHelper::getMemberFunction(const Reference< XSection >& _xSection)
+{
+ ::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter);
+ uno::Reference< report::XGroup> xGroup = _xSection->getGroup();
+ if ( xGroup->getHeaderOn() && xGroup->getHeader() == _xSection )
+ pMemFunSection = ::std::mem_fun(&OGroupHelper::getHeader);
+ return pMemFunSection;
+}
+// -----------------------------------------------------------------------------
+::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> OReportHelper::getMemberFunction(const Reference< XSection >& _xSection)
+{
+ uno::Reference< report::XReportDefinition> xReportDefinition(_xSection->getReportDefinition());
+ ::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> pMemFunSection = ::std::mem_fun(&OReportHelper::getReportFooter);
+ if ( xReportDefinition->getReportHeaderOn() && xReportDefinition->getReportHeader() == _xSection )
+ pMemFunSection = ::std::mem_fun(&OReportHelper::getReportHeader);
+ else if ( xReportDefinition->getPageHeaderOn() && xReportDefinition->getPageHeader() == _xSection )
+ pMemFunSection = ::std::mem_fun(&OReportHelper::getPageHeader);
+ else if ( xReportDefinition->getPageFooterOn() && xReportDefinition->getPageFooter() == _xSection )
+ pMemFunSection = ::std::mem_fun(&OReportHelper::getPageFooter);
+ else if ( xReportDefinition->getDetail() == _xSection )
+ pMemFunSection = ::std::mem_fun(&OReportHelper::getDetail);
+ return pMemFunSection;
+}
+
+DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties);
+DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache);
+//------------------------------------------------------------------------------
+TYPEINIT1( OCommentUndoAction, SdrUndoAction );
+//----------------------------------------------------------------------------
+OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,USHORT nCommentID)
+ :SdrUndoAction(_rMod)
+{
+ m_pController = static_cast< OReportModel& >( _rMod ).getController();
+ if ( nCommentID )
+ m_strComment = String(ModuleRes(nCommentID));
+}
+//----------------------------------------------------------------------------
+void OCommentUndoAction::Undo()
+{
+}
+//----------------------------------------------------------------------------
+void OCommentUndoAction::Redo()
+{
+}
+DBG_NAME( rpt_OUndoContainerAction );
+//------------------------------------------------------------------------------
+OUndoContainerAction::OUndoContainerAction(SdrModel& _rMod
+ ,Action _eAction
+ ,const uno::Reference< container::XIndexContainer > _xContainer
+ ,const Reference< XInterface > & xElem
+ ,USHORT _nCommentId)
+ :OCommentUndoAction(_rMod,_nCommentId)
+ ,m_xElement(xElem)
+ ,m_xContainer(_xContainer)
+ ,m_eAction( _eAction )
+{
+ DBG_CTOR( rpt_OUndoContainerAction,NULL);
+ // normalize
+ if ( m_eAction == Removed )
+ // we now own the element
+ m_xOwnElement = m_xElement;
+}
+//------------------------------------------------------------------------------
+OUndoContainerAction::~OUndoContainerAction()
+{
+ // if we own the object ....
+ Reference< XComponent > xComp( m_xOwnElement, UNO_QUERY );
+ if ( xComp.is() )
+ {
+ // and the object does not have a parent
+ Reference< XChild > xChild( m_xOwnElement, UNO_QUERY );
+ if ( xChild.is() && !xChild->getParent().is() )
+ {
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ rEnv.RemoveElement( m_xOwnElement );
+
+#if OSL_DEBUG_LEVEL > 0
+ SvxShape* pShape = SvxShape::getImplementation( xChild );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ OSL_ENSURE( pShape && ( pObject ? pShape->HasSdrObjectOwnership() && !pObject->IsInserted() : true ),
+ "OUndoContainerAction::~OUndoContainerAction: inconsistency in the shape/object ownership!" );
+#endif
+ // -> dispose it
+ try
+ {
+ comphelper::disposeComponent( xComp );
+ }
+ catch ( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+ DBG_DTOR( rpt_OUndoContainerAction,NULL);
+}
+//------------------------------------------------------------------------------
+void OUndoContainerAction::implReInsert( ) SAL_THROW( ( Exception ) )
+{
+ if ( m_xContainer.is() )
+ {
+ // insert the element
+ m_xContainer->insertByIndex( m_xContainer->getCount(),uno::makeAny(m_xElement) );
+ }
+ // we don't own the object anymore
+ m_xOwnElement = NULL;
+}
+
+//------------------------------------------------------------------------------
+void OUndoContainerAction::implReRemove( ) SAL_THROW( ( Exception ) )
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ try
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ if ( m_xContainer.is() )
+ {
+ const sal_Int32 nCount = m_xContainer->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference< uno::XInterface> xObj(m_xContainer->getByIndex(i),uno::UNO_QUERY);
+ if ( xObj == m_xElement )
+ {
+ m_xContainer->removeByIndex( i );
+ break;
+ }
+ }
+ }
+ }
+ catch(uno::Exception&){}
+ // from now on, we own this object
+ m_xOwnElement = m_xElement;
+}
+
+//------------------------------------------------------------------------------
+void OUndoContainerAction::Undo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+
+ if ( !rEnv.IsLocked() && m_xElement.is() )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ // prevents that an undo action will be created for elementInserted
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReRemove();
+ break;
+
+ case Removed:
+ implReInsert();
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal case value");
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OUndoContainerAction::Undo: caught an exception!" );
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+void OUndoContainerAction::Redo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ if ( !rEnv.IsLocked() && m_xElement.is() )
+ {
+ //rEnv.Lock(); // redo doesn't work when locked
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReInsert();
+ break;
+
+ case Removed:
+ implReRemove();
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal case value");
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OUndoContainerAction::Redo: caught an exception!" );
+ }
+ //rEnv.UnLock();
+ }
+}
+// -----------------------------------------------------------------------------
+OUndoGroupSectionAction::OUndoGroupSectionAction(SdrModel& _rMod
+ ,Action _eAction
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const uno::Reference< report::XGroup >& _xGroup
+ ,const Reference< XInterface > & xElem
+ ,USHORT _nCommentId)
+:OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId)
+,m_aGroupHelper(_xGroup)
+,m_pMemberFunction(_pMemberFunction)
+{
+}
+//------------------------------------------------------------------------------
+void OUndoGroupSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ try
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ uno::Reference< report::XSection> xSection = m_pMemberFunction(&m_aGroupHelper);
+ if ( xSection.is() )
+ xSection->add(uno::Reference< drawing::XShape>(m_xElement,uno::UNO_QUERY));
+ }
+ catch(uno::Exception&){}
+
+ // we don't own the object anymore
+ m_xOwnElement = NULL;
+}
+
+//------------------------------------------------------------------------------
+void OUndoGroupSectionAction::implReRemove( ) SAL_THROW( ( Exception ) )
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ try
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ uno::Reference< report::XSection> xSection = m_pMemberFunction(&m_aGroupHelper);
+ if ( xSection.is() )
+ xSection->remove(uno::Reference< drawing::XShape>(m_xElement,uno::UNO_QUERY));
+ }
+ catch(uno::Exception&){}
+
+ // from now on, we own this object
+ m_xOwnElement = m_xElement;
+}
+//----------------------------------------------------------------------------
+OUndoReportSectionAction::OUndoReportSectionAction(SdrModel& _rMod
+ ,Action _eAction
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const uno::Reference< report::XReportDefinition >& _xReport
+ ,const Reference< XInterface > & xElem
+ ,USHORT _nCommentId)
+:OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId)
+,m_aReportHelper(_xReport)
+,m_pMemberFunction(_pMemberFunction)
+{
+}
+//------------------------------------------------------------------------------
+void OUndoReportSectionAction::implReInsert( ) SAL_THROW( ( Exception ) )
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ try
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ uno::Reference< report::XSection> xSection = m_pMemberFunction(&m_aReportHelper);
+ if ( xSection.is() )
+ {
+ uno::Reference< drawing::XShape> xShape(m_xElement,uno::UNO_QUERY_THROW);
+ awt::Point aPos = xShape->getPosition();
+ awt::Size aSize = xShape->getSize();
+ xSection->add(xShape);
+ xShape->setPosition( aPos );
+ xShape->setSize( aSize );
+ }
+ }
+ catch(uno::Exception&){}
+ // we don't own the object anymore
+ m_xOwnElement = NULL;
+}
+
+//------------------------------------------------------------------------------
+void OUndoReportSectionAction::implReRemove( ) SAL_THROW( ( Exception ) )
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ try
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ uno::Reference< report::XSection> xSection = m_pMemberFunction(&m_aReportHelper);
+ if ( xSection.is() )
+ xSection->remove(uno::Reference< drawing::XShape>(m_xElement,uno::UNO_QUERY));
+ }
+ catch(uno::Exception&){}
+ // from now on, we own this object
+ m_xOwnElement = m_xElement;
+}
+//------------------------------------------------------------------------------
+ORptUndoPropertyAction::ORptUndoPropertyAction(SdrModel& rNewMod, const PropertyChangeEvent& evt)
+ :OCommentUndoAction(rNewMod,0)
+ ,m_xObj(evt.Source, UNO_QUERY)
+ ,m_aPropertyName(evt.PropertyName)
+ ,m_aNewValue(evt.NewValue)
+ ,m_aOldValue(evt.OldValue)
+{
+}
+//------------------------------------------------------------------------------
+void ORptUndoPropertyAction::Undo()
+{
+ setProperty(sal_True);
+}
+
+//------------------------------------------------------------------------------
+void ORptUndoPropertyAction::Redo()
+{
+ setProperty(sal_False);
+}
+// -----------------------------------------------------------------------------
+Reference< XPropertySet> ORptUndoPropertyAction::getObject()
+{
+ return m_xObj;
+}
+// -----------------------------------------------------------------------------
+void ORptUndoPropertyAction::setProperty(sal_Bool _bOld)
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ Reference< XPropertySet> xObj = getObject();
+
+ if (xObj.is() && !rEnv.IsLocked())
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ try
+ {
+ xObj->setPropertyValue( m_aPropertyName, _bOld ? m_aOldValue : m_aNewValue );
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "ORptUndoPropertyAction::Redo: caught an exception!" );
+ }
+ }
+}
+
+//------------------------------------------------------------------------------
+String ORptUndoPropertyAction::GetComment() const
+{
+ String aStr(String(ModuleRes(RID_STR_UNDO_PROPERTY)));
+
+ aStr.SearchAndReplace( '#', m_aPropertyName );
+ return aStr;
+}
+// -----------------------------------------------------------------------------
+OUndoPropertyGroupSectionAction::OUndoPropertyGroupSectionAction(SdrModel& _rMod
+ ,const PropertyChangeEvent& evt
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const uno::Reference< report::XGroup >& _xGroup
+ )
+:ORptUndoPropertyAction(_rMod,evt)
+,m_aGroupHelper(_xGroup)
+,m_pMemberFunction(_pMemberFunction)
+{
+}
+// -----------------------------------------------------------------------------
+Reference< XPropertySet> OUndoPropertyGroupSectionAction::getObject()
+{
+ return m_pMemberFunction(&m_aGroupHelper).get();
+}
+// -----------------------------------------------------------------------------
+OUndoPropertyReportSectionAction::OUndoPropertyReportSectionAction(SdrModel& _rMod
+ ,const PropertyChangeEvent& evt
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const uno::Reference< report::XReportDefinition >& _xReport
+ )
+:ORptUndoPropertyAction(_rMod,evt)
+,m_aReportHelper(_xReport)
+,m_pMemberFunction(_pMemberFunction)
+{
+}
+// -----------------------------------------------------------------------------
+Reference< XPropertySet> OUndoPropertyReportSectionAction::getObject()
+{
+ return m_pMemberFunction(&m_aReportHelper).get();
+}
+// -----------------------------------------------------------------------------
+
+class OXUndoEnvironmentImpl
+{
+ OXUndoEnvironmentImpl(OXUndoEnvironmentImpl&);
+ void operator =(OXUndoEnvironmentImpl&);
+public:
+ OReportModel& m_rModel;
+ PropertySetInfoCache m_aPropertySetCache;
+ FormatNormalizer m_aFormatNormalizer;
+ ::osl::Mutex m_aMutex;
+ ::std::vector< uno::Reference< container::XChild> > m_aSections;
+ oslInterlockedCount m_nLocks;
+ sal_Bool m_bReadOnly;
+
+ OXUndoEnvironmentImpl(OReportModel& _rModel);
+};
+
+OXUndoEnvironmentImpl::OXUndoEnvironmentImpl(OReportModel& _rModel) : m_rModel(_rModel)
+ ,m_aFormatNormalizer( _rModel )
+ ,m_nLocks(0)
+ ,m_bReadOnly(sal_False)
+{
+}
+//------------------------------------------------------------------------------
+DBG_NAME( rpt_OXUndoEnvironment );
+//------------------------------------------------------------------------------
+OXUndoEnvironment::OXUndoEnvironment(OReportModel& _rModel)
+ :m_pImpl(new OXUndoEnvironmentImpl(_rModel) )
+{
+ DBG_CTOR( rpt_OXUndoEnvironment,NULL);
+ StartListening(m_pImpl->m_rModel);
+}
+
+//------------------------------------------------------------------------------
+OXUndoEnvironment::~OXUndoEnvironment()
+{
+ DBG_DTOR( rpt_OXUndoEnvironment,NULL);
+}
+// -----------------------------------------------------------------------------
+void OXUndoEnvironment::Lock()
+{
+ OSL_ENSURE(m_refCount,"Illegall call to dead object!");
+ osl_incrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+void OXUndoEnvironment::UnLock()
+{
+ OSL_ENSURE(m_refCount,"Illegall call to dead object!");
+
+ osl_decrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+sal_Bool OXUndoEnvironment::IsLocked() const { return m_pImpl->m_nLocks != 0; }
+sal_Bool OXUndoEnvironment::IsReadOnly() const {return m_pImpl->m_bReadOnly;}
+void OXUndoEnvironment::SetReadOnly( sal_Bool bRead, const Accessor& ) { m_pImpl->m_bReadOnly = bRead; }
+// -----------------------------------------------------------------------------
+void OXUndoEnvironment::RemoveSection(OReportPage* _pPage)
+{
+ if ( _pPage )
+ {
+ Reference< XInterface > xSection(_pPage->getSection());
+ if ( xSection.is() )
+ RemoveElement( xSection );
+ }
+}
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::Clear(const Accessor& /*_r*/)
+{
+ OUndoEnvLock aLock(*this);
+
+#if OSL_DEBUG_LEVEL > 0
+ PropertySetInfoCache::iterator aIter = m_pImpl->m_aPropertySetCache.begin();
+ PropertySetInfoCache::iterator aEnd = m_pImpl->m_aPropertySetCache.end();
+ int ndbg_len = m_pImpl->m_aPropertySetCache.size();
+ ndbg_len = ndbg_len;
+ for (int idbg_ = 0; aIter != aEnd; ++aIter,++idbg_)
+ {
+ uno::Reference<beans::XPropertySet> xProp(aIter->first,uno::UNO_QUERY);
+ xProp->getPropertySetInfo();
+ int nlen = aIter->second.size();
+ nlen = nlen;
+ }
+#endif
+ m_pImpl->m_aPropertySetCache.clear();
+
+ sal_uInt16 nCount = m_pImpl->m_rModel.GetPageCount();
+ sal_uInt16 i;
+ for (i = 0; i < nCount; i++)
+ {
+ OReportPage* pPage = PTR_CAST( OReportPage, m_pImpl->m_rModel.GetPage(i) );
+ RemoveSection(pPage);
+ }
+
+ nCount = m_pImpl->m_rModel.GetMasterPageCount();
+ for (i = 0; i < nCount; i++)
+ {
+ OReportPage* pPage = PTR_CAST( OReportPage, m_pImpl->m_rModel.GetMasterPage(i) );
+ RemoveSection(pPage);
+ }
+
+ m_pImpl->m_aSections.clear();
+
+ if (IsListening(m_pImpl->m_rModel))
+ EndListening(m_pImpl->m_rModel);
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::ModeChanged()
+{
+ m_pImpl->m_bReadOnly = !m_pImpl->m_bReadOnly;
+
+ if (!m_pImpl->m_bReadOnly)
+ StartListening(m_pImpl->m_rModel);
+ else
+ EndListening(m_pImpl->m_rModel);
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
+{
+ if (rHint.ISA(SfxSimpleHint) && ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_MODECHANGED )
+ ModeChanged();
+}
+// -----------------------------------------------------------------------------
+// XEventListener
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::disposing(const EventObject& e) throw( RuntimeException )
+{
+ // check if it's an object we have cached informations about
+ Reference< XPropertySet > xSourceSet(e.Source, UNO_QUERY);
+ if ( xSourceSet.is() )
+ {
+ uno::Reference< report::XSection> xSection(xSourceSet,uno::UNO_QUERY);
+ if ( xSection.is() )
+ RemoveSection(xSection);
+ else
+ RemoveElement(xSourceSet);
+ /*if (!m_pImpl->m_aPropertySetCache.empty())
+ m_pImpl->m_aPropertySetCache.erase(xSourceSet);*/
+ }
+}
+
+// XPropertyChangeListener
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEvent ) throw(uno::RuntimeException)
+{
+ ::osl::ClearableMutexGuard aGuard( m_pImpl->m_aMutex );
+
+ if ( IsLocked() )
+ return;
+
+ Reference< XPropertySet > xSet( _rEvent.Source, UNO_QUERY );
+ if (!xSet.is())
+ return;
+
+ dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController();
+ if ( !pController )
+ return;
+
+ // no Undo for transient and readonly props.
+ // let's see if we know something about the set
+#if OSL_DEBUG_LEVEL > 0
+ int nlen = m_pImpl->m_aPropertySetCache.size();
+ nlen = nlen;
+#endif
+ PropertySetInfoCache::iterator aSetPos = m_pImpl->m_aPropertySetCache.find(xSet);
+ if (aSetPos == m_pImpl->m_aPropertySetCache.end())
+ {
+ AllProperties aNewEntry;
+ aSetPos = m_pImpl->m_aPropertySetCache.insert(PropertySetInfoCache::value_type(xSet,aNewEntry)).first;
+ DBG_ASSERT(aSetPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
+ }
+ if ( aSetPos == m_pImpl->m_aPropertySetCache.end() )
+ return;
+
+ // now we have access to the cached info about the set
+ // let's see what we know about the property
+ AllProperties& rPropInfos = aSetPos->second;
+ AllPropertiesIterator aPropertyPos = rPropInfos.find( _rEvent.PropertyName );
+ if (aPropertyPos == rPropInfos.end())
+ { // nothing 'til now ... have to change this ....
+ // the attributes
+ INT32 nAttributes = xSet->getPropertySetInfo()->getPropertyByName( _rEvent.PropertyName ).Attributes;
+ bool bTransReadOnly = ((nAttributes & PropertyAttribute::READONLY) != 0) || ((nAttributes & PropertyAttribute::TRANSIENT) != 0);
+
+ // insert the new entry
+ aPropertyPos = rPropInfos.insert( AllProperties::value_type( _rEvent.PropertyName, bTransReadOnly ) ).first;
+ DBG_ASSERT(aPropertyPos != rPropInfos.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
+ }
+
+ implSetModified();
+
+ // now we have access to the cached info about the property affected
+ // and are able to decide wether or not we need an undo action
+
+ // no UNDO for transient/readonly properties
+ if ( aPropertyPos->second )
+ return;
+
+ // give our format normalizer a chance
+ m_pImpl->m_aFormatNormalizer.notifyPropertyChange( _rEvent );
+
+ aGuard.clear();
+ // TODO: this is a potential race condition: two threads here could in theory
+ // add their undo actions out-of-order
+
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ORptUndoPropertyAction* pUndo = NULL;
+ try
+ {
+ uno::Reference< report::XSection> xSection( xSet, uno::UNO_QUERY );
+ if ( xSection.is() )
+ {
+ uno::Reference< report::XGroup> xGroup = xSection->getGroup();
+ if ( xGroup.is() )
+ pUndo = new OUndoPropertyGroupSectionAction( m_pImpl->m_rModel, _rEvent, OGroupHelper::getMemberFunction( xSection ), xGroup );
+ else
+ pUndo = new OUndoPropertyReportSectionAction( m_pImpl->m_rModel, _rEvent, OReportHelper::getMemberFunction( xSection ), xSection->getReportDefinition() );
+ }
+ }
+ catch(const Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ if ( pUndo == NULL )
+ pUndo = new ORptUndoPropertyAction( m_pImpl->m_rModel, _rEvent );
+
+ pController->addUndoActionAndInvalidate(pUndo);
+ pController->InvalidateAll();
+}
+// -----------------------------------------------------------------------------
+::std::vector< uno::Reference< container::XChild> >::const_iterator OXUndoEnvironment::getSection(const Reference<container::XChild>& _xContainer) const
+{
+ ::std::vector< uno::Reference< container::XChild> >::const_iterator aFind = m_pImpl->m_aSections.end();
+ if ( _xContainer.is() )
+ {
+ aFind = ::std::find(m_pImpl->m_aSections.begin(),m_pImpl->m_aSections.end(),_xContainer);
+
+ if ( aFind == m_pImpl->m_aSections.end() )
+ {
+ Reference<container::XChild> xParent(_xContainer->getParent(),uno::UNO_QUERY);
+ aFind = getSection(xParent);
+ }
+ }
+ return aFind;
+}
+// XContainerListener
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ // neues Object zum lauschen
+ Reference< uno::XInterface > xIface( evt.Element, UNO_QUERY );
+ if ( !IsLocked() )
+ {
+ Reference< report::XReportComponent > xReportComponent( xIface, UNO_QUERY );
+ if ( xReportComponent.is() )
+ {
+ Reference< report::XSection > xContainer(evt.Source,uno::UNO_QUERY);
+
+ ::std::vector< uno::Reference< container::XChild> >::const_iterator aFind = getSection(xContainer.get());
+
+ if ( aFind != m_pImpl->m_aSections.end() )
+ {
+ OUndoEnvLock aLock(*this);
+ try
+ {
+ OReportPage* pPage = m_pImpl->m_rModel.getPage(uno::Reference< report::XSection>(*aFind,uno::UNO_QUERY));
+ OSL_ENSURE(pPage,"No page could be found for section!");
+ if ( pPage )
+ pPage->insertObject(xReportComponent);
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ }
+ }
+ else
+ {
+ uno::Reference< report::XFunctions> xContainer(evt.Source,uno::UNO_QUERY);
+ if ( xContainer.is() )
+ {
+ dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController();
+ pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel
+ ,rptui::Inserted
+ ,xContainer.get()
+ ,xIface
+ ,RID_STR_UNDO_ADDFUNCTION));
+ }
+ }
+ }
+
+ AddElement(xIface);
+
+ implSetModified();
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::implSetModified()
+{
+ //if ( !IsLocked() )
+ m_pImpl->m_rModel.SetModified( sal_True );
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::elementReplaced(const ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ Reference< XInterface > xIface(evt.ReplacedElement,uno::UNO_QUERY);
+ OSL_ENSURE(xIface.is(), "OXUndoEnvironment::elementReplaced: invalid container notification!");
+ RemoveElement(xIface);
+
+ xIface.set(evt.Element,uno::UNO_QUERY);
+ AddElement(xIface);
+
+ implSetModified();
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::elementRemoved(const ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ Reference< uno::XInterface > xIface( evt.Element, UNO_QUERY );
+ if ( !IsLocked() )
+ {
+ Reference< report::XSection > xContainer(evt.Source,uno::UNO_QUERY);
+ ::std::vector< uno::Reference< container::XChild> >::const_iterator aFind = getSection(xContainer.get());
+
+ Reference< report::XReportComponent > xReportComponent( xIface, UNO_QUERY );
+ if ( aFind != m_pImpl->m_aSections.end() && xReportComponent.is() )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(*this);
+ try
+ {
+ OReportPage* pPage = m_pImpl->m_rModel.getPage(uno::Reference< report::XSection >( *aFind, uno::UNO_QUERY_THROW ) );
+ OSL_ENSURE( pPage, "OXUndoEnvironment::elementRemoved: no page for the section!" );
+ if ( pPage )
+ pPage->removeSdrObject(xReportComponent);
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ else
+ {
+ uno::Reference< report::XFunctions> xFunctions(evt.Source,uno::UNO_QUERY);
+ if ( xFunctions.is() )
+ {
+ dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController();
+ pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel
+ ,rptui::Removed
+ ,xFunctions.get()
+ ,xIface
+ ,RID_STR_UNDO_ADDFUNCTION));
+ }
+ }
+ }
+
+ if ( xIface.is() )
+ RemoveElement(xIface);
+
+ implSetModified();
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXUndoEnvironment::modified( const EventObject& /*aEvent*/ ) throw (RuntimeException)
+{
+ implSetModified();
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::AddSection(const Reference< report::XSection > & _xSection)
+{
+ OUndoEnvLock aLock(*this);
+ try
+ {
+ uno::Reference<container::XChild> xChild = _xSection.get();
+ uno::Reference<report::XGroup> xGroup(xChild->getParent(),uno::UNO_QUERY);
+ m_pImpl->m_aSections.push_back(xChild);
+ Reference< XInterface > xInt(_xSection);
+ AddElement(xInt);
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::RemoveSection(const Reference< report::XSection > & _xSection)
+{
+ OUndoEnvLock aLock(*this);
+ try
+ {
+ uno::Reference<container::XChild> xChild(_xSection.get());
+ m_pImpl->m_aSections.erase(::std::remove(m_pImpl->m_aSections.begin(),m_pImpl->m_aSections.end(),
+ xChild), m_pImpl->m_aSections.end());
+ Reference< XInterface > xInt(_xSection);
+ RemoveElement(xInt);
+ }
+ catch(uno::Exception&){}
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::TogglePropertyListening(const Reference< XInterface > & Element)
+{
+ // am Container horchen
+ Reference< XIndexAccess > xContainer(Element, UNO_QUERY);
+ if (xContainer.is())
+ {
+ Reference< XInterface > xInterface;
+ sal_Int32 nCount = xContainer->getCount();
+ for(sal_Int32 i = 0;i != nCount;++i)
+ {
+ xInterface.set(xContainer->getByIndex( i ),uno::UNO_QUERY);
+ TogglePropertyListening(xInterface);
+ }
+ }
+
+ Reference< XPropertySet > xSet(Element, UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!m_pImpl->m_bReadOnly)
+ xSet->addPropertyChangeListener( ::rtl::OUString(), this );
+ else
+ xSet->removePropertyChangeListener( ::rtl::OUString(), this );
+ }
+}
+
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::switchListening( const Reference< XIndexAccess >& _rxContainer, bool _bStartListening ) SAL_THROW(())
+{
+ OSL_PRECOND( _rxContainer.is(), "OXUndoEnvironment::switchListening: invalid container!" );
+ if ( !_rxContainer.is() )
+ return;
+
+ try
+ {
+ // also handle all children of this element
+ Reference< XInterface > xInterface;
+ sal_Int32 nCount = _rxContainer->getCount();
+ for(sal_Int32 i = 0;i != nCount;++i)
+ {
+ xInterface.set(_rxContainer->getByIndex( i ),uno::UNO_QUERY);
+ if ( _bStartListening )
+ AddElement( xInterface );
+ else
+ RemoveElement( xInterface );
+ }
+
+ // be notified of any changes in the container elements
+ Reference< XContainer > xSimpleContainer( _rxContainer, UNO_QUERY );
+ // OSL_ENSURE( xSimpleContainer.is(), "OXUndoEnvironment::switchListening: how are we expected to be notified of changes in the container?" );
+ if ( xSimpleContainer.is() )
+ if ( _bStartListening )
+ xSimpleContainer->addContainerListener( this );
+ else
+ xSimpleContainer->removeContainerListener( this );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::switchListening( const Reference< XInterface >& _rxObject, bool _bStartListening ) SAL_THROW(())
+{
+ OSL_PRECOND( _rxObject.is(), "OXUndoEnvironment::switchListening: how should I listen at a NULL object?" );
+
+ try
+ {
+ if ( !m_pImpl->m_bReadOnly )
+ {
+ Reference< XPropertySet > xProps( _rxObject, UNO_QUERY );
+ if ( xProps.is() )
+ if ( _bStartListening )
+ xProps->addPropertyChangeListener( ::rtl::OUString(), this );
+ else
+ xProps->removePropertyChangeListener( ::rtl::OUString(), this );
+ }
+
+ Reference< XModifyBroadcaster > xBroadcaster( _rxObject, UNO_QUERY );
+ if ( xBroadcaster.is() )
+ if ( _bStartListening )
+ xBroadcaster->addModifyListener( this );
+ else
+ xBroadcaster->removeModifyListener( this );
+ }
+ catch( const Exception& )
+ {
+ //OSL_ENSURE( sal_False, "OXUndoEnvironment::switchListening: caught an exception!" );
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::AddElement(const Reference< XInterface >& _rxElement )
+{
+ m_pImpl->m_aFormatNormalizer.notifyElementInserted( _rxElement );
+
+ // if it's a container, start listening at all elements
+ Reference< XIndexAccess > xContainer( _rxElement, UNO_QUERY );
+ if ( xContainer.is() )
+ switchListening( xContainer, true );
+
+ switchListening( _rxElement, true );
+}
+
+//------------------------------------------------------------------------------
+void OXUndoEnvironment::RemoveElement(const Reference< XInterface >& _rxElement)
+{
+ uno::Reference<beans::XPropertySet> xProp(_rxElement,uno::UNO_QUERY);
+ if (!m_pImpl->m_aPropertySetCache.empty())
+ m_pImpl->m_aPropertySetCache.erase(xProp);
+ switchListening( _rxElement, false );
+
+ Reference< XIndexAccess > xContainer( _rxElement, UNO_QUERY );
+ if ( xContainer.is() )
+ switchListening( xContainer, false );
+}
+
+//============================================================================
+} // rptui
+//============================================================================
+
diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx
new file mode 100644
index 000000000000..8af260596218
--- /dev/null
+++ b/reportdesign/source/core/sdr/formatnormalizer.cxx
@@ -0,0 +1,288 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: formatnormalizer.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include "formatnormalizer.hxx"
+#include "RptModel.hxx"
+
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#endif
+/** === end UNO includes === **/
+
+#include <dbaccess/singledoccontroller.hxx>
+#include <svtools/syslocale.hxx>
+#include <connectivity/statementcomposer.hxx>
+#include <connectivity/dbtools.hxx>
+#include <tools/diagnose_ex.h>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::report::XReportDefinition;
+ using ::com::sun::star::report::XFormattedField;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::sdb::XSingleSelectQueryComposer;
+ using ::com::sun::star::sdbcx::XColumnsSupplier;
+ using ::com::sun::star::container::XIndexAccess;
+ using ::com::sun::star::beans::XPropertySet;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::sdb::XParametersSupplier;
+ using ::com::sun::star::sdbc::SQLException;
+ using ::com::sun::star::util::XNumberFormatsSupplier;
+ using ::com::sun::star::util::XNumberFormatTypes;
+ /** === end UNO using === **/
+
+ //====================================================================
+ //= FormatNormalizer
+ //====================================================================
+ //--------------------------------------------------------------------
+ FormatNormalizer::FormatNormalizer( const OReportModel& _rModel )
+ :m_rModel( _rModel )
+ ,m_xReportDefinition( )
+ ,m_bFieldListDirty( true )
+ {
+ }
+
+ //--------------------------------------------------------------------
+ FormatNormalizer::~FormatNormalizer()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ void FormatNormalizer::notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent )
+ {
+ if ( !impl_lateInit() )
+ return;
+
+ if ( ( _rEvent.Source == m_xReportDefinition ) && m_xReportDefinition.is() )
+ {
+ impl_onDefinitionPropertyChange( _rEvent.PropertyName );
+ return;
+ }
+
+ Reference< XFormattedField > xFormatted( _rEvent.Source, UNO_QUERY );
+ if ( xFormatted.is() )
+ impl_onFormattedProperttyChange( xFormatted, _rEvent.PropertyName );
+ }
+
+ //--------------------------------------------------------------------
+ void FormatNormalizer::notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement )
+ {
+ if ( !impl_lateInit() )
+ return;
+
+ Reference< XFormattedField > xFormatted( _rxElement, UNO_QUERY );
+ if ( !xFormatted.is() )
+ return;
+
+ impl_adjustFormatToDataFieldType_nothrow( xFormatted );
+ }
+
+ //--------------------------------------------------------------------
+ bool FormatNormalizer::impl_lateInit()
+ {
+ if ( m_xReportDefinition.is() )
+ return true;
+
+ m_xReportDefinition = m_rModel.getReportDefinition();
+ return m_xReportDefinition.is();
+ }
+
+ //--------------------------------------------------------------------
+ void FormatNormalizer::impl_onDefinitionPropertyChange( const ::rtl::OUString& _rChangedPropName )
+ {
+ if ( !_rChangedPropName.equalsAscii( "Command" )
+ && !_rChangedPropName.equalsAscii( "CommandType" )
+ && !_rChangedPropName.equalsAscii( "EscapeProcessing" )
+ )
+ // nothing we're interested in
+ return;
+ m_bFieldListDirty = true;
+ }
+
+ //--------------------------------------------------------------------
+ void FormatNormalizer::impl_onFormattedProperttyChange( const Reference< XFormattedField >& _rxFormatted, const ::rtl::OUString& _rChangedPropName )
+ {
+ if ( !_rChangedPropName.equalsAscii( "DataField" ) )
+ // nothing we're interested in
+ return;
+
+ impl_adjustFormatToDataFieldType_nothrow( _rxFormatted );
+ }
+
+ //--------------------------------------------------------------------
+ namespace
+ {
+ void lcl_collectFields_throw( const Reference< XIndexAccess >& _rxColumns, FormatNormalizer::FieldList& _inout_rFields )
+ {
+ try
+ {
+ sal_Int32 nCount( _rxColumns->getCount() );
+ _inout_rFields.reserve( _inout_rFields.size() + (size_t)nCount );
+
+ Reference< XPropertySet > xColumn;
+ FormatNormalizer::Field aField;
+
+ for ( sal_Int32 i=0; i<nCount; ++i )
+ {
+ xColumn.set( _rxColumns->getByIndex( i ), UNO_QUERY_THROW );
+ OSL_VERIFY( xColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= aField.sName );
+ OSL_VERIFY( xColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= aField.nDataType );
+ OSL_VERIFY( xColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Scale" ) ) ) >>= aField.nScale );
+ OSL_VERIFY( xColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCurrency" ) ) ) >>= aField.bIsCurrency );
+ _inout_rFields.push_back( aField );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------
+ bool FormatNormalizer::impl_ensureUpToDateFieldList_nothrow()
+ {
+ if ( !m_bFieldListDirty )
+ return true;
+ m_aFields.resize( 0 );
+
+ OSL_PRECOND( m_xReportDefinition.is(), "FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no report definition!" );
+ if ( !m_xReportDefinition.is() )
+ return false;
+
+ ::dbaui::OSingleDocumentController* pController( m_rModel.getController() );
+ OSL_ENSURE( pController, "FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no controller? how can *this* happen?!" );
+ if ( !pController )
+ return false;
+
+ try
+ {
+ ::dbtools::StatementComposer aComposer( pController->getConnection(), m_xReportDefinition->getCommand(),
+ m_xReportDefinition->getCommandType(), m_xReportDefinition->getEscapeProcessing() );
+
+ Reference< XSingleSelectQueryComposer > xComposer( aComposer.getComposer() );
+ if ( !xComposer.is() )
+ return false;
+
+
+ Reference< XColumnsSupplier > xSuppCols( xComposer, UNO_QUERY_THROW );
+ Reference< XIndexAccess > xColumns( xSuppCols->getColumns(), UNO_QUERY_THROW );
+ lcl_collectFields_throw( xColumns, m_aFields );
+
+ Reference< XParametersSupplier > xSuppParams( xComposer, UNO_QUERY_THROW );
+ Reference< XIndexAccess > xParams( xSuppParams->getParameters(), UNO_QUERY_THROW );
+ lcl_collectFields_throw( xParams, m_aFields );
+ }
+ catch( const SQLException& )
+ {
+ // silence it. This might happen for instance when the user sets an non-existent table,
+ // or things like this
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ m_bFieldListDirty = false;
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ void FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow( const Reference< XFormattedField >& _rxFormatted )
+ {
+ if ( !impl_ensureUpToDateFieldList_nothrow() )
+ // unable to obtain a recent field list
+ return;
+
+ try
+ {
+ sal_Int32 nFormatKey = _rxFormatted->getFormatKey();
+ if ( nFormatKey != 0 )
+ // it's not the "standard numeric" format -> not interested in
+ return;
+
+ ::rtl::OUString sDataField( _rxFormatted->getDataField() );
+ const ::rtl::OUString sFieldPrefix( RTL_CONSTASCII_USTRINGPARAM( "field:[" ) );
+ if ( sDataField.indexOf( sFieldPrefix ) != 0 )
+ // not bound to a table field
+ // TODO: we might also do this kind of thing for functions and expressions ...
+ return;
+ if ( sDataField.getStr()[ sDataField.getLength() - 1 ] != ']' )
+ {
+ // last character is not the closing brace
+ OSL_ENSURE( false, "FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow: suspicious data field value!" );
+ return;
+ }
+ sDataField = sDataField.copy( sFieldPrefix.getLength(), sDataField.getLength() - sFieldPrefix.getLength() - 1 );
+
+ FieldList::const_iterator field = m_aFields.begin();
+ for ( ; field != m_aFields.end(); ++field )
+ {
+ if ( field->sName == sDataField )
+ break;
+ }
+ if ( field == m_aFields.end() )
+ // unknown field
+ return;
+
+ Reference< XNumberFormatsSupplier > xSuppNumFmts( _rxFormatted->getFormatsSupplier(), UNO_QUERY_THROW );
+ Reference< XNumberFormatTypes > xNumFmtTypes( xSuppNumFmts->getNumberFormats(), UNO_QUERY_THROW );
+
+ nFormatKey = ::dbtools::getDefaultNumberFormat( field->nDataType, field->nScale, field->bIsCurrency, xNumFmtTypes,
+ SvtSysLocale().GetLocaleData().getLocale() );
+ _rxFormatted->setFormatKey( nFormatKey );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+//........................................................................
+} // namespace rptui
+//........................................................................
diff --git a/reportdesign/source/core/sdr/formatnormalizer.hxx b/reportdesign/source/core/sdr/formatnormalizer.hxx
new file mode 100644
index 000000000000..85907879a2b9
--- /dev/null
+++ b/reportdesign/source/core/sdr/formatnormalizer.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: formatnormalizer.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef REPORTDESIGN_FORMATNORMALIZER_HXX
+#define REPORTDESIGN_FORMATNORMALIZER_HXX
+
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+/** === end UNO includes === **/
+
+#include <boost/noncopyable.hpp>
+
+#include <vector>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ class OReportModel;
+ //====================================================================
+ //= FormatNormalizer
+ //====================================================================
+ class FormatNormalizer : public ::boost::noncopyable
+ {
+ public:
+ struct Field
+ {
+ ::rtl::OUString sName;
+ sal_Int32 nDataType;
+ sal_Int32 nScale;
+ sal_Bool bIsCurrency;
+
+ Field() : sName(), nDataType( 0 ), nScale( 0 ), bIsCurrency( 0 ) { }
+ };
+ typedef ::std::vector< Field > FieldList;
+
+ private:
+ const OReportModel& m_rModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition;
+
+ /// is our field list dirty?
+ FieldList m_aFields;
+ bool m_bFieldListDirty;
+
+ public:
+ FormatNormalizer( const OReportModel& _rModel );
+ ~FormatNormalizer();
+
+ void notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent );
+ void notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
+
+ private:
+ bool impl_lateInit();
+
+ void impl_onDefinitionPropertyChange( const ::rtl::OUString& _rChangedPropName );
+ void impl_onFormattedProperttyChange( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormattedField >& _rxFormatted, const ::rtl::OUString& _rChangedPropName );
+
+ bool impl_ensureUpToDateFieldList_nothrow();
+
+ void impl_adjustFormatToDataFieldType_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormattedField >& _rxFormatted );
+ };
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // REPORTDESIGN_FORMATNORMALIZER_HXX
diff --git a/reportdesign/source/core/sdr/makefile.mk b/reportdesign/source/core/sdr/makefile.mk
new file mode 100644
index 000000000000..c86a62eb7375
--- /dev/null
+++ b/reportdesign/source/core/sdr/makefile.mk
@@ -0,0 +1,60 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=core_sdr
+ENABLE_EXCEPTIONS=TRUE
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES= $(SLO)$/RptModel.obj \
+ $(SLO)$/RptPage.obj \
+ $(SLO)$/UndoActions.obj \
+ $(SLO)$/RptObject.obj \
+ $(SLO)$/RptObjectListener.obj \
+ $(SLO)$/ModuleHelper.obj \
+ $(SLO)$/PropertyForward.obj \
+ $(SLO)$/ReportDrawPage.obj \
+ $(SLO)$/ReportUndoFactory.obj \
+ $(SLO)$/formatnormalizer.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/reportdesign/source/filter/xml/dbloader2.cxx b/reportdesign/source/filter/xml/dbloader2.cxx
new file mode 100644
index 000000000000..afe665418c01
--- /dev/null
+++ b/reportdesign/source/filter/xml/dbloader2.cxx
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dbloader2.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:16 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTXML_DBLOADER2_HXX
+#include "dbloader2.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+// -------------------------------------------------------------------------
+namespace rptxml
+{
+
+using namespace ::ucbhelper;
+using namespace ::com::sun::star::task;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::registry;
+using namespace ::com::sun::star::embed;
+using namespace ::com::sun::star::ui::dialogs;
+using ::com::sun::star::awt::XWindow;
+
+// -------------------------------------------------------------------------
+ORptTypeDetection::ORptTypeDetection(Reference< XComponentContext > const & xContext)
+: m_xContext(xContext)
+{
+}
+// -------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ORptTypeDetection::detect( Sequence< ::com::sun::star::beans::PropertyValue >& Descriptor ) throw (RuntimeException)
+{
+
+ ::comphelper::SequenceAsHashMap aTemp(Descriptor);
+ ::rtl::OUString sTemp = aTemp.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")),::rtl::OUString());
+
+ if ( sTemp.getLength() )
+ {
+ INetURLObject aURL(sTemp);
+ if ( aURL.GetExtension().equalsIgnoreAsciiCaseAscii("orp") )
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBaseReport"));
+ else
+ {
+ try
+ {
+ Reference<XPropertySet> xProp(::comphelper::OStorageHelper::GetStorageFromURL(sTemp,ElementModes::READ,Reference< XMultiServiceFactory >(m_xContext->getServiceManager(),UNO_QUERY)),UNO_QUERY);
+ if ( xProp.is() )
+ {
+ ::rtl::OUString sMediaType;
+ xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= sMediaType;
+ if ( sMediaType.equalsAscii(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII) )
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBaseReport"));
+ ::comphelper::disposeComponent(xProp);
+ } // if ( xProp.is() )
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ return ::rtl::OUString();
+}
+// -------------------------------------------------------------------------
+Reference< XInterface > SAL_CALL
+ ORptTypeDetection::create(Reference< XComponentContext > const & xContext)
+{
+ return *(new ORptTypeDetection(xContext));
+}
+// -------------------------------------------------------------------------
+// XServiceInfo
+::rtl::OUString SAL_CALL ORptTypeDetection::getImplementationName() throw( )
+{
+ return getImplementationName_Static();
+}
+// -------------------------------------------------------------------------
+
+// XServiceInfo
+sal_Bool SAL_CALL ORptTypeDetection::supportsService(const ::rtl::OUString& ServiceName) throw( )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -------------------------------------------------------------------------
+// XServiceInfo
+Sequence< ::rtl::OUString > SAL_CALL ORptTypeDetection::getSupportedServiceNames(void) throw( )
+{
+ return getSupportedServiceNames_Static();
+}
+// -------------------------------------------------------------------------
+// ORegistryServiceManager_Static
+Sequence< ::rtl::OUString > ORptTypeDetection::getSupportedServiceNames_Static(void) throw( RuntimeException )
+{
+ Sequence< ::rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExtendedTypeDetection");
+ return aSNS;
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+}//rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/dbloader2.hxx b/reportdesign/source/filter/xml/dbloader2.hxx
new file mode 100644
index 000000000000..ec9289f60c21
--- /dev/null
+++ b/reportdesign/source/filter/xml/dbloader2.hxx
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dbloader2.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTXML_DBLOADER2_HXX
+#define RPTXML_DBLOADER2_HXX
+
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef _URLOBJ_HXX //autogen
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
+#include <toolkit/awt/vclxwindow.hxx>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADER_HPP_
+#include <com/sun/star/frame/XFrameLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTLISTENER_HPP_
+#include <com/sun/star/document/XEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XLOADEVENTLISTENER_HPP_
+#include <com/sun/star/frame/XLoadEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_XSTORAGE_HPP_
+#include <com/sun/star/embed/XStorage.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
+#include <com/sun/star/embed/ElementModes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
+#include <com/sun/star/container/XSet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
+#include <com/sun/star/document/XFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
+#include <com/sun/star/util/XURLTransformer.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXTENDEDFILTERDETECTION_HPP_
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENT_HXX
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _UCBHELPER_COMMANDENVIRONMENT_HXX
+#include <ucbhelper/commandenvironment.hxx>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _COMPHELPER_DOCUMENTCONSTANTS_HXX
+#include <comphelper/documentconstants.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_
+#include <comphelper/sequenceashashmap.hxx>
+#endif
+#ifndef _OSL_FILE_HXX_
+#include <osl/file.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENTBROKER_HXX
+#include <ucbhelper/contentbroker.hxx>
+#endif
+#ifndef _SFXDOCFILE_HXX //autogen wg. SfxMedium
+#include <sfx2/docfile.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+#include <svtools/moduleoptions.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_STORAGEHELPER_HXX
+#include <comphelper/storagehelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_
+#include <com/sun/star/task/XJobExecutor.hpp>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+
+// -------------------------------------------------------------------------
+namespace rptxml
+{
+
+ class ORptTypeDetection : public ::cppu::WeakImplHelper2< ::com::sun::star::document::XExtendedFilterDetection, ::com::sun::star::lang::XServiceInfo>
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+public:
+ ORptTypeDetection(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName() throw( );
+ sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( );
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( );
+
+ // static methods
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException )
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.ORptTypeDetection");
+ }
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+
+ virtual ::rtl::OUString SAL_CALL detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Descriptor ) throw (::com::sun::star::uno::RuntimeException);
+};
+}
+#endif
diff --git a/reportdesign/source/filter/xml/makefile.mk b/reportdesign/source/filter/xml/makefile.mk
new file mode 100644
index 000000000000..2b4054d6bc9f
--- /dev/null
+++ b/reportdesign/source/filter/xml/makefile.mk
@@ -0,0 +1,99 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=rptxml
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+
+# --- Types -------------------------------------
+
+UNOTYPES=\
+ com.sun.star.uno.RuntimeException \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XInterface \
+ com.sun.star.uno.XWeak \
+ com.sun.star.registry.XRegistryKey \
+ com.sun.star.io.XInputStream \
+ com.sun.star.io.XOutputStream \
+ com.sun.star.lang.XComponent \
+ com.sun.star.lang.XInitialization \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.lang.XServiceInfo \
+ com.sun.star.loader.XImplementationLoader \
+ com.sun.star.registry.XImplementationRegistration \
+ com.sun.star.registry.XSimpleRegistry \
+ com.sun.star.document.XFilter \
+ com.sun.star.document.XExporter \
+ com.sun.star.container.XIndexAccess
+# --- Files -------------------------------------
+
+SLOFILES= $(SLO)$/xmlfilter.obj \
+ $(SLO)$/xmlReport.obj \
+ $(SLO)$/xmlSubDocument.obj \
+ $(SLO)$/xmlMasterFields.obj \
+ $(SLO)$/xmlGroup.obj \
+ $(SLO)$/xmlHelper.obj \
+ $(SLO)$/xmlSection.obj \
+ $(SLO)$/xmlComponent.obj \
+ $(SLO)$/xmlControlProperty.obj \
+ $(SLO)$/xmlFormattedField.obj \
+ $(SLO)$/xmlFixedText.obj \
+ $(SLO)$/xmlReportElement.obj \
+ $(SLO)$/xmlReportElementBase.obj \
+ $(SLO)$/xmlCondPrtExpr.obj \
+ $(SLO)$/xmlImage.obj \
+ $(SLO)$/xmlFunction.obj \
+ $(SLO)$/xmlStyleImport.obj \
+ $(SLO)$/xmlAutoStyle.obj \
+ $(SLO)$/xmlExport.obj \
+ $(SLO)$/dbloader2.obj \
+ $(SLO)$/xmlFormatCondition.obj \
+ $(SLO)$/xmlPropertyHandler.obj \
+ $(SLO)$/xmlColumn.obj \
+ $(SLO)$/xmlCell.obj \
+ $(SLO)$/xmlTable.obj \
+ $(SLO)$/xmlFixedContent.obj \
+ $(SLO)$/xmlservices.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.cxx b/reportdesign/source/filter/xml/xmlAutoStyle.cxx
new file mode 100644
index 000000000000..984c79280af1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlAutoStyle.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlAutoStyle.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLAUTOSTYLE_HXX
+#include "xmlAutoStyle.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLEXPORT_HXX
+#include "xmlExport.hxx"
+#endif
+#ifndef _XMLOFF_FAMILIES_HXX_
+#include <xmloff/families.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+
+void OXMLAutoStylePoolP::exportStyleAttributes(
+ SvXMLAttributeList& rAttrList,
+ sal_Int32 nFamily,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLExportPropertyMapper& rPropExp
+ , const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap
+ ) const
+{
+ SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
+ if ( nFamily == XML_STYLE_FAMILY_TABLE_CELL )
+ {
+ UniReference< XMLPropertySetMapper > aPropMapper = rORptExport.GetCellStylePropertyMapper();
+ ::std::vector< XMLPropertyState >::const_iterator i = rProperties.begin();
+ ::std::vector< XMLPropertyState >::const_iterator aEnd = rProperties.end();
+ for (; i != aEnd ; ++i)
+ {
+ sal_Int16 nContextID = aPropMapper->GetEntryContextId(i->mnIndex);
+ switch (nContextID)
+ {
+ case CTF_RPT_NUMBERFORMAT :
+ {
+ rtl::OUString sAttrValue;
+ if ( i->maValue >>= sAttrValue )
+ {
+ if ( sAttrValue.getLength() )
+ {
+ rORptExport.AddAttribute(
+ aPropMapper->GetEntryNameSpace(i->mnIndex),
+ aPropMapper->GetEntryXMLName(i->mnIndex),
+ sAttrValue );
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+}
+DBG_NAME( rpt_OXMLAutoStylePoolP )
+// -----------------------------------------------------------------------------
+OXMLAutoStylePoolP::OXMLAutoStylePoolP(ORptExport& rTempORptExport):
+ SvXMLAutoStylePoolP(rTempORptExport),
+ rORptExport(rTempORptExport)
+{
+ DBG_CTOR( rpt_OXMLAutoStylePoolP,NULL);
+
+}
+// -----------------------------------------------------------------------------
+OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
+{
+
+ DBG_DTOR( rpt_OXMLAutoStylePoolP,NULL);
+}
+// -----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlAutoStyle.hxx b/reportdesign/source/filter/xml/xmlAutoStyle.hxx
new file mode 100644
index 000000000000..5de31999d8d0
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlAutoStyle.hxx
@@ -0,0 +1,76 @@
+#ifndef RPT_XMLAUTOSTYLE_HXX
+#define RPT_XMLAUTOSTYLE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlAutoStyle.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _XMLOFF_PROPMAPPINGTYPES_HXX
+#include <xmloff/maptype.hxx>
+#endif
+#ifndef _XMLOFF_XMLASTPLP_HXX
+#include <xmloff/xmlaustp.hxx>
+#endif
+#ifndef _XMLOFF_XMLTYPES_HXX
+#include <xmloff/xmltypes.hxx>
+#endif
+#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
+#include <xmloff/xmlprmap.hxx>
+#endif
+
+namespace rptxml
+{
+ class ORptExport;
+ class OXMLAutoStylePoolP : public SvXMLAutoStylePoolP
+ {
+ ORptExport& rORptExport;
+
+ virtual void exportStyleAttributes(
+ SvXMLAttributeList& rAttrList,
+ sal_Int32 nFamily,
+ const ::std::vector< XMLPropertyState >& rProperties,
+ const SvXMLExportPropertyMapper& rPropExp,
+ const SvXMLUnitConverter& rUnitConverter,
+ const SvXMLNamespaceMap& rNamespaceMap
+ ) const;
+
+ OXMLAutoStylePoolP(const OXMLAutoStylePoolP&);
+ void operator =(const OXMLAutoStylePoolP&);
+ public:
+ OXMLAutoStylePoolP(ORptExport& rXMLExport);
+ virtual ~OXMLAutoStylePoolP();
+ };
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLAUTOSTYLE_HXX
+
diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx
new file mode 100644
index 000000000000..9eed081a3dce
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -0,0 +1,327 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlCell.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCELL_HXX
+#include "xmlCell.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+#ifndef RPT_XMLFIXEDTEXT_HXX
+#include "xmlFixedText.hxx"
+#endif
+#ifndef RPT_XMLFORMATTEDFIELD_HXX
+#include "xmlFormattedField.hxx"
+#endif
+#ifndef RPT_XMLIMAGE_HXX
+#include "xmlImage.hxx"
+#endif
+#ifndef RPT_XMLSUBDOCUMENT_HXX
+#include "xmlSubDocument.hxx"
+#endif
+#ifndef RPT_XMLFIXEDCONTENT_HXX
+#include "xmlFixedContent.hxx"
+#endif
+
+namespace rptxml
+{
+ using namespace ::comphelper;
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace uno;
+ using namespace beans;
+ using namespace xml::sax;
+
+DBG_NAME( rpt_OXMLCell )
+
+OXMLCell::OXMLCell( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,OXMLTable* _pContainer
+ ,OXMLCell* _pCell) :
+ SvXMLImportContext( rImport, nPrfx, _sLocalName )
+ ,m_pContainer(_pContainer)
+ ,m_pCell(_pCell)
+ ,m_bShape(false)
+{
+ DBG_CTOR( rpt_OXMLCell,NULL);
+ if ( !m_pCell )
+ m_pCell = this;
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetColumnTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_COLUMN_STYLE_NAME:
+ m_sStyleName = sValue;
+ break;
+ case XML_TOK_NUMBER_COLUMNS_SPANNED:
+ m_pContainer->setColumnSpanned(sValue.toInt32());
+ break;
+ case XML_TOK_NUMBER_ROWS_SPANNED:
+ m_pContainer->setRowSpanned(sValue.toInt32());
+ break;
+ default:
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+OXMLCell::~OXMLCell()
+{
+ DBG_DTOR( rpt_OXMLCell,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLCell::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetCellElemTokenMap();
+ Reference<XMultiServiceFactory> xFactor(rImport.GetModel(),uno::UNO_QUERY);
+ static const ::rtl::OUString s_sStringConcat(RTL_CONSTASCII_USTRINGPARAM(" & "));
+
+ sal_uInt16 nToken = rTokenMap.Get( _nPrefix, _rLocalName );
+ switch( nToken )
+ {
+ case XML_TOK_FIXED_CONTENT:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLFixedContent( rImport, _nPrefix, _rLocalName,*m_pCell,m_pContainer);
+ }
+ break;
+ case XML_TOK_PAGE_NUMBER:
+ m_sText += s_sStringConcat + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PageNumber()"));
+ break;
+ case XML_TOK_PAGE_COUNT:
+ m_sText += s_sStringConcat + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PageCount()"));
+ break;
+ case XML_TOK_FORMATTED_TEXT:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ uno::Reference< uno::XInterface> xInt = xFactor->createInstance(SERVICE_FORMATTEDFIELD);
+ Reference< report::XFormattedField > xControl(xInt,uno::UNO_QUERY);
+
+ OSL_ENSURE(xControl.is(),"Could not create FormattedField!");
+ setComponent(xControl.get());
+ if ( xControl.is() )
+ pContext = new OXMLFormattedField( rImport, _nPrefix, _rLocalName,xAttrList,xControl.get(),m_pContainer,XML_TOK_PAGE_COUNT == nToken);
+ }
+ break;
+ case XML_TOK_IMAGE:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ Reference< XImageControl > xControl(xFactor->createInstance(SERVICE_IMAGECONTROL),uno::UNO_QUERY);
+
+ OSL_ENSURE(xControl.is(),"Could not create ImageControl!");
+ setComponent(xControl.get());
+ if ( xControl.is() )
+ pContext = new OXMLImage( rImport, _nPrefix, _rLocalName,xAttrList,xControl.get(),m_pContainer);
+ }
+ break;
+ case XML_TOK_SUB_DOCUMENT:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ Reference< XReportDefinition > xControl(xFactor->createInstance(SERVICE_REPORTDEFINITION),uno::UNO_QUERY);
+
+ OSL_ENSURE(xControl.is(),"Could not create ReportDefinition!");
+ setComponent(xControl.get());
+ if ( xControl.is() )
+ pContext = new OXMLSubDocument( rImport, _nPrefix, _rLocalName,xControl.get(),m_pContainer);
+ }
+ break;
+
+ case XML_TOK_P:
+ pContext = new OXMLCell( rImport, _nPrefix, _rLocalName,xAttrList ,m_pContainer,this);
+ break;
+ case XML_TOK_CUSTOM_SHAPE:
+ {
+ UniReference< XMLShapeImportHelper > xShapeImportHelper = rImport.GetShapeImport();
+ uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection().get();
+ pContext = xShapeImportHelper->CreateGroupChildContext(rImport,_nPrefix,_rLocalName,xAttrList,xShapes);
+ m_bShape = true;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if ( m_xComponent.is() )
+ m_pContainer->addCell(m_xComponent);
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLCell::EndElement()
+{
+ if ( m_bShape )
+ {
+ m_xComponent.set(m_pContainer->getSection()->getByIndex(m_pContainer->getSection()->getCount()-1),uno::UNO_QUERY);
+ m_pContainer->addCell(m_xComponent);
+ m_pCell->setComponent(m_xComponent);
+ }
+ else if ( m_pCell != this && m_sText.getLength() )
+ {
+ ORptFilter& rImport = GetOwnImport();
+ Reference<XMultiServiceFactory> xFactor(rImport.GetModel(),uno::UNO_QUERY);
+ uno::Reference< uno::XInterface> xInt = xFactor->createInstance(SERVICE_FORMATTEDFIELD);
+ Reference< report::XFormattedField > xControl(xInt,uno::UNO_QUERY);
+ xControl->setDataField(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + m_sText);
+
+ OSL_ENSURE(xControl.is(),"Could not create FormattedField!");
+ setComponent(xControl.get());
+ m_xComponent = xControl.get();
+ m_pContainer->getSection()->add(m_xComponent.get());
+ m_pContainer->addCell(m_xComponent);
+ }
+ // check if we have a FixedLine
+ else if ( m_sStyleName.getLength() && !m_xComponent.is() && m_pCell == this )
+ {
+ ORptFilter& rImport = GetOwnImport();
+ Reference<XMultiServiceFactory> xFactor(rImport.GetModel(),uno::UNO_QUERY);
+ Reference<XFixedLine> xFixedLine(xFactor->createInstance(SERVICE_FIXEDLINE),uno::UNO_QUERY);
+ m_xComponent = xFixedLine.get();
+ m_pContainer->getSection()->add(m_xComponent.get());
+ m_pContainer->addCell(m_xComponent);
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,GetImport().GetAutoStyles()->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,m_sStyleName));
+ if ( pAutoStyle )
+ {
+ uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet();
+ try
+ {
+ pAutoStyle->FillPropertySet(xBorderProp);
+ table::BorderLine aRight,aLeft;
+ xBorderProp->getPropertyValue(PROPERTY_BORDERRIGHT) >>= aRight;
+ xBorderProp->getPropertyValue(PROPERTY_BORDERLEFT) >>= aLeft;
+ xFixedLine->setOrientation( (aRight.OuterLineWidth != 0 || aLeft.OuterLineWidth != 0) ? 1 : 0);
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"OXMLCell::EndElement -> exception catched");
+ }
+ }
+ }
+ else
+ OXMLHelper::copyStyleElements(m_sStyleName,GetImport().GetAutoStyles(),m_xComponent.get());
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLCell::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLCell::setComponent(const uno::Reference< report::XReportComponent >& _xComponent)
+{
+ m_pCell->m_xComponent = _xComponent;
+ m_xComponent = _xComponent;
+}
+// -----------------------------------------------------------------------------
+void OXMLCell::Characters( const ::rtl::OUString& rChars )
+{
+ if ( rChars.getLength() )
+ {
+ static const ::rtl::OUString s_Quote(RTL_CONSTASCII_USTRINGPARAM("\""));
+ if ( m_sText.getLength() )
+ {
+ static const ::rtl::OUString s_sStringConcat(RTL_CONSTASCII_USTRINGPARAM(" & "));
+ m_sText += s_sStringConcat;
+ }
+
+ m_sText += s_Quote + rChars + s_Quote;
+ }
+}
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlCell.hxx b/reportdesign/source/filter/xml/xmlCell.hxx
new file mode 100644
index 000000000000..6e7d929386c7
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCell.hxx
@@ -0,0 +1,84 @@
+#ifndef RPT_XMLCELL_HXX
+#define RPT_XMLCELL_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlCell.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable;
+ class OXMLCell : public SvXMLImportContext
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > m_xComponent;
+ OXMLTable* m_pContainer;
+ OXMLCell* m_pCell;
+ ::rtl::OUString m_sStyleName;
+ ::rtl::OUString m_sText;
+ bool m_bShape;
+
+ ORptFilter& GetOwnImport();
+ OXMLCell(const OXMLCell&);
+ void operator =(const OXMLCell&);
+ public:
+
+ OXMLCell( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
+ ,OXMLTable* _pContainer
+ ,OXMLCell* _pCell = NULL);
+ virtual ~OXMLCell();
+
+ 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 );
+ virtual void EndElement();
+
+ void setComponent(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent);
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCELL_HXX
diff --git a/reportdesign/source/filter/xml/xmlColumn.cxx b/reportdesign/source/filter/xml/xmlColumn.cxx
new file mode 100644
index 000000000000..a0d934c72e20
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlColumn.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCELL_HXX
+#include "xmlCell.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+
+#define PROPERTY_ID_WIDTH 1
+#define PROPERTY_ID_HEIGHT 2
+
+namespace rptxml
+{
+ using namespace ::comphelper;
+ using namespace ::rtl;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::xml::sax;
+
+DBG_NAME( rpt_OXMLRowColumn )
+
+OXMLRowColumn::OXMLRowColumn( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,OXMLTable* _pContainer
+ ) :
+ SvXMLImportContext( rImport, nPrfx, _sLocalName )
+ ,m_pContainer(_pContainer)
+{
+ DBG_CTOR( rpt_OXMLRowColumn,NULL);
+
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetColumnTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_COLUMN_STYLE_NAME:
+ fillStyle(sValue);
+ break;
+ default:
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLRowColumn::~OXMLRowColumn()
+{
+ DBG_DTOR( rpt_OXMLRowColumn,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLRowColumn::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetColumnTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_COLUMN:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRowColumn( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_ROW:
+ m_pContainer->incrementRowIndex();
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRowColumn( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_CELL:
+ m_pContainer->incrementColumnIndex();
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLCell( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_COV_CELL:
+ m_pContainer->incrementColumnIndex();
+ m_pContainer->addCell(NULL);
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLRowColumn::fillStyle(const ::rtl::OUString& _sStyleName)
+{
+ if ( _sStyleName.getLength() )
+ {
+ const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles();
+ if ( pAutoStyles )
+ {
+ PropertySetInfo* pInfo = new PropertySetInfo();
+ static PropertyMapEntry pMap[] =
+ {
+ {PROPERTY_WIDTH, static_cast<sal_uInt16>(PROPERTY_WIDTH.length), PROPERTY_ID_WIDTH, &::getCppuType(static_cast< sal_Int32* >( NULL )) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_HEIGHT, static_cast<sal_uInt16>(PROPERTY_HEIGHT.length), PROPERTY_ID_HEIGHT, &::getCppuType(static_cast< sal_Int32* >( NULL )) ,PropertyAttribute::BOUND,0},
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ pInfo->add(pMap);
+ Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,_sStyleName));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nWidth = 0;
+ xProp->getPropertyValue(PROPERTY_WIDTH) >>= nWidth;
+ m_pContainer->addWidth(nWidth);
+ }
+ else
+ {
+ pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,_sStyleName));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nHeight = 0;
+ xProp->getPropertyValue(PROPERTY_HEIGHT) >>= nHeight;
+ m_pContainer->addHeight(nHeight);
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLRowColumn::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLRowColumn::EndElement()
+{
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlColumn.hxx b/reportdesign/source/filter/xml/xmlColumn.hxx
new file mode 100644
index 000000000000..4d2f6a0c44c9
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlColumn.hxx
@@ -0,0 +1,74 @@
+#ifndef RPT_XMLCOLUMN_HXX
+#define RPT_XMLCOLUMN_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlColumn.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable;
+ class OXMLRowColumn : public SvXMLImportContext
+ {
+ OXMLTable* m_pContainer;
+
+ ORptFilter& GetOwnImport();
+
+ void fillStyle(const ::rtl::OUString& _sStyleName);
+ OXMLRowColumn(const OXMLRowColumn&);
+ void operator =(const OXMLRowColumn&);
+ public:
+
+ OXMLRowColumn( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
+ ,OXMLTable* _pContainer
+ );
+ virtual ~OXMLRowColumn();
+
+ 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();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCOLUMN_HXX
diff --git a/reportdesign/source/filter/xml/xmlComponent.cxx b/reportdesign/source/filter/xml/xmlComponent.cxx
new file mode 100644
index 000000000000..82c68faf1725
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlComponent.cxx
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlComponent.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCOMPONENT_HXX
+#include "xmlComponent.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef _UCBHELPER_CONTENT_HXX
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLMODEL_HPP_
+#include <com/sun/star/report/XReportControlModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::comphelper;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::xml::sax;
+ DBG_NAME( rpt_OXMLComponent )
+OXMLComponent::OXMLComponent( ORptFilter& _rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XReportComponent > & _xComponent
+ ) :
+ SvXMLImportContext( _rImport, nPrfx, _sLocalName )
+ ,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLComponent,NULL);
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+
+ const SvXMLNamespaceMap& rMap = _rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = _rImport.GetComponentElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ try
+ {
+ ::rtl::OUString sLocalName;
+ const ::rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ ::rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_NAME:
+ m_xComponent->setName(sValue);
+ break;
+ case XML_TOK_TEXT_STYLE_NAME:
+ m_sTextStyleName = sValue;
+ break;
+ case XML_TOK_TRANSFORM:
+ break;
+ default:
+ break;
+ }
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while putting props into report component!");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLComponent::~OXMLComponent()
+{
+ DBG_DTOR( rpt_OXMLComponent,NULL);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLComponent::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlComponent.hxx b/reportdesign/source/filter/xml/xmlComponent.hxx
new file mode 100644
index 000000000000..dacbe84523ea
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlComponent.hxx
@@ -0,0 +1,76 @@
+#ifndef RPT_XMLCOMPONENT_HXX
+#define RPT_XMLCOMPONENT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlComponent.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLComponent : public SvXMLImportContext
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > m_xComponent;
+ ::rtl::OUString m_sName;
+ ::rtl::OUString m_sTextStyleName;
+
+ ORptFilter& GetOwnImport();
+
+ OXMLComponent(const OXMLComponent&);
+ void operator =(const OXMLComponent&);
+ public:
+
+ OXMLComponent( ORptFilter& rImport
+ , sal_uInt16 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::report::XReportComponent >& _xComponent
+ );
+ virtual ~OXMLComponent();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCOMPONENT_HXX
diff --git a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
new file mode 100644
index 000000000000..c4ff4df81415
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlCondPrtExpr.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCONDPRTEXPR_HXX
+#include "xmlCondPrtExpr.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#include "xmlControlProperty.hxx"
+#endif
+#ifndef RPT_XMLCOMPONENT_HXX
+#include "xmlComponent.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace report;
+ using namespace uno;
+ using namespace xml::sax;
+DBG_NAME( rpt_OXMLCondPrtExpr )
+
+OXMLCondPrtExpr::OXMLCondPrtExpr( ORptFilter& _rImport,
+ sal_uInt16 nPrfx
+ ,const OUString& rLName
+ ,const uno::Reference< xml::sax::XAttributeList > & _xAttrList
+ ,const Reference< XPropertySet > & _xComponent ) :
+ SvXMLImportContext( _rImport, nPrfx, rLName )
+,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLCondPrtExpr,NULL);
+
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+ const SvXMLNamespaceMap& rMap = _rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = _rImport.GetFunctionElemTokenMap();
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ const rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_FUNCTION_FORMULA:
+ m_xComponent->setPropertyValue(PROPERTY_CONDITIONALPRINTEXPRESSION,uno::makeAny(ORptFilter::convertFormula(sValue)));
+ break;
+ default:
+ break;
+ }
+
+ }
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while putting Function props!");
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLCondPrtExpr::~OXMLCondPrtExpr()
+{
+
+ DBG_DTOR( rpt_OXMLCondPrtExpr,NULL);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+void OXMLCondPrtExpr::Characters( const ::rtl::OUString& rChars )
+{
+ m_xComponent->setPropertyValue(PROPERTY_CONDITIONALPRINTEXPRESSION,makeAny(rChars));
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlCondPrtExpr.hxx b/reportdesign/source/filter/xml/xmlCondPrtExpr.hxx
new file mode 100644
index 000000000000..b0163b53d3b1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.hxx
@@ -0,0 +1,70 @@
+#ifndef RPT_XMLCONDPRTEXPR_HXX
+#define RPT_XMLCONDPRTEXPR_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlCondPrtExpr.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLCondPrtExpr : public SvXMLImportContext
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xComponent;
+ OXMLCondPrtExpr(const OXMLCondPrtExpr&);
+ void operator =(const OXMLCondPrtExpr&);
+ public:
+
+ OXMLCondPrtExpr( ORptFilter& _rImport
+ ,sal_uInt16 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::beans::XPropertySet >& _xComponent);
+ virtual ~OXMLCondPrtExpr();
+
+ // This method is called for all characters that are contained in the
+ // current element. The default is to ignore them.
+ virtual void Characters( const ::rtl::OUString& rChars );
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCONDPRTEXPR_HXX
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx
new file mode 100644
index 000000000000..aae7ea764f82
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -0,0 +1,392 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlControlProperty.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#include "xmlControlProperty.hxx"
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _DATETIME_HXX
+#include <tools/datetime.hxx>
+#endif
+#ifndef _UNOTOOLS_DATETIME_HXX_
+#include <unotools/datetime.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
+#include <com/sun/star/util/DateTime.hpp>
+#endif
+
+#define TYPE_DATE 1
+#define TYPE_TIME 2
+#define TYPE_DATETIME 3
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::xml::sax;
+
+DBG_NAME( rpt_OXMLControlProperty )
+
+OXMLControlProperty::OXMLControlProperty( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XPropertySet >& _xControl
+ ,OXMLControlProperty* _pContainer) :
+ SvXMLImportContext( rImport, nPrfx, _sLocalName )
+ ,m_xControl(_xControl)
+ ,m_pContainer(_pContainer)
+ ,m_bIsList(sal_False)
+{
+ DBG_CTOR( rpt_OXMLControlProperty,NULL);
+
+ m_aPropType = ::getVoidCppuType();
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+ OSL_ENSURE(m_xControl.is(),"Control is NULL!");
+
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetControlPropertyElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_LIST_PROPERTY:
+ m_bIsList = sValue.equalsAscii("true");
+ break;
+ case XML_TOK_VALUE_TYPE:
+ {
+ // 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[GetXMLToken( XML_BOOLEAN)] = ::getBooleanCppuType();
+ s_aTypeNameMap[GetXMLToken( XML_FLOAT)] = ::getCppuType( static_cast< double* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_DOUBLE)] = ::getCppuType( static_cast< double* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_STRING)] = ::getCppuType( static_cast< ::rtl::OUString* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_INT)] = ::getCppuType( static_cast< sal_Int32* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_SHORT)] = ::getCppuType( static_cast< sal_Int16* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_DATE)] = ::getCppuType( static_cast< com::sun::star::util::Date* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_TIME)] = ::getCppuType( static_cast< com::sun::star::util::Time* >(NULL) );
+ s_aTypeNameMap[GetXMLToken( XML_VOID)] = ::getVoidCppuType();
+ }
+
+ const ConstMapString2TypeIterator aTypePos = s_aTypeNameMap.find(sValue);
+ OSL_ENSURE(s_aTypeNameMap.end() != aTypePos, "OXMLControlProperty::OXMLControlProperty: invalid type!");
+ if (s_aTypeNameMap.end() != aTypePos)
+ m_aPropType = aTypePos->second;
+ }
+ break;
+ case XML_TOK_PROPERTY_NAME:
+ m_aSetting.Name = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+
+}
+// -----------------------------------------------------------------------------
+
+OXMLControlProperty::~OXMLControlProperty()
+{
+ DBG_DTOR( rpt_OXMLControlProperty,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLControlProperty::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetControlPropertyElemTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_LIST_PROPERTY:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLControlProperty( rImport, nPrefix, rLocalName,xAttrList,m_xControl);
+ break;
+ case XML_TOK_VALUE:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLControlProperty( rImport, nPrefix, rLocalName,xAttrList,m_xControl,this );
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLControlProperty::EndElement()
+{
+ if ( m_aSetting.Name.getLength() && m_xControl.is() )
+ {
+ if ( m_bIsList && !m_aSequence.getLength() )
+ m_aSetting.Value <<= m_aSequence;
+ try
+ {
+ m_xControl->setPropertyValue(m_aSetting.Name,m_aSetting.Value);
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(0,"Unknown property found!");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLControlProperty::Characters( const ::rtl::OUString& rChars )
+{
+ if ( m_pContainer )
+ m_pContainer->addValue(rChars);
+}
+// -----------------------------------------------------------------------------
+void OXMLControlProperty::addValue(const ::rtl::OUString& _sValue)
+{
+ Any aValue;
+ if( TypeClass_VOID != m_aPropType.getTypeClass() )
+ aValue = convertString(m_aPropType, _sValue);
+
+ if ( !m_bIsList )
+ m_aSetting.Value = aValue;
+ else
+ {
+ sal_Int32 nPos = m_aSequence.getLength();
+ m_aSequence.realloc(nPos+1);
+ m_aSequence[nPos] = aValue;
+ }
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLControlProperty::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters)
+{
+ ORptFilter& rImporter = GetOwnImport();
+ Any aReturn;
+ 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("OXMLControlProperty::convertString: could not convert \"")
+ += ::rtl::OString(_rReadCharacters.getStr(), _rReadCharacters.getLength(), RTL_TEXTENCODING_ASCII_US)
+ += ::rtl::OString("\" into a boolean!"));
+ aReturn <<= bValue;
+ }
+ break;
+ case TypeClass_SHORT: // sal_Int16
+ case TypeClass_LONG: // sal_Int32
+ { // 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("OXMLControlProperty::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;
+ }
+ case TypeClass_HYPER:
+ {
+ OSL_ENSURE(sal_False, "OXMLControlProperty::convertString: 64-bit integers not implemented yet!");
+ }
+ break;
+ case TypeClass_DOUBLE:
+ {
+ double nValue = 0.0;
+ #if OSL_DEBUG_LEVEL > 0
+ sal_Bool bSuccess =
+ #endif
+ rImporter.GetMM100UnitConverter().convertDouble(nValue, _rReadCharacters);
+ OSL_ENSURE(bSuccess,
+ ::rtl::OString("OXMLControlProperty::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;
+ else if ( _rExpectedType.equals(s_aTimeType) )
+ nType = TYPE_TIME;
+ else if ( _rExpectedType.equals(s_aDateTimeType) )
+ nType = TYPE_DATETIME;
+ if ( !nType )
+ {
+ // 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;
+ default:
+ break;
+ }
+ }
+ else
+ OSL_ENSURE(sal_False, "OPropertyImport::convertString: unsupported property type!");
+ }
+ break;
+ default:
+ OSL_ENSURE(sal_False, "OXMLControlProperty::convertString: invalid type class!");
+ }
+
+ return aReturn;
+}
+//---------------------------------------------------------------------
+::com::sun::star::util::Time OXMLControlProperty::implGetTime(double _nValue)
+{
+ ::com::sun::star::util::Time aTime;
+ sal_uInt32 nIntValue = sal_Int32(_nValue * 8640000);
+ nIntValue *= 8640000;
+ aTime.HundredthSeconds = (sal_uInt16)( nIntValue % 100 );
+ nIntValue /= 100;
+ aTime.Seconds = (sal_uInt16)( nIntValue % 60 );
+ nIntValue /= 60;
+ aTime.Minutes = (sal_uInt16)( nIntValue % 60 );
+ nIntValue /= 60;
+ OSL_ENSURE(nIntValue < 24, "OPropertyImport::implGetTime: more than a day?");
+ aTime.Hours = static_cast< sal_uInt16 >( nIntValue );
+
+ return aTime;
+}
+
+//---------------------------------------------------------------------
+::com::sun::star::util::Date OXMLControlProperty::implGetDate(double _nValue)
+{
+ Date aToolsDate((sal_uInt32)_nValue);
+ ::com::sun::star::util::Date aDate;
+ ::utl::typeConvert(aToolsDate, aDate);
+ return aDate;
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.hxx b/reportdesign/source/filter/xml/xmlControlProperty.hxx
new file mode 100644
index 000000000000..9dcdbbf01e25
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlControlProperty.hxx
@@ -0,0 +1,106 @@
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#define RPT_XMLCONTROLPROPERTY_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlControlProperty.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_DATE_HPP_
+#include <com/sun/star/util/Date.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_TIME_HPP_
+#include <com/sun/star/util/Time.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLControlProperty : public SvXMLImportContext
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControl;
+ ::com::sun::star::beans::PropertyValue m_aSetting;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aSequence;
+ OXMLControlProperty* m_pContainer;
+ ::com::sun::star::uno::Type m_aPropType; // the type of the property the instance imports currently
+ sal_Bool m_bIsList;
+
+ ORptFilter& GetOwnImport();
+ ::com::sun::star::uno::Any convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters);
+ OXMLControlProperty(const OXMLControlProperty&);
+ void operator =(const OXMLControlProperty&);
+ public:
+
+ OXMLControlProperty( ORptFilter& rImport
+ ,sal_uInt16 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::beans::XPropertySet >& _xControl
+ ,OXMLControlProperty* _pContainer = NULL);
+ virtual ~OXMLControlProperty();
+
+ 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 void Characters( const ::rtl::OUString& rChars );
+
+
+ /** adds value to property
+ @param _sValue
+ The value to add.
+ */
+ void addValue(const ::rtl::OUString& _sValue);
+
+ private:
+ static ::com::sun::star::util::Time implGetTime(double _nValue);
+ static ::com::sun::star::util::Date implGetDate(double _nValue);
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCONTROLPROPERTY_HXX
diff --git a/reportdesign/source/filter/xml/xmlEnums.hxx b/reportdesign/source/filter/xml/xmlEnums.hxx
new file mode 100644
index 000000000000..8e0a6dfbce3f
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlEnums.hxx
@@ -0,0 +1,183 @@
+#ifndef RPT_XMLENUMS_HXX
+#define RPT_XMLENUMS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlEnums.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#define PROGRESS_BAR_STEP 20
+
+namespace rptxml
+{
+ enum XMLDocTokens
+ {
+ XML_TOK_DOC_AUTOSTYLES,
+ XML_TOK_DOC_SETTINGS,
+ XML_TOK_DOC_REPORT,
+ XML_TOK_DOC_STYLES,
+ XML_TOK_DOC_FONTDECLS,
+ XML_TOK_DOC_MASTERSTYLES
+ };
+ enum XMLReportToken
+ {
+ XML_TOK_REPORT_HEADER,
+ XML_TOK_PAGE_HEADER ,
+ XML_TOK_GROUP,
+ XML_TOK_DETAIL ,
+ XML_TOK_PAGE_FOOTER ,
+ XML_TOK_REPORT_FOOTER,
+ XML_TOK_HEADER_ON_NEW_PAGE ,
+ XML_TOK_FOOTER_ON_NEW_PAGE ,
+ XML_TOK_COMMAND_TYPE ,
+ XML_TOK_COMMAND ,
+ XML_TOK_FILTER ,
+ XML_TOK_CAPTION ,
+ XML_TOK_ESCAPE_PROCESSING ,
+ XML_TOK_REPORT_FUNCTION ,
+ XML_TOK_REPORT_ELEMENT ,
+ XML_TOK_REPORT_MIMETYPE
+ };
+ enum XMLGroup
+ {
+ XML_TOK_START_NEW_COLUMN ,
+ XML_TOK_RESET_PAGE_NUMBER ,
+ XML_TOK_PRINT_HEADER_ON_EACH_PAGE ,
+ XML_TOK_GROUP_EXPRESSION ,
+ XML_TOK_GROUP_HEADER ,
+ XML_TOK_GROUP_GROUP ,
+ XML_TOK_GROUP_DETAIL ,
+ XML_TOK_GROUP_FOOTER ,
+ XML_TOK_SORT_ASCENDING ,
+ XML_TOK_GROUP_FUNCTION ,
+ XML_TOK_GROUP_KEEP_TOGETHER
+ };
+ enum XMLSection
+ {
+ XML_TOK_SECTION_NAME,
+ XML_TOK_TABLE,
+ XML_TOK_CONDITIONAL_PRINT_EXPRESSION,
+ XML_TOK_VISIBLE ,
+ XML_TOK_FORCE_NEW_PAGE ,
+ XML_TOK_FORCE_NEW_COLUMN ,
+ XML_TOK_KEEP_TOGETHER ,
+ XML_TOK_REPEAT_SECTION,
+ XML_TOK_PAGE_PRINT_OPTION,
+ XML_TOK_SECT_STYLE_NAME
+ };
+
+ enum XMLCell
+ {
+ XML_TOK_P,
+ XML_TOK_FIXED_CONTENT,
+ XML_TOK_FORMATTED_TEXT,
+ XML_TOK_IMAGE,
+ XML_TOK_SUB_DOCUMENT,
+ XML_TOK_CUSTOM_SHAPE,
+ XML_TOK_PAGE_NUMBER,
+ XML_TOK_PAGE_COUNT,
+ XML_TOK_TEXT_TAB_STOP,
+ XML_TOK_TEXT_LINE_BREAK,
+ XML_TOK_TEXT_S
+ };
+
+ enum XMLComponent
+ {
+ XML_TOK_NAME
+ ,XML_TOK_TABLE_COLUMNS
+ ,XML_TOK_TABLE_ROWS
+ ,XML_TOK_COLUMN_STYLE_NAME
+ ,XML_TOK_COLUMN
+ ,XML_TOK_ROW
+ ,XML_TOK_CELL
+ ,XML_TOK_COV_CELL
+ ,XML_TOK_NUMBER_COLUMNS_SPANNED
+ ,XML_TOK_NUMBER_ROWS_SPANNED
+ ,XML_TOK_TEXT_STYLE_NAME
+ ,XML_TOK_TRANSFORM
+ };
+ enum XMLReportElement
+ {
+ XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE
+ ,XML_TOK_REP_CONDITIONAL_PRINT_EXPRESSION
+ ,XML_TOK_PRINT_REPEATED_VALUES
+ ,XML_TOK_COMPONENT
+ ,XML_TOK_FORMATCONDITION
+ };
+ enum XMLControlProperty
+ {
+ XML_TOK_PROPERTY_NAME
+ ,XML_TOK_VALUE_TYPE
+ ,XML_TOK_LIST_PROPERTY
+ ,XML_TOK_VALUE
+ ,XML_TOK_CURRENCY
+ ,XML_TOK_DATE_VALUE
+ ,XML_TOK_TIME_VALUE
+ ,XML_TOK_STRING_VALUE
+ ,XML_TOK_BOOLEAN_VALUE
+ ,XML_TOK_PROPERTIES
+ ,XML_TOK_SIZE
+ ,XML_TOK_IMAGE_DATA
+ ,XML_TOK_IMAGE_POSITION
+ ,XML_TOK_IMAGE_ALIGN
+ ,XML_TOK_SCALE
+ ,XML_TOK_LABEL
+ ,XML_TOK_DATA_FORMULA
+ ,XML_TOK_PRESERVE_IRI
+ ,XML_TOK_SELECT_PAGE
+ };
+ enum XMLFunction
+ {
+ XML_TOK_FUNCTION_NAME
+ ,XML_TOK_FUNCTION_FORMULA
+ ,XML_TOK_PRE_EVALUATED
+ ,XML_TOK_INITIAL_FORMULA
+ ,XML_TOK_DEEP_TRAVERSING
+ };
+ enum XMLSubDocument
+ {
+ XML_TOK_MASTER_DETAIL_FIELDS
+ ,XML_TOK_MASTER_DETAIL_FIELD
+ ,XML_TOK_MASTER
+ ,XML_TOK_SUB_DETAIL
+ };
+ enum XMLFormatConidition
+ {
+ XML_TOK_FORMAT_STYLE_NAME
+ ,XML_TOK_ENABLED
+ ,XML_TOK_FORMULA
+ };
+
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLENUMS_HXX
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
new file mode 100644
index 000000000000..38e3baf3eae4
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -0,0 +1,1667 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlExport.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLEXPORT_HXX
+#include "xmlExport.hxx"
+#endif
+#ifndef RPT_XMLAUTOSTYLE_HXX
+#include "xmlAutoStyle.hxx"
+#endif
+#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
+#include <xmloff/ProgressBarHelper.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_TEXTIMP_HXX_
+#include <xmloff/txtimp.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef _XMLOFF_TEXTPRMAP_HXX_
+#include <xmloff/txtprmap.hxx>
+#endif
+#include <xmloff/numehelp.hxx>
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#include "xmlstrings.hrc"
+#ifndef RPT_XMLPROPHANDLER_HXX
+#include "xmlPropertyHandler.hxx"
+#endif
+#ifndef _COM_SUN_STAR_AWT_IMAGEPOSITION_HPP_
+#include <com/sun/star/awt/ImagePosition.hpp>
+#endif
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#ifndef _COM_SUN_STAR_REPORT_XFIXEDTEXT_HPP_
+#include <com/sun/star/report/XFixedText.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XImageControl_HPP_
+#include <com/sun/star/report/XImageControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_XSHAPE_HPP_
+#include <com/sun/star/drawing/XShape.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
+#include <com/sun/star/drawing/XShapes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTION_HPP_
+#include <com/sun/star/report/XFunction.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+// for locking SolarMutex: svapp + mutex
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+
+#include <boost/bind.hpp>
+
+//--------------------------------------------------------------------------
+namespace rptxml
+{
+ using namespace xmloff;
+ using namespace comphelper;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::util;
+ using namespace ::com::sun::star::xml;
+
+ //---------------------------------------------------------------------
+ Reference< XInterface > ORptExportHelper::create(Reference< XComponentContext > const & xContext)
+ {
+ return static_cast< XServiceInfo* >(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),EXPORT_SETTINGS ));
+ }
+ //---------------------------------------------------------------------
+ ::rtl::OUString ORptExportHelper::getImplementationName_Static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLSettingsExporter");
+ }
+ //---------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ORptExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter");
+ return aSupported;
+ }
+ //---------------------------------------------------------------------
+ Reference< XInterface > ORptContentExportHelper::create(Reference< XComponentContext > const & xContext)
+ {
+ return static_cast< XServiceInfo* >(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),EXPORT_CONTENT ));
+ }
+ //---------------------------------------------------------------------
+ ::rtl::OUString ORptContentExportHelper::getImplementationName_Static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLContentExporter");
+ }
+ //---------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ORptContentExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter");
+ return aSupported;
+ }
+
+ //---------------------------------------------------------------------
+ Reference< XInterface > ORptStylesExportHelper::create(Reference< XComponentContext > const & xContext)
+ {
+ return static_cast< XServiceInfo* >(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
+ EXPORT_FONTDECLS|EXPORT_OASIS ));
+ }
+ //---------------------------------------------------------------------
+ ::rtl::OUString ORptStylesExportHelper::getImplementationName_Static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLStylesExporter");
+ }
+ //---------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ORptStylesExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter");
+ return aSupported;
+ }
+
+ //---------------------------------------------------------------------
+ Reference< XInterface > ODBFullExportHelper::create(Reference< XComponentContext > const & xContext)
+ {
+ return static_cast< XServiceInfo* >(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),EXPORT_ALL));
+ }
+ //---------------------------------------------------------------------
+ ::rtl::OUString ODBFullExportHelper::getImplementationName_Static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLFullExporter");
+ }
+ //---------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ODBFullExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter");
+ return aSupported;
+ }
+
+ //---------------------------------------------------------------------
+ ::rtl::OUString lcl_implGetPropertyXMLType(const 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;
+ }
+ }
+
+ class OSpecialHanldeXMLExportPropertyMapper : public SvXMLExportPropertyMapper
+ {
+ public:
+ OSpecialHanldeXMLExportPropertyMapper(const UniReference< XMLPropertySetMapper >& rMapper) : SvXMLExportPropertyMapper(rMapper )
+ {
+ }
+ /** this method is called for every item that has the
+ MID_FLAG_SPECIAL_ITEM_EXPORT flag set */
+ 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
+ {
+ // nothing to do here
+ }
+ };
+// -----------------------------------------------------------------------------
+void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid& _rGrid)
+{
+ ORptExport::TSectionsGrid::iterator aSectionIter = _rGrid.begin();
+ ORptExport::TSectionsGrid::iterator aSectionEnd = _rGrid.end();
+ for (;aSectionIter != aSectionEnd ; ++aSectionIter)
+ {
+ ORptExport::TGrid::iterator aRowIter = aSectionIter->second.begin();
+ ORptExport::TGrid::iterator aRowEnd = aSectionIter->second.end();
+ for (; aRowIter != aRowEnd; ++aRowIter)
+ {
+ if ( aRowIter->first )
+ {
+ ::std::vector< ORptExport::TCell >::iterator aColIter = aRowIter->second.begin();
+ ::std::vector< ORptExport::TCell >::iterator aColEnd = aRowIter->second.end();
+ for (; aColIter != aColEnd; ++aColIter)
+ {
+ if ( aColIter->nRowSpan > 1 )
+ {
+ sal_Int32 nColSpan = aColIter->nColSpan;
+ sal_Int32 nColIndex = aColIter - aRowIter->second.begin();
+ for (sal_Int32 i = 1; i < aColIter->nRowSpan; ++i)
+ {
+ (aRowIter+i)->second[nColIndex].nColSpan = nColSpan;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+ORptExport::ORptExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nExportFlag)
+: SvXMLExport( _rxMSF,MAP_100TH_MM,XML_REPORT, EXPORT_OASIS)
+,m_bAllreadyFilled(sal_False)
+{
+ setExportFlags( EXPORT_OASIS | nExportFlag);
+ GetMM100UnitConverter().setCoreMeasureUnit(MAP_100TH_MM);
+ GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM);
+
+ // (getExportFlags() & EXPORT_CONTENT) != 0 ? : XML_N_OOO
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE ), XML_NAMESPACE_OFFICE );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_OOO), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO );
+
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_RPT), GetXMLToken(XML_N_RPT), XML_NAMESPACE_REPORT );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG_COMPAT), XML_NAMESPACE_SVG );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_FORM), GetXMLToken(XML_N_FORM), XML_NAMESPACE_FORM );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_TEXT), GetXMLToken(XML_N_TEXT), XML_NAMESPACE_TEXT );
+
+
+ if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS) ) != 0 )
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_FO), GetXMLToken(XML_N_FO_COMPAT), XML_NAMESPACE_FO );
+
+ if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS) ) != 0 )
+ {
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
+ }
+ if( (getExportFlags() & EXPORT_SETTINGS) != 0 )
+ {
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_CONFIG), GetXMLToken(XML_N_CONFIG), XML_NAMESPACE_CONFIG );
+ }
+
+ if( (getExportFlags() & (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS) ) != 0 )
+ {
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_STYLE), GetXMLToken(XML_N_STYLE), XML_NAMESPACE_STYLE );
+ }
+
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_TABLE), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE );
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_NUMBER), GetXMLToken(XML_N_NUMBER), XML_NAMESPACE_NUMBER );
+
+ m_sTableStyle = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_STYLE_NAME) );
+ m_sColumnStyle = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TABLE, GetXMLToken(XML_COLUMN) );
+ m_sCellStyle = GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_REPORT, GetXMLToken(XML_STYLE_NAME) );
+
+
+ m_xPropHdlFactory = new OXMLRptPropHdlFactory();
+ UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory();
+ UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac);
+ UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS );
+ xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2);
+
+ m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1);
+ //m_xTableStylesExportPropertySetMapper->ChainExportMapper(xTableStylesPropertySetMapper2);
+
+ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap();
+ m_xCellStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(m_xCellStylesPropertySetMapper);
+ m_xCellStylesExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
+
+ UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory);
+ m_xColumnStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xColumnStylesPropertySetMapper);
+
+ UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory);
+ m_xRowStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xRowStylesPropertySetMapper);
+
+ UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ));
+ m_xParaPropMapper = new OSpecialHanldeXMLExportPropertyMapper( xPropMapper);
+
+ ::rtl::OUString sFamily( GetXMLToken(XML_PARAGRAPH) );
+ ::rtl::OUString aPrefix( String( 'P' ) );
+ GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily,
+ m_xParaPropMapper, aPrefix );
+
+ GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_CELL, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME)),
+ m_xCellStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX)));
+ GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME)),
+ m_xColumnStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX)));
+ GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_ROW, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME)),
+ m_xRowStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX)));
+ GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_TABLE, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME)),
+ m_xTableStylesExportPropertySetMapper, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX)));
+}
+// -----------------------------------------------------------------------------
+Reference< XInterface > ORptExport::create(Reference< XComponentContext > const & xContext)
+{
+ return *(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)));
+}
+
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.ExportFilter"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ORptExport::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > ORptExport::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter"));
+
+ return aServices;
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL ORptExport::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL ORptExport::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportFunctions(const Reference<XIndexAccess>& _xFunctions)
+{
+ const sal_Int32 nCount = _xFunctions->getCount();
+ for (sal_Int32 i = 0; i< nCount; ++i)
+ {
+ uno::Reference< report::XFunction> xFunction(_xFunctions->getByIndex(i),uno::UNO_QUERY_THROW);
+ OSL_ENSURE(xFunction.is(),"Function object is NULL!");
+
+ exportFormula(XML_FORMULA,xFunction->getFormula());
+ beans::Optional< ::rtl::OUString> aInitial = xFunction->getInitialFormula();
+ if ( aInitial.IsPresent )
+ exportFormula(XML_INITIAL_FORMULA ,aInitial.Value );
+ AddAttribute( XML_NAMESPACE_REPORT, XML_NAME , xFunction->getName() );
+ if ( xFunction->getPreEvaluated() )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_PRE_EVALUATED , XML_TRUE );
+ if ( xFunction->getDeepTraversing() )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_DEEP_TRAVERSING , XML_TRUE );
+
+ SvXMLElementExport aFunction(*this,XML_NAMESPACE_REPORT, XML_FUNCTION, sal_True, sal_True);
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportMasterDetailFields(const Reference<XReportDefinition>& _xReportDefinition)
+{
+ uno::Sequence< ::rtl::OUString> aMasterFields = _xReportDefinition->getMasterFields();
+ if ( aMasterFields.getLength() )
+ {
+ SvXMLElementExport aElement(*this,XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, sal_True, sal_True);
+ uno::Sequence< ::rtl::OUString> aDetailFields = _xReportDefinition->getDetailFields();
+
+ OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),"not equal length for amster and detail fields!");
+
+ const ::rtl::OUString* pDetailFieldsIter = aDetailFields.getConstArray();
+ const ::rtl::OUString* pIter = aMasterFields.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aMasterFields.getLength();
+ for(;pIter != pEnd;++pIter,++pDetailFieldsIter)
+ {
+ AddAttribute( XML_NAMESPACE_REPORT, XML_MASTER , *pIter );
+ if ( pDetailFieldsIter->getLength() )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_DETAIL , *pDetailFieldsIter );
+ SvXMLElementExport aPair(*this,XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELD, sal_True, sal_True);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefinition)
+{
+ if ( _xReportDefinition.is() )
+ {
+ exportFunctions(_xReportDefinition->getFunctions().get());
+
+ if ( _xReportDefinition->getReportHeaderOn() )
+ {
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_HEADER, sal_True, sal_True);
+ exportSection(_xReportDefinition->getReportHeader());
+ } // if ( _xReportDefinition->getReportHeaderOn() )
+ if ( _xReportDefinition->getPageHeaderOn() )
+ {
+ ::rtl::OUStringBuffer sValue;
+ sal_uInt16 nRet = _xReportDefinition->getPageHeaderOption();
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
+
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_HEADER, sal_True, sal_True);
+ exportSection(_xReportDefinition->getPageHeader(),true);
+ } // if ( _xReportDefinition->getPageHeaderOn() )
+
+ exportGroup(_xReportDefinition,0);
+
+ if ( _xReportDefinition->getPageFooterOn() )
+ {
+ ::rtl::OUStringBuffer sValue;
+ sal_uInt16 nRet = _xReportDefinition->getPageFooterOption();
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_FOOTER, sal_True, sal_True);
+ exportSection(_xReportDefinition->getPageFooter(),true);
+ } // if ( _xReportDefinition->getPageFooterOn() )
+ if ( _xReportDefinition->getReportFooterOn() )
+ {
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_FOOTER, sal_True, sal_True);
+ exportSection(_xReportDefinition->getReportFooter());
+ } // if ( _xReportDefinition->getReportFooterOn() )
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportImagePosition(sal_Int16 _nImagePosition)
+{
+ OSL_ENSURE( ( _nImagePosition >= awt::ImagePosition::LeftTop ) && ( _nImagePosition <= awt::ImagePosition::Centered ),
+ "ORptExport::export: don't know this image position!" );
+
+ if ( ( _nImagePosition < awt::ImagePosition::LeftTop ) || ( _nImagePosition > awt::ImagePosition::Centered ) )
+ // this is important to prevent potential buffer overflows below, so don't optimize
+ _nImagePosition = awt::ImagePosition::Centered;
+
+ if ( _nImagePosition == awt::ImagePosition::Centered )
+ {
+ AddAttribute( XML_NAMESPACE_FORM, XML_IMAGE_POSITION , GetXMLToken( XML_CENTER ) );
+ }
+ else
+ {
+ XMLTokenEnum eXmlImagePositions[] =
+ {
+ XML_START, XML_END, XML_TOP, XML_BOTTOM
+ };
+ XMLTokenEnum eXmlImageAligns[] =
+ {
+ XML_START, XML_CENTER, XML_END
+ };
+
+ XMLTokenEnum eXmlImagePosition = eXmlImagePositions[ _nImagePosition / 3 ];
+ XMLTokenEnum eXmlImageAlign = eXmlImageAligns [ _nImagePosition % 3 ];
+
+ AddAttribute( XML_NAMESPACE_FORM, XML_IMAGE_POSITION , GetXMLToken( eXmlImagePosition ) );
+ AddAttribute( XML_NAMESPACE_FORM, XML_IMAGE_ALIGN , GetXMLToken( eXmlImageAlign ) );
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportComponent(const Reference<XReportComponent>& _xReportComponent)
+{
+ OSL_ENSURE(_xReportComponent.is(),"No component interface!");
+ if ( !_xReportComponent.is() )
+ return;
+
+ AddAttribute(XML_NAMESPACE_DRAW, XML_NAME,_xReportComponent->getName());
+
+ SvXMLElementExport aElem(*this,XML_NAMESPACE_REPORT, XML_REPORT_COMPONENT, sal_False, sal_False);
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportFormatConditions(const Reference<XReportControlModel>& _xReportElement)
+{
+ OSL_ENSURE(_xReportElement.is(),"_xReportElement is NULL -> GPF");
+ ::rtl::OUString sDataField = convertFormula(_xReportElement->getDataField());
+ sal_Int32 nCount = _xReportElement->getCount();
+ try
+ {
+ for (sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ uno::Reference< report::XFormatCondition > xCond(_xReportElement->getByIndex(i),uno::UNO_QUERY);
+ if ( !xCond->getEnabled() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_ENABLED,XML_FALSE);
+
+ AddAttribute(XML_NAMESPACE_REPORT, XML_FORMULA,xCond->getFormula());
+
+ exportStyleName(xCond.get(),GetAttrList(),m_sCellStyle);
+ SvXMLElementExport aElem(*this,XML_NAMESPACE_REPORT, XML_FORMAT_CONDITION, sal_True, sal_True);
+ } // for (sal_Int32 i = 0; i < nCount ; ++i)
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can not access format condition!");
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportReportElement(const Reference<XReportControlModel>& _xReportElement)
+{
+ OSL_ENSURE(_xReportElement.is(),"_xReportElement is NULL -> GPF");
+ if ( _xReportElement->getPrintWhenGroupChange() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PRINT_ONLY_WHEN_GROUP_CHANGE, XML_TRUE );
+
+ if ( !_xReportElement->getPrintRepeatedValues() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PRINT_REPEATED_VALUES,XML_FALSE);
+
+ SvXMLElementExport aElem(*this,XML_NAMESPACE_REPORT, XML_REPORT_ELEMENT, sal_False, sal_False);
+ if ( _xReportElement->getCount() )
+ {
+ exportFormatConditions(_xReportElement);
+ }
+
+ ::rtl::OUString sExpr = _xReportElement->getConditionalPrintExpression();
+ if ( sExpr.getLength() )
+ {
+ exportFormula(XML_FORMULA,sExpr);
+ SvXMLElementExport aPrintExpr(*this,XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION, sal_False, sal_False);
+ } // if ( sExpr.getLength() )
+
+ // only export when parent exists
+ uno::Reference< report::XSection> xParent(_xReportElement->getParent(),uno::UNO_QUERY);
+ if ( xParent.is() )
+ exportComponent(_xReportElement.get());
+}
+// -----------------------------------------------------------------------------
+void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::vector<sal_Int32>& _aPosY,ORptExport::TGrid& _rColumns)
+{
+ sal_Int32 nCountX = _aPosX.size() - 1;
+ sal_Int32 nCountY = _aPosY.size() - 1;
+ for (sal_Int32 j = 0; j < nCountY; ++j)
+ {
+ sal_Int32 nHeight = _aPosY[j+1] - _aPosY[j];
+ if ( nHeight )
+ for (sal_Int32 i = 0; i < nCountX ; ++i)
+ {
+ _rColumns[j].second[i] = ORptExport::TCell(_aPosX[i+1] - _aPosX[i],nHeight,1,1);
+ _rColumns[j].second[i].bSet = sal_True;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, ORptExport::TStringVec& _rStyleNames)
+{
+ ::std::vector< XMLPropertyState > aPropertyStates;
+ aPropertyStates.push_back(XMLPropertyState(0));
+ ::std::vector<sal_Int32>::const_iterator aIter = _aSize.begin();
+ ::std::vector<sal_Int32>::const_iterator aIter2 = aIter + 1;
+ ::std::vector<sal_Int32>::const_iterator aEnd = _aSize.end();
+ for (;aIter2 != aEnd ; ++aIter,++aIter2)
+ {
+ sal_Int32 nValue = static_cast<sal_Int32>(*aIter2 - *aIter);
+ aPropertyStates[0].maValue <<= nValue;
+ _rStyleNames.push_back(GetAutoStylePool()->Add(_nFamily, aPropertyStates ));
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
+{
+ OSL_ENSURE(_xProp != NULL,"Section is NULL -> GPF");
+ exportAutoStyle(_xProp);
+
+ Reference<XReportDefinition> xReport = _xProp->getReportDefinition();
+ awt::Size aSize = rptui::getStyleProperty<awt::Size>(xReport,PROPERTY_PAPERSIZE);
+ sal_Int32 nOffset = rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN);
+ sal_Int32 nCount = _xProp->getCount();
+
+ ::std::vector<sal_Int32> aColumnPos;
+ aColumnPos.reserve(2*(nCount + 1));
+ aColumnPos.push_back(nOffset);
+ aColumnPos.push_back(aSize.Width - rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN));
+
+ ::std::vector<sal_Int32> aRowPos;
+ aRowPos.reserve(2*(nCount + 1));
+ aRowPos.push_back(0);
+ aRowPos.push_back(_xProp->getHeight());
+
+ sal_Int32 i;
+ for (i = 0 ; i< nCount ; ++i)
+ {
+ Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
+ uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
+ if ( xShape.is() )
+ continue;
+ OSL_ENSURE( xReportElement.is(),"NULL Element in Section!" );
+ if ( !xReportElement.is() )
+ continue;
+ sal_Int32 nX = xReportElement->getPositionX();
+ aColumnPos.push_back(nX);
+ Reference<XFixedLine> xFixedLine(xReportElement,uno::UNO_QUERY);
+ if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
+ {
+ sal_Int32 nWidth = static_cast<sal_Int32>(xReportElement->getWidth()*0.5);
+ nX += nWidth;
+ aColumnPos.push_back(nX);
+ nX += xReportElement->getWidth() - nWidth;
+ }
+ else
+ nX += xReportElement->getWidth();
+ aColumnPos.push_back(nX); // --nX why?
+
+ sal_Int32 nY = xReportElement->getPositionY();
+ aRowPos.push_back(nY);
+ nY += xReportElement->getHeight();
+ aRowPos.push_back(nY); // --nY why?
+ }
+
+ ::std::sort(aColumnPos.begin(),aColumnPos.end(),::std::less<sal_Int32>());
+ aColumnPos.erase(::std::unique(aColumnPos.begin(),aColumnPos.end()),aColumnPos.end());
+
+ ::std::sort(aRowPos.begin(),aRowPos.end(),::std::less<sal_Int32>());
+ aRowPos.erase(::std::unique(aRowPos.begin(),aRowPos.end()),aRowPos.end());
+
+ TSectionsGrid::iterator aInsert = m_aSectionsGrid.insert(
+ TSectionsGrid::value_type(
+ _xProp.get(),
+ TGrid(aRowPos.size() - 1,TGrid::value_type(sal_False,TRow(aColumnPos.size() - 1)))
+ )
+ ).first;
+ lcl_calculate(aColumnPos,aRowPos,aInsert->second);
+
+ TGridStyleMap::iterator aPos = m_aColumnStyleNames.insert(TGridStyleMap::value_type(_xProp.get(),TStringVec())).first;
+ collectStyleNames(XML_STYLE_FAMILY_TABLE_COLUMN,aColumnPos,aPos->second);
+ aPos = m_aRowStyleNames.insert(TGridStyleMap::value_type(_xProp.get(),TStringVec())).first;
+ collectStyleNames(XML_STYLE_FAMILY_TABLE_ROW,aRowPos,aPos->second);
+
+ sal_Int32 x1 = 0;
+ sal_Int32 y1 = 0;
+ sal_Int32 x2 = 0;
+ sal_Int32 y2 = 0;
+ sal_Int32 xi = 0;
+ sal_Int32 yi = 0;
+ bool isOverlap = false;
+
+ for (i = 0 ; i< nCount ; ++i)
+ {
+ Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
+ uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
+ if ( xShape.is() )
+ continue;
+ sal_Int32 nPos = xReportElement->getPositionX();
+ x1 = (::std::find(aColumnPos.begin(),aColumnPos.end(),nPos) - aColumnPos.begin());
+ Reference<XFixedLine> xFixedLine(xReportElement,uno::UNO_QUERY);
+ if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
+ nPos += static_cast<sal_Int32>(xReportElement->getWidth()*0.5);
+ else
+ nPos += xReportElement->getWidth(); // -1 why
+ x2 = (::std::find(aColumnPos.begin(),aColumnPos.end(),nPos) - aColumnPos.begin());
+
+ nPos = xReportElement->getPositionY();
+ y1 = (::std::find(aRowPos.begin(),aRowPos.end(),nPos) - aRowPos.begin());
+ nPos += xReportElement->getHeight(); // -1 why?
+ y2 = (::std::find(aRowPos.begin(),aRowPos.end(),nPos) - aRowPos.begin());
+
+ isOverlap = false;
+ yi = y1;
+ while(yi < y2 && !isOverlap) // find overlapping controls
+ {
+ xi = x1;
+ while(xi < x2 && !isOverlap)
+ {
+ if ( aInsert->second[yi].second[xi].xElement.is() )
+ {
+ isOverlap = true;
+ }
+ ++xi;
+ }
+ ++yi;
+ }
+
+ if (!isOverlap)
+ {
+ yi = y1;
+ while(yi < y2)
+ {
+ xi = x1;
+ while(xi < x2)
+ {
+ aInsert->second[yi].second[xi] = TCell();
+ ++xi;
+ }
+ aInsert->second[yi].first = sal_True;
+ ++yi;
+ }
+
+ if (x2 - x1 != 0 && y2 - y1 != 0)
+ {
+ awt::Size aElementSize = xReportElement->getSize();
+ if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
+ aElementSize.Width = static_cast<sal_Int32>(xFixedLine->getWidth()*0.5);
+
+ sal_Int32 nColSpan = x2 - x1;
+ sal_Int32 nRowSpan = y2 - y1;
+ aInsert->second[y1].second[x1] =
+ TCell(
+ aElementSize.Width , // -1 why?
+ aElementSize.Height, // -1 why?
+ nColSpan,
+ nRowSpan,
+ xReportElement
+ );
+ }
+ }
+ }
+
+ lcl_adjustColumnSpanOverRows(m_aSectionsGrid);
+ exportReportComponentAutoStyles(_xProp);
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportReportComponentAutoStyles(const Reference<XSection>& _xProp)
+{
+ sal_Int32 nCount = _xProp->getCount();
+ for (sal_Int32 i = 0 ; i< nCount ; ++i)
+ {
+ Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
+ Reference< report::XShape > xShape(xReportElement,uno::UNO_QUERY);
+ if ( xShape.is() )
+ {
+ UniReference< XMLShapeExport > xShapeExport = GetShapeExport();
+ xShapeExport->seekShapes(_xProp.get());
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ xShapeExport->collectShapeAutoStyles(xShape.get());
+ }
+ else
+ {
+ exportAutoStyle(xReportElement.get());
+
+ Reference<XFormattedField> xFormattedField(xReportElement,uno::UNO_QUERY);
+ if ( xFormattedField.is() )
+ {
+ try
+ {
+ const sal_Int32 nFormatCount = xFormattedField->getCount();
+ for (sal_Int32 j = 0; j < nFormatCount ; ++j)
+ {
+ uno::Reference< report::XFormatCondition > xCond(xFormattedField->getByIndex(j),uno::UNO_QUERY);
+ exportAutoStyle(xCond.get());
+ } // for (sal_Int32 j = 0; j < nCount ; ++j)
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can not access format condition!");
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader)
+{
+ OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
+ ::rtl::OUStringBuffer sValue;
+ AddAttribute(XML_NAMESPACE_TABLE, XML_NAME,_xSection->getName());
+
+ if ( !_xSection->getVisible() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_VISIBLE,XML_FALSE);
+
+ if ( !bHeader )
+ {
+ sal_uInt16 nRet = _xSection->getForceNewPage();
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_PAGE,sValue.makeStringAndClear());
+
+ nRet = _xSection->getNewRowOrCol();
+ if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_COLUMN,sValue.makeStringAndClear());
+ if ( _xSection->getKeepTogether() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER, XML_TRUE );
+ }
+
+ exportStyleName(_xSection.get(),GetAttrList(),m_sTableStyle);
+
+ /// TODO export as table layout
+ SvXMLElementExport aComponents(*this,XML_NAMESPACE_TABLE, XML_TABLE, sal_True, sal_True);
+
+ ::rtl::OUString sExpr = _xSection->getConditionalPrintExpression();
+ if ( sExpr.getLength() )
+ {
+ exportFormula(XML_FORMULA,sExpr);
+ SvXMLElementExport aPrintExpr(*this,XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION, sal_True, sal_False);
+ }
+
+ exportContainer(_xSection);
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportTableColumns(const Reference< XSection>& _xSection)
+{
+ SvXMLElementExport aColumns(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, sal_True, sal_True);
+ TGridStyleMap::iterator aColFind = m_aColumnStyleNames.find(_xSection.get());
+ OSL_ENSURE(aColFind != m_aColumnStyleNames.end(),"ORptExport::exportTableColumns: Section not found in m_aColumnStyleNames!");
+ if ( aColFind == m_aColumnStyleNames.end() )
+ return;
+
+ TStringVec::iterator aColIter = aColFind->second.begin();
+ TStringVec::iterator aColEnd = aColFind->second.end();
+ for (; aColIter != aColEnd; ++aColIter)
+ {
+ AddAttribute( m_sTableStyle,*aColIter );
+ SvXMLElementExport aColumn(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True);
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportContainer(const Reference< XSection>& _xSection)
+{
+ OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
+
+ exportTableColumns(_xSection);
+
+ TSectionsGrid::iterator aFind = m_aSectionsGrid.find(_xSection.get());
+ OSL_ENSURE(aFind != m_aSectionsGrid.end(),"ORptExport::exportContainer: Section not found in grid!");
+ if ( aFind == m_aSectionsGrid.end() )
+ return;
+ TGrid::iterator aRowIter = aFind->second.begin();
+ TGrid::iterator aRowEnd = aFind->second.end();
+
+ sal_Int32 nEmptyCellColSpan = 0;
+ TGridStyleMap::iterator aRowFind = m_aRowStyleNames.find(_xSection.get());
+ TStringVec::iterator aHeightIter = aRowFind->second.begin();
+ OSL_ENSURE(aRowFind->second.size() == aFind->second.size(),"Different count for rows");
+
+ bool bShapeHandled = false;
+ ::std::map<sal_Int32,sal_Int32> aRowSpan;
+ for (sal_Int32 j = 0; aRowIter != aRowEnd; ++aRowIter,++j,++aHeightIter)
+ {
+ AddAttribute( m_sTableStyle,*aHeightIter );
+ SvXMLElementExport aRow(*this,XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True);
+ if ( aRowIter->first )
+ {
+ ::std::vector< TCell >::iterator aColIter = aRowIter->second.begin();
+ ::std::vector< TCell >::iterator aColEnd = aRowIter->second.end();
+ nEmptyCellColSpan = 0;
+ for (; aColIter != aColEnd; ++aColIter)
+ {
+ sal_Bool bCoveredCell = sal_False;
+ sal_Int32 nColSpan = 0;
+ sal_Int32 nColIndex = aColIter - aRowIter->second.begin();
+ ::std::map<sal_Int32,sal_Int32>::iterator aRowSpanFind = aRowSpan.find(nColIndex);
+ if ( aRowSpanFind != aRowSpan.end() )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ sal_Int32 nRowSpan = aRowSpanFind->second;
+ nRowSpan = nRowSpan;
+ sal_Int32 nColSpanTemp = aColIter->nColSpan;
+ (void) nColSpanTemp;
+#endif
+ nColSpan = 1;
+ if ( !--(aRowSpanFind->second) )
+ aRowSpan.erase(aRowSpanFind);
+
+ if ( aColIter->nColSpan > 1 )
+ nColSpan += aColIter->nColSpan - 1;
+
+ bCoveredCell = sal_True;
+ aColIter = aColIter + (aColIter->nColSpan - 1);
+ }
+ else if ( aColIter->bSet )
+ {
+ if ( nEmptyCellColSpan > 0 )
+ {
+ AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) );
+ bCoveredCell = sal_True;
+ nColSpan = nEmptyCellColSpan - 1;
+ nEmptyCellColSpan = 0;
+ }
+ sal_Int32 nSpan = aColIter->nColSpan;
+ if ( nSpan > 1 )
+ {
+ AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nSpan) );
+ nColSpan = nSpan - 1;
+ bCoveredCell = sal_True;
+ }
+ nSpan = aColIter->nRowSpan;
+ if ( nSpan > 1 )
+ {
+ AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_ROWS_SPANNED,implConvertNumber(nSpan) );
+ aRowSpan[nColIndex] = nSpan - 1;
+ }
+ if ( aColIter->xElement.is() )
+ exportStyleName(aColIter->xElement.get(),GetAttrList(),m_sTableStyle);
+
+ // start <table:table-cell>
+ Reference<XFormattedField> xFormattedField(aColIter->xElement,uno::UNO_QUERY);
+ if ( xFormattedField.is() )
+ {
+ sal_Int32 nFormatKey = xFormattedField->getFormatKey();
+ if ( 0 != nFormatKey )
+ {
+ ::rtl::OUString sEmpty;
+ if ( util::NumberFormat::TEXT == nFormatKey )
+ XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(*this, sEmpty, sEmpty);
+ else
+ XMLNumberFormatAttributesExportHelper::SetNumberFormatAttributes(*this, nFormatKey, 0.0);
+ }
+ }
+ SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_False);
+
+ if ( aColIter->xElement.is() )
+ {
+ // start <text:p>
+ SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, sal_False, sal_False);
+ Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
+ Reference<XReportComponent> xReportComponent = aColIter->xElement;
+
+ if ( !bShapeHandled )
+ {
+ bShapeHandled = true;
+ exportShapes(_xSection);
+ }
+ uno::Reference< XShape > xShape(xElement,uno::UNO_QUERY);
+ uno::Reference< XFixedLine > xFixedLine(xElement,uno::UNO_QUERY);
+ if ( !xShape.is() && !xFixedLine.is() )
+ {
+ Reference<XReportControlModel> xReportElement(xElement,uno::UNO_QUERY);
+ Reference<XReportDefinition> xReportDefinition(xElement,uno::UNO_QUERY);
+ Reference<XSection> xSection(xElement,uno::UNO_QUERY);
+
+ XMLTokenEnum eToken = XML_SECTION;
+ sal_Bool bExportData = sal_False;
+ if ( xElement->supportsService(SERVICE_FIXEDTEXT) )
+ {
+ eToken = XML_FIXED_CONTENT;
+ }
+ else if ( xElement->supportsService(SERVICE_FORMATTEDFIELD) )
+ {
+ eToken = XML_FORMATTED_TEXT;
+ bExportData = sal_True;
+ }
+ else if ( xElement->supportsService(SERVICE_IMAGECONTROL) )
+ {
+ eToken = XML_IMAGE;
+ Reference< XImageControl > xProp(xElement,uno::UNO_QUERY);
+ ::rtl::OUString sTargetLocation = xProp->getImageURL();
+ if ( sTargetLocation.getLength() )
+ {
+ sTargetLocation = GetRelativeReference(sTargetLocation);
+ AddAttribute(XML_NAMESPACE_FORM, XML_IMAGE_DATA,sTargetLocation);
+ }
+ bExportData = sal_True;
+ if ( xProp->getScaleImage() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_SCALE, XML_TRUE );
+ }
+ else if ( xReportDefinition.is() )
+ {
+ eToken = XML_SUB_DOCUMENT;
+ }
+ else if ( xSection.is() )
+ {
+ }
+
+ bool bPageSet = false;
+ if ( bExportData )
+ {
+ bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
+ if ( bPageSet )
+ {
+ ::rtl::OUString sFieldData = xReportElement->getDataField();
+ static const ::rtl::OUString s_sPageNumber(RTL_CONSTASCII_USTRINGPARAM("PageNumber()"));
+ static const ::rtl::OUString s_sPageCount(RTL_CONSTASCII_USTRINGPARAM("PageCount()"));
+ static const ::rtl::OUString s_sReportPrefix(RTL_CONSTASCII_USTRINGPARAM("rpt:"));
+ static const ::rtl::OUString s_sConcatOperator(RTL_CONSTASCII_USTRINGPARAM("&"));
+ sFieldData = sFieldData.copy(s_sReportPrefix.getLength(),sFieldData.getLength() - s_sReportPrefix.getLength());
+ sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber);
+ if ( nPageNumberIndex != -1 )
+ {
+ sal_Int32 nIndex = 0;
+ do
+ {
+ ::rtl::OUString sToken = sFieldData.getToken( 0, '&', nIndex );
+ sToken = sToken.trim();
+ if ( sToken.getLength() )
+ {
+ if ( sToken == s_sPageNumber )
+ {
+ static const ::rtl::OUString s_sCurrent(RTL_CONSTASCII_USTRINGPARAM("current"));
+ AddAttribute(XML_NAMESPACE_TEXT, XML_SELECT_PAGE, s_sCurrent );
+ SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_NUMBER, sal_False, sal_False);
+ Characters(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
+ }
+ else if ( sToken == s_sPageCount )
+ {
+ SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_COUNT, sal_False, sal_False);
+ Characters(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1")));
+ }
+ else
+ {
+
+ if ( sToken.indexOf('"') == 0 && sToken.lastIndexOf('"') == sToken.getLength()-1 )
+ sToken = sToken.copy(1,sToken.getLength()-2);
+
+ sal_Bool bPrevCharIsSpace = sal_False;
+ GetTextParagraphExport()->exportText(sToken,bPrevCharIsSpace);
+ }
+ }
+ }
+ while ( nIndex >= 0 );
+ }
+ }
+ else if ( eToken == XML_IMAGE )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PRESERVE_IRI, XML_TRUE );
+ }
+
+ if ( !bPageSet )
+ {
+ // start <report:eToken>
+ SvXMLElementExport aComponents(*this,XML_NAMESPACE_REPORT, eToken, sal_False, sal_False);
+ if ( eToken == XML_FIXED_CONTENT )
+ exportParagraph(xReportElement);
+ if ( xReportElement.is() )
+ exportReportElement(xReportElement);
+
+ if ( eToken == XML_GROUP && xSection.is() )
+ exportContainer(xSection);
+ else if ( eToken == XML_SUB_DOCUMENT )
+ {
+ exportMasterDetailFields(xReportDefinition);
+ exportReport(xReportDefinition);
+ }
+ else if ( xSection.is() )
+ exportSection(xSection);
+ }
+ }
+ }
+ aColIter = aColIter + (aColIter->nColSpan - 1);
+ }
+ else
+ ++nEmptyCellColSpan;
+ if ( bCoveredCell )
+ {
+ for (sal_Int32 k = 0; k < nColSpan; ++k)
+ {
+ SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, sal_True, sal_True);
+ }
+
+ }
+ } // for (sal_Int32 i = 0 ; i< nCount ; ++i)
+ if ( nEmptyCellColSpan )
+ {
+ {
+ AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) );
+ SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
+ if ( !bShapeHandled )
+ {
+ bShapeHandled = true;
+ exportShapes(_xSection);
+ }
+ }
+ for (sal_Int32 k = 0; k < nEmptyCellColSpan; ++k)
+ {
+ SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, sal_True, sal_True);
+ }
+ nEmptyCellColSpan = 0;
+ }
+ }
+ else
+ { // empty rows
+ nEmptyCellColSpan = aRowIter->second.size();
+ if ( nEmptyCellColSpan )
+ {
+ {
+ AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED,implConvertNumber(nEmptyCellColSpan) );
+ SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True);
+ if ( !bShapeHandled )
+ {
+ bShapeHandled = true;
+ exportShapes(_xSection);
+ }
+ }
+ for (sal_Int32 k = 1; k < nEmptyCellColSpan; ++k)
+ {
+ SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, sal_True, sal_True);
+ }
+ nEmptyCellColSpan = 0;
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::convertFormula(const ::rtl::OUString& _sFormula)
+{
+ ::rtl::OUString sFormula = _sFormula;
+ //sal_Int32 nLength = _sFormula.getLength();
+ //if ( nLength )
+ //{
+ // sal_Int32 nPos = 0;
+ // if ( _sFormula.matchAsciiL("=",1) != 0 )
+ // {
+ // nPos = 1;
+ // --nLength;
+ // }
+ // bool bFormula = _sFormula.indexOf('[') != -1 || _sFormula.indexOf('(') != -1;
+ // if ( bFormula )
+ // sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + _sFormula.copy(nPos,nLength);
+ // else
+ // sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("field:[")) + _sFormula.copy(nPos,nLength) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));;
+ //}
+ return sFormula;
+}
+// -----------------------------------------------------------------------------
+bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const ::rtl::OUString& _sFormula)
+{
+ ::rtl::OUString sFieldData = convertFormula(_sFormula);
+ static const ::rtl::OUString s_sPageNumber(RTL_CONSTASCII_USTRINGPARAM("PageNumber()"));
+ static const ::rtl::OUString s_sPageCount(RTL_CONSTASCII_USTRINGPARAM("PageCount()"));
+ sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber);
+ sal_Int32 nPageCountIndex = sFieldData.indexOf(s_sPageCount);
+ bool bRet = nPageNumberIndex != -1 || nPageCountIndex != -1;
+ if ( !bRet )
+ AddAttribute(XML_NAMESPACE_REPORT, eName,sFieldData);
+
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt,const ::rtl::OUString& _sName)
+{
+ Reference<XPropertySet> xFind(_xProp);
+ TPropertyStyleMap::iterator aFind = m_aAutoStyleNames.find(xFind);
+ if ( aFind != m_aAutoStyleNames.end() )
+ {
+ _rAtt.AddAttribute( _sName,
+ aFind->second );
+ m_aAutoStyleNames.erase(aFind);
+ }
+}
+// -----------------------------------------------------------------------------
+sal_Bool ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,sal_Bool _bExportAutoStyle)
+{
+ sal_Bool bGroupExported = sal_False;
+ if ( _xReportDefinition.is() )
+ {
+ Reference< XGroups > xGroups = _xReportDefinition->getGroups();
+ if ( xGroups.is() )
+ {
+ sal_Int32 nCount = xGroups->getCount();
+ if ( _nPos >= 0 && _nPos < nCount )
+ {
+ bGroupExported = sal_True;
+ Reference<XGroup> xGroup(xGroups->getByIndex(_nPos),uno::UNO_QUERY);
+ OSL_ENSURE(xGroup.is(),"No Group prepare for GPF");
+ if ( _bExportAutoStyle )
+ {
+ if ( xGroup->getHeaderOn() )
+ exportSectionAutoStyle(xGroup->getHeader());
+ exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
+ if ( xGroup->getFooterOn() )
+ exportSectionAutoStyle(xGroup->getFooter());
+ }
+ else
+ {
+ if ( xGroup->getSortAscending() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_SORT_ASCENDING, XML_TRUE );
+
+ if ( xGroup->getStartNewColumn() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_START_NEW_COLUMN, XML_TRUE);
+ if ( xGroup->getResetPageNumber() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_RESET_PAGE_NUMBER, XML_TRUE );
+
+ ::rtl::OUString sFormula(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
+ sFormula += xGroup->getExpression();
+ sFormula += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\")"));
+ AddAttribute(XML_NAMESPACE_REPORT, XML_GROUP_EXPRESSION,sFormula);
+ sal_Int16 nRet = xGroup->getKeepTogether();
+ ::rtl::OUStringBuffer sValue;
+ const SvXMLEnumMapEntry* aXML_KeepTogetherEnumMap = OXMLHelper::GetKeepTogetherOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_KeepTogetherEnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER,sValue.makeStringAndClear());
+
+ SvXMLElementExport aGroup(*this,XML_NAMESPACE_REPORT, XML_GROUP, sal_True, sal_True);
+ exportFunctions(xGroup->getFunctions().get());
+ if ( xGroup->getHeaderOn() )
+ {
+ Reference<XSection> xSection = xGroup->getHeader();
+ if ( xSection->getRepeatSection() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_REPEAT_SECTION,XML_TRUE );
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_HEADER, sal_True, sal_True);
+ exportSection(xSection);
+ }
+ exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
+ if ( xGroup->getFooterOn() )
+ {
+ Reference<XSection> xSection = xGroup->getFooter();
+ if ( xSection->getRepeatSection() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_REPEAT_SECTION,XML_TRUE );
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_FOOTER, sal_True, sal_True);
+ exportSection(xSection);
+ } // if ( xGroup->getFooterOn() )
+ }
+ }
+ else if ( _bExportAutoStyle )
+ {
+ exportSectionAutoStyle(_xReportDefinition->getDetail());
+ }
+ else
+ {
+ SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_DETAIL, sal_True, sal_True);
+ exportSection(_xReportDefinition->getDetail());
+ }
+ }
+ }
+ return bGroupExported;
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportAutoStyle(XPropertySet* _xProp)
+{
+ uno::Reference<report::XReportControlFormat> xFormat(_xProp,uno::UNO_QUERY);
+ if ( xFormat.is() )
+ {
+ try
+ {
+ awt::FontDescriptor aFont = xFormat->getFontDescriptor();
+ GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,aFont.Family,aFont.Pitch,aFont.CharSet );
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ // not interested in
+ }
+ }
+ uno::Reference< report::XShape> xShape(_xProp,uno::UNO_QUERY);
+ if ( xShape.is() )
+ {
+ ::std::vector< XMLPropertyState > aPropertyStates( m_xParaPropMapper->Filter(_xProp) );
+ if ( !aPropertyStates.empty() )
+ m_aAutoStyleNames.insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TEXT_PARAGRAPH, aPropertyStates )));
+ }
+ ::std::vector< XMLPropertyState > aPropertyStates( m_xCellStylesExportPropertySetMapper->Filter(_xProp) );
+ Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY);
+ if ( xFixedLine.is() )
+ {
+ uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet();
+ table::BorderLine aValue;
+ aValue.Color = COL_BLACK;
+ aValue.InnerLineWidth = aValue.LineDistance = 0;
+ aValue.OuterLineWidth = 2;
+
+ awt::Point aPos = xFixedLine->getPosition();
+ awt::Size aSize = xFixedLine->getSize();
+ sal_Int32 nSectionHeight = xFixedLine->getSection()->getHeight();
+
+ ::rtl::OUString sBorderProp;
+ ::std::vector< ::rtl::OUString> aProps;
+ if ( xFixedLine->getOrientation() == 1 ) // vertical
+ {
+ // check if border should be left
+ if ( !aPos.X )
+ {
+ sBorderProp = PROPERTY_BORDERLEFT;
+ aProps.push_back(PROPERTY_BORDERRIGHT);
+ }
+ else
+ {
+ sBorderProp = PROPERTY_BORDERRIGHT;
+ aProps.push_back(PROPERTY_BORDERLEFT);
+ }
+ aProps.push_back(PROPERTY_BORDERTOP);
+ aProps.push_back(PROPERTY_BORDERBOTTOM);
+ }
+ else // horizontal
+ {
+ // check if border should be bottom
+ if ( (aPos.Y + aSize.Height) == nSectionHeight )
+ {
+ sBorderProp = PROPERTY_BORDERBOTTOM;
+ aProps.push_back(PROPERTY_BORDERTOP);
+ }
+ else
+ {
+ sBorderProp = PROPERTY_BORDERTOP;
+ aProps.push_back(PROPERTY_BORDERBOTTOM);
+ }
+ aProps.push_back(PROPERTY_BORDERRIGHT);
+ aProps.push_back(PROPERTY_BORDERLEFT);
+ }
+
+ xBorderProp->setPropertyValue(sBorderProp,uno::makeAny(aValue));
+
+ aValue.Color = aValue.OuterLineWidth = 0;
+ uno::Any aEmpty;
+ aEmpty <<= aValue;
+ ::std::for_each(aProps.begin(),aProps.end(),
+ ::boost::bind(&beans::XPropertySet::setPropertyValue,xBorderProp,_1,aEmpty));
+
+ ::std::vector< XMLPropertyState > aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(xBorderProp));
+ ::std::copy(aBorderStates.begin(),aBorderStates.end(),::std::back_inserter(aPropertyStates));
+ }
+ else
+ {
+ sal_Int32 nTextAlignIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_SD_SHAPE_PARA_ADJUST );
+ if ( nTextAlignIndex != -1 )
+ {
+ ::std::vector< XMLPropertyState >::iterator aIter = aPropertyStates.begin();
+ ::std::vector< XMLPropertyState >::iterator aEnd = aPropertyStates.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ if ( aIter->mnIndex == nTextAlignIndex )
+ {
+ sal_Int16 nTextAlign = 0;
+ aIter->maValue >>= nTextAlign;
+ switch(nTextAlign)
+ {
+ case awt::TextAlign::LEFT:
+ nTextAlign = style::ParagraphAdjust_LEFT;
+ break;
+ case awt::TextAlign::CENTER:
+ nTextAlign = style::ParagraphAdjust_CENTER;
+ break;
+ case awt::TextAlign::RIGHT:
+ nTextAlign = style::ParagraphAdjust_RIGHT;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ aIter->maValue <<= nTextAlign;
+ break;
+ }
+ }
+ }
+ Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY);
+ if ( xFormattedField.is() && !aPropertyStates.empty() )
+ {
+ sal_Int32 nNumberFormat = xFormattedField->getFormatKey();
+ {
+ sal_Int32 nStyleMapIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_RPT_NUMBERFORMAT );
+ addDataStyle(nNumberFormat);
+ XMLPropertyState aNumberStyleState( nStyleMapIndex, uno::makeAny( getDataStyleName(nNumberFormat) ) );
+ aPropertyStates.push_back( aNumberStyleState );
+ }
+ }
+ }
+
+
+ if ( !aPropertyStates.empty() )
+ m_aAutoStyleNames.insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_CELL, aPropertyStates )));
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp)
+{
+ ::std::vector< XMLPropertyState > aPropertyStates( m_xTableStylesExportPropertySetMapper->Filter(_xProp.get()) );
+ if ( !aPropertyStates.empty() )
+ m_aAutoStyleNames.insert( TPropertyStyleMap::value_type(_xProp.get(),GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_TABLE, aPropertyStates )));
+}
+// -----------------------------------------------------------------------------
+void ORptExport::SetBodyAttributes()
+{
+ Reference<XReportDefinition> xProp(getReportDefinition());
+ if ( xProp.is() )
+ {
+ ::rtl::OUStringBuffer sValue;
+ const SvXMLEnumMapEntry* aXML_CommnadTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, static_cast<sal_uInt16>(xProp->getCommandType()),aXML_CommnadTypeEnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,sValue.makeStringAndClear());
+
+ ::rtl::OUString sComamnd = xProp->getCommand();
+ if ( sComamnd.getLength() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND, sComamnd);
+
+ ::rtl::OUString sFilter( xProp->getFilter() );
+ if ( sFilter.getLength() )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_FILTER, sFilter );
+
+ AddAttribute(XML_NAMESPACE_OFFICE, XML_MIMETYPE,xProp->getMimeType());
+
+ sal_Bool bEscapeProcessing( xProp->getEscapeProcessing() );
+ if ( !bEscapeProcessing )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING, ::xmloff::token::GetXMLToken( XML_FALSE ) );
+
+ ::rtl::OUString sName = xProp->getCaption();
+ if ( sName.getLength() )
+ AddAttribute(XML_NAMESPACE_OFFICE, XML_CAPTION,sName);
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::_ExportContent()
+{
+ exportReport(getReportDefinition());
+}
+// -----------------------------------------------------------------------------
+void ORptExport::_ExportMasterStyles()
+{
+ GetPageExport()->exportMasterStyles( sal_True );
+}
+// -----------------------------------------------------------------------------
+void ORptExport::collectComponentStyles()
+{
+ if ( m_bAllreadyFilled )
+ return;
+
+ m_bAllreadyFilled = sal_True;
+ Reference<XReportDefinition> xProp(getReportDefinition());
+ if ( xProp.is() )
+ {
+ uno::Reference< report::XSection> xParent(xProp->getParent(),uno::UNO_QUERY);
+ if ( xParent.is() )
+ exportAutoStyle(xProp.get());
+
+ if ( xProp->getReportHeaderOn() )
+ exportSectionAutoStyle(xProp->getReportHeader());
+ if ( xProp->getPageHeaderOn() )
+ exportSectionAutoStyle(xProp->getPageHeader());
+
+ exportGroup(xProp,0,sal_True);
+
+ if ( xProp->getPageFooterOn() )
+ exportSectionAutoStyle(xProp->getPageFooter());
+ if ( xProp->getReportFooterOn() )
+ exportSectionAutoStyle(xProp->getReportFooter());
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::_ExportAutoStyles()
+{
+ // there are no styles that require their own autostyles
+ if ( getExportFlags() & EXPORT_CONTENT )
+ {
+ collectComponentStyles();
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_TABLE
+ ,GetDocHandler()
+ ,GetMM100UnitConverter()
+ ,GetNamespaceMap()
+ );
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_COLUMN
+ ,GetDocHandler()
+ ,GetMM100UnitConverter()
+ ,GetNamespaceMap()
+ );
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_ROW
+ ,GetDocHandler()
+ ,GetMM100UnitConverter()
+ ,GetNamespaceMap()
+ );
+
+ GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_TABLE_CELL
+ ,GetDocHandler()
+ ,GetMM100UnitConverter()
+ ,GetNamespaceMap()
+ );
+
+
+ /*GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_REPORT_ID
+ ,GetDocHandler()
+ ,GetMM100UnitConverter()
+ ,GetNamespaceMap()
+ );*/
+ exportDataStyles();
+ GetShapeExport()->exportAutoStyles();
+ }
+ // exported in _ExportMasterStyles
+ if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 )
+ GetPageExport()->collectAutoStyles( sal_False );
+ if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 )
+ GetPageExport()->exportAutoStyles();
+}
+// -----------------------------------------------------------------------------
+void ORptExport::_ExportStyles(BOOL bUsed)
+{
+ SvXMLExport::_ExportStyles(bUsed);
+
+ // write draw:style-name for object graphic-styles
+ GetShapeExport()->ExportGraphicDefaults();
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 ORptExport::exportDoc(enum ::xmloff::token::XMLTokenEnum eClass)
+{
+ return SvXMLExport::exportDoc( eClass );
+}
+// -----------------------------------------------------------------------------
+void ORptExport::GetViewSettings(Sequence<PropertyValue>& /*aProps*/)
+{
+ /*Reference<XReportDefinition> xReport(getReportDefinition());
+ if ( xReport.is() && (Reference<frame::XController > xController = xReport->getCurrentController()).is() )
+ {
+ xController->getViewData() >>= aProps;
+ }*/
+}
+// -----------------------------------------------------------------------------
+void ORptExport::GetConfigurationSettings(Sequence<PropertyValue>& /*aProps*/)
+{
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::implConvertNumber(sal_Int32 _nValue)
+{
+ ::rtl::OUStringBuffer aBuffer;
+ GetMM100UnitConverter().convertNumber(aBuffer, _nValue);
+ return aBuffer.makeStringAndClear();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::implConvertMeasure(sal_Int32 _nValue)
+{
+ ::rtl::OUStringBuffer aBuffer;
+ GetMM100UnitConverter().convertMeasure(aBuffer, _nValue);
+ return aBuffer.makeStringAndClear();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::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
+ GetMM100UnitConverter().convertDouble(aBuffer, getDouble(_rValue));
+ break;
+ case TypeClass_BOOLEAN:
+ aBuffer = getBOOL(_rValue) ? ::xmloff::token::GetXMLToken(XML_TRUE) : ::xmloff::token::GetXMLToken(XML_FALSE);
+ break;
+ case TypeClass_BYTE:
+ case TypeClass_SHORT:
+ case TypeClass_LONG:
+ // let the unit converter format is as string
+ GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue));
+ break;
+ default:
+ OSL_ENSURE(0,"ORptExport::implConvertAny: Invalid type");
+ }
+
+ return aBuffer.makeStringAndClear();
+}
+// -----------------------------------------------------------------------------
+UniReference < XMLPropertySetMapper > ORptExport::GetCellStylePropertyMapper() const
+{
+ return m_xCellStylesPropertySetMapper;
+}
+// -----------------------------------------------------------------------------
+SvXMLAutoStylePoolP* ORptExport::CreateAutoStylePool()
+{
+ return new OXMLAutoStylePoolP(*this);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ORptExport::setSourceDocument( const Reference< XComponent >& xDoc ) throw(IllegalArgumentException, RuntimeException)
+{
+ m_xReportDefinition.set(xDoc,UNO_QUERY_THROW);
+ OSL_ENSURE(m_xReportDefinition.is(),"DataSource is NULL!");
+
+ SetNumberFormatsSupplier(OXMLHelper::GetNumberFormatsSupplier(m_xReportDefinition));
+
+ SvXMLExport::setSourceDocument(xDoc);
+}
+// -----------------------------------------------------------------------------
+void ORptExport::_ExportFontDecls()
+{
+ GetFontAutoStylePool(); // make sure the pool is created
+ collectComponentStyles();
+ SvXMLExport::_ExportFontDecls();
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xReportElement)
+{
+ OSL_PRECOND(_xReportElement.is(),"Element is null!");
+ // start <text:p>
+ SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, sal_False, sal_False);
+ Reference< XFixedText > xFT(_xReportElement,UNO_QUERY);
+ if ( xFT.is() )
+ {
+ ::rtl::OUString sExpr = xFT->getLabel();
+ sal_Bool bPrevCharIsSpace = sal_False;
+ GetTextParagraphExport()->exportText(sExpr,bPrevCharIsSpace);
+ }
+}
+// -----------------------------------------------------------------------------
+XMLShapeExport* ORptExport::CreateShapeExport()
+{
+ XMLShapeExport* pShapeExport = new XMLShapeExport( *this, XMLTextParagraphExport::CreateShapeExtPropMapper( *this ) );
+ return pShapeExport;
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportShapes(const Reference< XSection>& _xSection)
+{
+ UniReference< XMLShapeExport > xShapeExport = GetShapeExport();
+ const sal_Int32 nCount = _xSection->getCount();
+ awt::Point aRefPoint;
+ aRefPoint.X = rptui::getStyleProperty<sal_Int32>(_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference< XShape > xShape(_xSection->getByIndex(i),uno::UNO_QUERY);
+ if ( xShape.is() )
+ {
+ SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, sal_False, sal_False);
+ AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, XML_PARAGRAPH );
+ xShapeExport->exportShape(xShape.get(),SEF_DEFAULT,&aRefPoint);
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx
new file mode 100644
index 000000000000..f2b2d120b39b
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExport.hxx
@@ -0,0 +1,327 @@
+#ifndef RPT_XMLEXPORT_HXX
+#define RPT_XMLEXPORT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlExport.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
+#include <com/sun/star/container/XNamed.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
+#include <com/sun/star/document/XFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
+#include <com/sun/star/document/XImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
+#include <com/sun/star/document/XExporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLMODEL_HPP_
+#include <com/sun/star/report/XReportControlModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
+#include <com/sun/star/lang/XComponent.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE5_HXX_
+#include <cppuhelper/implbase5.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _UNOTOOLS_TEMPFILE_HXX
+#include <unotools/tempfile.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALFILEHELPER_HXX
+#include <unotools/localfilehelper.hxx>
+#endif
+#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
+#include <unotools/ucbstreamhelper.hxx>
+#endif
+#ifndef _XMLOFF_XMLEXP_HXX
+#include <xmloff/xmlexp.hxx>
+#endif
+#ifndef _XMLOFF_XMLIMP_HXX
+#include <xmloff/xmlimp.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#include <memory>
+
+namespace rptxml
+{
+using namespace ::rtl;
+using namespace ::xmloff::token;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::report;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::xml::sax;
+// -------------
+// - ORptExport -
+// -------------
+#define PROGRESS_BAR_STEP 20
+
+class ORptExport : public SvXMLExport
+{
+public:
+ struct TCell
+ {
+ sal_Int32 nWidth;
+ sal_Int32 nHeight;
+ sal_Int32 nColSpan;
+ sal_Int32 nRowSpan;
+ Reference<XReportComponent> xElement;
+ bool bSet;
+ TCell( sal_Int32 _nWidth,
+ sal_Int32 _nHeight,
+ sal_Int32 _nColSpan,
+ sal_Int32 _nRowSpan,
+ Reference<XReportComponent> _xElement = Reference<XReportComponent>()) :
+ nWidth(_nWidth)
+ ,nHeight(_nHeight)
+ ,nColSpan(_nColSpan)
+ ,nRowSpan(_nRowSpan)
+ ,xElement(_xElement)
+ ,bSet(xElement.is())
+ {}
+
+ TCell( ) :
+ nWidth(0)
+ ,nHeight(0)
+ ,nColSpan(1)
+ ,nRowSpan(1)
+ ,bSet(true)
+ {}
+ };
+ typedef ::std::pair< ::rtl::OUString ,::rtl::OUString> TStringPair;
+ typedef struct
+ {
+ ::rtl::OUString sText;
+ ::rtl::OUString sField;
+ ::rtl::OUString sDecimal;
+ ::rtl::OUString sThousand;
+ } TDelimiter;
+ typedef ::std::vector< ::rtl::OUString> TStringVec;
+ typedef ::std::map< Reference<XPropertySet> ,::rtl::OUString > TPropertyStyleMap;
+ typedef ::std::map< Reference<XPropertySet> , TStringVec> TGridStyleMap;
+ typedef ::std::vector< TCell > TRow;
+ typedef ::std::vector< ::std::pair< sal_Bool, TRow > > TGrid;
+ typedef ::std::map< Reference<XPropertySet> ,TGrid > TSectionsGrid;
+private:
+ ::std::auto_ptr< TStringPair > m_aAutoIncrement;
+ ::std::auto_ptr< TDelimiter > m_aDelimiter;
+ ::std::vector< Any > m_aDataSourceSettings;
+ TSectionsGrid m_aSectionsGrid;
+
+ TPropertyStyleMap m_aAutoStyleNames;
+ TGridStyleMap m_aColumnStyleNames;
+ TGridStyleMap m_aRowStyleNames;
+
+ ::rtl::OUString m_sCharSet;
+ ::rtl::OUString m_sTableStyle;
+ ::rtl::OUString m_sCellStyle;
+ ::rtl::OUString m_sColumnStyle;
+ Any m_aPreviewMode;
+ UniReference < SvXMLExportPropertyMapper> m_xExportHelper;
+ UniReference < SvXMLExportPropertyMapper> m_xSectionPropMapper;
+ UniReference < SvXMLExportPropertyMapper> m_xTableStylesExportPropertySetMapper;
+ UniReference < SvXMLExportPropertyMapper> m_xCellStylesExportPropertySetMapper;
+ UniReference < SvXMLExportPropertyMapper> m_xColumnStylesExportPropertySetMapper;
+ UniReference < SvXMLExportPropertyMapper> m_xRowStylesExportPropertySetMapper;
+ UniReference < SvXMLExportPropertyMapper > m_xParaPropMapper;
+ UniReference < XMLPropertyHandlerFactory > m_xPropHdlFactory;
+
+ mutable UniReference < XMLPropertySetMapper > m_xControlStylePropertyMapper;
+ mutable UniReference < XMLPropertySetMapper > m_xColumnStylesPropertySetMapper;
+ mutable UniReference < XMLPropertySetMapper > m_xCellStylesPropertySetMapper;
+ Reference<XReportDefinition> m_xReportDefinition;
+ sal_Bool m_bAllreadyFilled;
+
+ void exportReport(const Reference<XReportDefinition>& _xReportDefinition); /// <element name="office:report">
+ void exportFunctions(const Reference<XIndexAccess>& _xFunctions); /// <ref name="rpt-function"/>
+ void exportMasterDetailFields(const Reference<XReportDefinition>& _xReportDefinition);
+ void exportComponent(const Reference<XReportComponent>& _xReportComponent);
+ void exportImagePosition(sal_Int16 _nImagePosition);
+ sal_Bool exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,sal_Bool _bExportAutoStyle = sal_False);
+ void exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt,const ::rtl::OUString& _sName);
+ void exportSection(const Reference<XSection>& _xProp,bool bHeader = false);
+ void exportContainer(const Reference< XSection>& _xSection);
+ void exportShapes(const Reference< XSection>& _xSection);
+ void exportTableColumns(const Reference< XSection>& _xSection);
+ void exportSectionAutoStyle(const Reference<XSection>& _xProp);
+ void exportReportElement(const Reference<XReportControlModel>& _xReportElement);
+ void exportFormatConditions(const Reference<XReportControlModel>& _xReportElement);
+ void exportAutoStyle(XPropertySet* _xProp);
+ void exportAutoStyle(const Reference<XSection>& _xProp);
+ void exportReportComponentAutoStyles(const Reference<XSection>& _xProp);
+ void collectComponentStyles();
+ void collectStyleNames(sal_Int32 _nFamily,const ::std::vector< sal_Int32>& _aSize, ORptExport::TStringVec& _rStyleNames);
+ void exportParagraph(const Reference< XReportControlModel >& _xReportElement);
+ bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const ::rtl::OUString& _sFormula);
+ ::rtl::OUString convertFormula(const ::rtl::OUString& _sFormula);
+
+ ::rtl::OUString implConvertAny(const Any& _rValue);
+ ::rtl::OUString implConvertNumber(sal_Int32 _nValue);
+ ::rtl::OUString implConvertMeasure(sal_Int32 _nValue);
+
+private:
+ ORptExport();
+ virtual void SetBodyAttributes();
+protected:
+
+ virtual void _ExportStyles( BOOL bUsed );
+ virtual void _ExportAutoStyles();
+ virtual void _ExportContent();
+ virtual void _ExportMasterStyles();
+ virtual void _ExportFontDecls();
+ virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass );
+ virtual SvXMLAutoStylePoolP* CreateAutoStylePool();
+ virtual XMLShapeExport* CreateShapeExport();
+
+ 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);
+
+ virtual ~ORptExport(){};
+public:
+
+ ORptExport(const Reference< XMultiServiceFactory >& _rxMSF, sal_uInt16 nExportFlag = (EXPORT_CONTENT | EXPORT_AUTOSTYLES | EXPORT_FONTDECLS));
+ // XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+
+ // 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);
+
+ inline Reference<XReportDefinition> getReportDefinition() const { return m_xReportDefinition; }
+
+ UniReference < XMLPropertySetMapper > GetCellStylePropertyMapper() const;
+};
+
+/** Exports only settings
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptExportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+/** Exports only content
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptContentExportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+/** Exports only styles
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptStylesExportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+/** Exports all
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ODBFullExportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLEXPORT_HXX
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx
new file mode 100644
index 000000000000..cf91fec0983a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFixedContent.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLFIXEDCONTENT_HXX
+#include "xmlFixedContent.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#include "xmlReportElement.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#ifndef RPT_XMLFIXEDTEXT_HXX
+#include "xmlFixedText.hxx"
+#endif
+#ifndef RPT_XMLCELL_HXX
+#include "xmlCell.hxx"
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#include <com/sun/star/text/ControlCharacter.hpp>
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+#include <xmloff/XMLCharContext.hxx>
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+
+class OXMLCharContent : public XMLCharContext
+{
+ OXMLFixedContent* m_pFixedContent;
+ OXMLCharContent(const OXMLCharContent&);
+ void operator =(const OXMLCharContent&);
+public:
+ OXMLCharContent(
+ SvXMLImport& rImport,
+ OXMLFixedContent* _pFixedContent,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList,
+ sal_Unicode c,
+ sal_Bool bCount );
+ OXMLCharContent(
+ SvXMLImport& rImport,
+ OXMLFixedContent* _pFixedContent,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList,
+ sal_Int16 nControl );
+
+ virtual void InsertControlCharacter(sal_Int16 _nControl);
+ virtual void InsertString(const ::rtl::OUString& _sString);
+};
+OXMLCharContent::OXMLCharContent(
+ SvXMLImport& rImport,
+ OXMLFixedContent* _pFixedContent,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList,
+ sal_Unicode c,
+ sal_Bool bCount )
+ : XMLCharContext(rImport,nPrfx,rLName,xAttrList,c,bCount)
+ ,m_pFixedContent(_pFixedContent)
+{
+}
+// -----------------------------------------------------------------------------
+OXMLCharContent::OXMLCharContent(
+ SvXMLImport& rImport,
+ OXMLFixedContent* _pFixedContent,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList,
+ sal_Int16 nControl )
+ : XMLCharContext(rImport,nPrfx,rLName,xAttrList,nControl)
+ ,m_pFixedContent(_pFixedContent)
+{
+}
+// -----------------------------------------------------------------------------
+void OXMLCharContent::InsertControlCharacter(sal_Int16 _nControl)
+{
+ switch( _nControl )
+ {
+ case ControlCharacter::LINE_BREAK:
+ m_pFixedContent->Characters(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n")));
+ break;
+ default:
+ OSL_ENSURE(0,"Not supported control character");
+ break;
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLCharContent::InsertString(const ::rtl::OUString& _sString)
+{
+ m_pFixedContent->Characters(_sString);
+}
+// -----------------------------------------------------------------------------
+
+DBG_NAME( rpt_OXMLFixedContent )
+
+OXMLFixedContent::OXMLFixedContent( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName
+ ,OXMLCell& _rCell
+ ,OXMLTable* _pContainer
+ ,bool _bInP) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,NULL,_pContainer)
+,m_rCell(_rCell)
+,m_bInP(_bInP)
+{
+ DBG_CTOR( rpt_OXMLFixedContent,NULL);
+}
+// -----------------------------------------------------------------------------
+
+OXMLFixedContent::~OXMLFixedContent()
+{
+
+ DBG_DTOR( rpt_OXMLFixedContent,NULL);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLFixedContent::_CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = OXMLReportElementBase::_CreateChildContext(nPrefix,rLocalName,xAttrList);
+ if ( pContext )
+ return pContext;
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetCellElemTokenMap();
+ Reference<XMultiServiceFactory> xFactor = m_rImport.getServiceFactory();
+
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
+ switch( nToken )
+ {
+ case XML_TOK_P:
+ pContext = new OXMLFixedContent(m_rImport,nPrefix, rLocalName,m_rCell,m_pContainer,true);
+ break;
+ case XML_TOK_TEXT_TAB_STOP:
+ pContext = new OXMLCharContent( m_rImport, this,nPrefix,
+ rLocalName, xAttrList,
+ 0x0009, sal_False );
+ break;
+
+ case XML_TOK_TEXT_LINE_BREAK:
+ pContext = new OXMLCharContent( m_rImport, this,nPrefix,
+ rLocalName, xAttrList,
+ ControlCharacter::LINE_BREAK );
+ break;
+
+ case XML_TOK_TEXT_S:
+ pContext = new OXMLCharContent( m_rImport, this,nPrefix,
+ rLocalName, xAttrList,
+ 0x0020, sal_True );
+ break;
+ }
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLFixedContent::EndElement()
+{
+ if ( m_bInP )
+ {
+ Reference<XMultiServiceFactory> xFactor(m_rImport.GetModel(),uno::UNO_QUERY);
+ Reference< XFixedText > xControl(xFactor->createInstance(SERVICE_FIXEDTEXT),uno::UNO_QUERY);
+ OSL_ENSURE(xControl.is(),"Could not create FixedContent!");
+ m_xComponent = xControl.get();
+ m_pContainer->addCell(m_xComponent);
+ m_rCell.setComponent(m_xComponent);
+ xControl->setLabel(m_sLabel);
+ OXMLReportElementBase::EndElement();
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLFixedContent::Characters( const ::rtl::OUString& rChars )
+{
+ m_sLabel += rChars;
+}
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.hxx b/reportdesign/source/filter/xml/xmlFixedContent.hxx
new file mode 100644
index 000000000000..3b42b2f0ee95
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFixedContent.hxx
@@ -0,0 +1,81 @@
+#ifndef RPT_XMLFIXEDCONTENT_HXX
+#define RPT_XMLFIXEDCONTENT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFixedContent.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_XSHAPES_HPP_
+#include <com/sun/star/drawing/XShapes.hpp>
+#endif
+
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLCell;
+ class OXMLFixedContent : public OXMLReportElementBase
+ {
+ ::rtl::OUString m_sLabel;
+ OXMLCell& m_rCell;
+ bool m_bInP;
+
+ protected:
+ virtual SvXMLImportContext* _CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ OXMLFixedContent(const OXMLFixedContent&);
+ void operator =(const OXMLFixedContent&);
+ public:
+
+ OXMLFixedContent( ORptFilter& rImport, sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName
+ ,OXMLCell& _rCell
+ ,OXMLTable* _pContainer
+ ,bool _bInP = false);
+ virtual ~OXMLFixedContent();
+
+ // This method is called for all characters that are contained in the
+ // current element. The default is to ignore them.
+ virtual void Characters( const ::rtl::OUString& rChars );
+
+ virtual void EndElement();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLFIXEDCONTENT_HXX
diff --git a/reportdesign/source/filter/xml/xmlFormatCondition.cxx b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
new file mode 100644
index 000000000000..a0124195cd84
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFormatCondition.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLFORMATCONDITION_HXX
+#include "xmlFormatCondition.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLFORMAT_HPP_
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::comphelper;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+ using namespace ::com::sun::star::beans;
+
+DBG_NAME( rpt_OXMLFormatCondition )
+
+OXMLFormatCondition::OXMLFormatCondition( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XFormatCondition > & _xComponent ) :
+ SvXMLImportContext( rImport, nPrfx, rLName )
+,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLFormatCondition,NULL);
+
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetFormatElemTokenMap();
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_ENABLED:
+ m_xComponent->setEnabled(sValue == s_sTRUE);
+ break;
+ case XML_TOK_FORMULA:
+ m_xComponent->setFormula(ORptFilter::convertFormula(sValue));
+ break;
+ case XML_TOK_FORMAT_STYLE_NAME:
+ m_sStyleName = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLFormatCondition::~OXMLFormatCondition()
+{
+
+ DBG_DTOR( rpt_OXMLFormatCondition,NULL);
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLFormatCondition::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLFormatCondition::EndElement()
+{
+ OXMLHelper::copyStyleElements(m_sStyleName,GetImport().GetAutoStyles(),m_xComponent.get());
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlFormatCondition.hxx b/reportdesign/source/filter/xml/xmlFormatCondition.hxx
new file mode 100644
index 000000000000..18c612fe4e1a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.hxx
@@ -0,0 +1,69 @@
+#ifndef RPT_XMLFORMATCONDITION_HXX
+#define RPT_XMLFORMATCONDITION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFormatCondition.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATCONDITION_HPP_
+#include <com/sun/star/report/XFormatCondition.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLFormatCondition : public SvXMLImportContext
+ {
+ ::rtl::OUString m_sStyleName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition > m_xComponent;
+ ORptFilter& GetOwnImport();
+ OXMLFormatCondition(const OXMLFormatCondition&);
+ void operator =(const OXMLFormatCondition&);
+ public:
+
+ OXMLFormatCondition( ORptFilter& rImport, sal_uInt16 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::report::XFormatCondition >& _xComponent
+ );
+ virtual ~OXMLFormatCondition();
+ virtual void EndElement();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLFORMATTEDFIELD_HXX
diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx
new file mode 100644
index 000000000000..fd266ec65443
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFormattedField.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLFORMATTEDFIELD_HXX
+#include "xmlFormattedField.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#include "xmlControlProperty.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#include "xmlReportElement.hxx"
+#endif
+#ifndef RPT_XMLCOMPONENT_HXX
+#include "xmlComponent.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace xml::sax;
+DBG_NAME( rpt_OXMLFormattedField )
+
+OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName
+ ,const uno::Reference< xml::sax::XAttributeList > & _xAttrList
+ ,const uno::Reference< XFormattedField > & _xComponent
+ ,OXMLTable* _pContainer
+ ,bool _bPageCount) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer)
+{
+ DBG_CTOR( rpt_OXMLFormattedField,NULL);
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetControlElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_DATA_FORMULA:
+ _xComponent->setDataField(ORptFilter::convertFormula(sValue));
+ break;
+ case XML_TOK_SELECT_PAGE:
+ {
+ static const ::rtl::OUString s_sPageNumber(RTL_CONSTASCII_USTRINGPARAM("rpt:PageNumber()"));
+ _xComponent->setDataField(s_sPageNumber);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if ( _bPageCount )
+ {
+ static const ::rtl::OUString s_sPageNumber(RTL_CONSTASCII_USTRINGPARAM("rpt:PageCount()"));
+ _xComponent->setDataField(s_sPageNumber);
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+}
+// -----------------------------------------------------------------------------
+OXMLFormattedField::~OXMLFormattedField()
+{
+ DBG_DTOR( rpt_OXMLFormattedField,NULL);
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlFormattedField.hxx b/reportdesign/source/filter/xml/xmlFormattedField.hxx
new file mode 100644
index 000000000000..1fbcd1af3e47
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormattedField.hxx
@@ -0,0 +1,67 @@
+#ifndef RPT_XMLFORMATTEDFIELD_HXX
+#define RPT_XMLFORMATTEDFIELD_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFormattedField.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLFormattedField : public OXMLReportElementBase
+ {
+ OXMLFormattedField(const OXMLFormattedField&);
+ void operator =(const OXMLFormattedField&);
+ public:
+
+ OXMLFormattedField( ORptFilter& rImport
+ ,sal_uInt16 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::report::XFormattedField >& _xComponent
+ ,OXMLTable* _pContainer
+ ,bool _bPageCount);
+ virtual ~OXMLFormattedField();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLFORMATTEDFIELD_HXX
diff --git a/reportdesign/source/filter/xml/xmlFunction.cxx b/reportdesign/source/filter/xml/xmlFunction.cxx
new file mode 100644
index 000000000000..4f60d7a26e31
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFunction.cxx
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFunction.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLFUNCTION_HXX
+#include "xmlFunction.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#include "xmlstrings.hrc"
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::xml::sax;
+
+DBG_NAME( rpt_OXMLFunction )
+
+OXMLFunction::OXMLFunction( ORptFilter& _rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XFunctionsSupplier >& _xFunctions
+ ) :
+ SvXMLImportContext( _rImport, nPrfx, _sLocalName )
+ ,m_xFunctions(_xFunctions->getFunctions())
+{
+ DBG_CTOR( rpt_OXMLFunction,NULL);
+
+ OSL_ENSURE(m_xFunctions.is(),"Functions is NULL!");
+ m_xFunction = m_xFunctions->createFunction();
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+
+ const SvXMLNamespaceMap& rMap = _rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = _rImport.GetFunctionElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ try
+ {
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_FUNCTION_NAME:
+ m_xFunction->setName(sValue);
+ break;
+ case XML_TOK_FUNCTION_FORMULA:
+ m_xFunction->setFormula(ORptFilter::convertFormula(sValue));
+ break;
+ case XML_TOK_PRE_EVALUATED:
+ m_xFunction->setPreEvaluated(sValue == s_sTRUE);
+ break;
+ case XML_TOK_INITIAL_FORMULA:
+ m_xFunction->setInitialFormula(beans::Optional< ::rtl::OUString>(sal_True,ORptFilter::convertFormula(sValue)));
+ break;
+ case XML_TOK_DEEP_TRAVERSING:
+ m_xFunction->setDeepTraversing(sValue == s_sTRUE);
+ break;
+ default:
+ break;
+ }
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while putting Function props!");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLFunction::~OXMLFunction()
+{
+ DBG_DTOR( rpt_OXMLFunction,NULL);
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLFunction::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLFunction::EndElement()
+{
+ try
+ {
+ m_xFunctions->insertByIndex(m_xFunctions->getCount(),uno::makeAny(m_xFunction));
+ m_xFunction.clear();
+ }catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched!");
+ }
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlFunction.hxx b/reportdesign/source/filter/xml/xmlFunction.hxx
new file mode 100644
index 000000000000..42066872e004
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFunction.hxx
@@ -0,0 +1,81 @@
+#ifndef RPT_XMLFUNCTION_HXX
+#define RPT_XMLFUNCTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlFunction.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTIONSSUPPLIER_HPP_
+#include <com/sun/star/report/XFunctionsSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFUNCTIONS_HPP_
+#include <com/sun/star/report/XFunctions.hpp>
+#endif
+
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLFunction : public SvXMLImportContext
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctions > m_xFunctions;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > m_xFunction;
+
+ ORptFilter& GetOwnImport();
+
+ OXMLFunction(const OXMLFunction&);
+ void operator =(const OXMLFunction&);
+ public:
+
+ OXMLFunction( ORptFilter& rImport
+ , sal_uInt16 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::report::XFunctionsSupplier >& _xFunctions
+ );
+ virtual ~OXMLFunction();
+
+ virtual void EndElement();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLFunction_HXX
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
new file mode 100644
index 000000000000..104bebcdda7d
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlGroup.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLGROUP_HXX
+#include "xmlGroup.hxx"
+#endif
+#ifndef RPT_XMLSECTION_HXX
+#include "xmlSection.hxx"
+#endif
+#ifndef RPT_XMLFUNCTION_HXX
+#include "xmlFunction.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _UCBHELPER_CONTENT_HXX
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_GROUPON_HPP_
+#include <com/sun/star/report/GroupOn.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_KEEPTOGETHER_HPP_
+#include <com/sun/star/report/KeepTogether.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::xml::sax;
+
+ sal_uInt16 lcl_getKeepTogetherOption(const ::rtl::OUString& _sValue)
+ {
+ sal_uInt16 nRet = report::KeepTogether::NO;
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions();
+ SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
+ return nRet;
+ }
+DBG_NAME( rpt_OXMLGroup )
+
+OXMLGroup::OXMLGroup( ORptFilter& _rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ) :
+ SvXMLImportContext( _rImport, nPrfx, _sLocalName )
+{
+ DBG_CTOR( rpt_OXMLGroup,NULL);
+
+ m_xGroups = _rImport.getReportDefinition()->getGroups();
+ OSL_ENSURE(m_xGroups.is(),"Groups is NULL!");
+ m_xGroup = m_xGroups->createGroup();
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+
+ const SvXMLNamespaceMap& rMap = _rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = _rImport.GetGroupElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ ::rtl::OUString sLocalName;
+ const ::rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ ::rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ try
+ {
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_START_NEW_COLUMN:
+ m_xGroup->setStartNewColumn(sValue == s_sTRUE);
+ break;
+ case XML_TOK_RESET_PAGE_NUMBER:
+ m_xGroup->setResetPageNumber(sValue == s_sTRUE);
+ break;
+ case XML_TOK_SORT_ASCENDING:
+ m_xGroup->setSortAscending(sValue == s_sTRUE);
+ break;
+ case XML_TOK_GROUP_EXPRESSION:
+ {
+ sal_Int32 nLen = sValue.getLength();
+ if ( nLen )
+ {
+ const static ::rtl::OUString s_sChanged(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
+ sal_Int32 nPos = sValue.indexOf(s_sChanged);
+ if ( nPos == -1 )
+ nPos = 5;
+ else
+ {
+ nPos = s_sChanged.getLength();
+ --nLen;
+ }
+ sValue = sValue.copy(nPos,nLen-nPos-1);
+ m_xGroup->setExpression(sValue);
+ }
+ }
+ break;
+ case XML_TOK_GROUP_KEEP_TOGETHER:
+ m_xGroup->setKeepTogether(lcl_getKeepTogetherOption(sValue));
+ break;
+ default:
+ break;
+ }
+ }
+ catch(const Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while putting group props!");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLGroup::~OXMLGroup()
+{
+
+ DBG_DTOR( rpt_OXMLGroup,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLGroup::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetGroupElemTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_GROUP_FUNCTION:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLFunction( rImport, nPrefix, rLocalName,xAttrList,m_xGroup.get());
+ }
+ break;
+ case XML_TOK_GROUP_HEADER:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xGroup->setHeaderOn(sal_True);
+ pContext = new OXMLSection( rImport, nPrefix, rLocalName,xAttrList,m_xGroup->getHeader());
+ }
+ break;
+ case XML_TOK_GROUP_GROUP:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLGroup( rImport, nPrefix, rLocalName,xAttrList);
+ break;
+ case XML_TOK_GROUP_DETAIL:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ Reference<XReportDefinition> m_xComponent = rImport.getReportDefinition();
+ pContext = new OXMLSection( rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getDetail());
+ }
+ break;
+
+ case XML_TOK_GROUP_FOOTER:
+ {
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xGroup->setFooterOn(sal_True);
+ pContext = new OXMLSection( rImport, nPrefix, rLocalName,xAttrList,m_xGroup->getFooter());
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLGroup::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLGroup::EndElement()
+{
+ try
+ {
+ // the group elements end in the reverse order
+ m_xGroups->insertByIndex(0,uno::makeAny(m_xGroup));
+ }catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched!");
+ }
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlGroup.hxx b/reportdesign/source/filter/xml/xmlGroup.hxx
new file mode 100644
index 000000000000..76c98a4720f3
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlGroup.hxx
@@ -0,0 +1,80 @@
+#ifndef RPT_XMLGROUP_HXX
+#define RPT_XMLGROUP_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlGroup.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XGROUPS_HPP_
+#include <com/sun/star/report/XGroups.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLGroup : public SvXMLImportContext
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups > m_xGroups;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup > m_xGroup;
+
+ ORptFilter& GetOwnImport();
+
+ OXMLGroup(const OXMLGroup&);
+ void operator =(const OXMLGroup&);
+ public:
+
+ OXMLGroup( ORptFilter& rImport
+ , sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
+ );
+ virtual ~OXMLGroup();
+
+ 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();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLGROUP_HXX
diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx
new file mode 100644
index 000000000000..20d8861ae88e
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -0,0 +1,487 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlHelper.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_FAMILIES_HXX_
+#include <xmloff/families.hxx>
+#endif
+#include <connectivity/dbtools.hxx>
+#include <comphelper/propertysethelper.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_TEXTALIGN_HPP_
+#include <com/sun/star/awt/TextAlign.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_IMAGEPOSITION_HPP_
+#include <com/sun/star/awt/ImagePosition.hpp>
+#endif
+#ifndef _XMLOFF_PRSTYLEI_HXX_
+#include <xmloff/prstylei.hxx>
+#endif
+#include "xmlstrings.hrc"
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _XMLOFF_CONTEXTID_HXX_
+#include <xmloff/contextid.hxx>
+#endif
+#ifndef _XMLOFF_TEXTPRMAP_HXX_
+#include <xmloff/txtprmap.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XOFFICEDATABASEDOCUMENT_HPP_
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#endif
+#include <com/sun/star/table/BorderLine.hpp>
+#ifndef _XMLOFF_XMLCONSTANTSPROPERTYHANDLER_HXX
+#include <xmloff/XMLConstantsPropertyHandler.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_FORCENEWPAGE_HPP_
+#include <com/sun/star/report/ForceNewPage.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_REPORTPRINTOPTION_HPP_
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_GROUPON_HPP_
+#include <com/sun/star/report/GroupOn.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_KEEPTOGETHER_HPP_
+#include <com/sun/star/report/KeepTogether.hpp>
+#endif
+#ifndef _XMLOFF_XMLEMENT_HXX
+#include <xmloff/xmlement.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLFORMAT_HPP_
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FORM_LISTSOURCETYPE_HPP_
+#include <com/sun/star/form/ListSourceType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DRAWING_TEXTVERTICALADJUST_HPP_
+#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
+#endif
+#ifndef _XMLOFF_ENUMPROPERTYHANDLER_HXX
+#include <xmloff/EnumPropertyHdl.hxx>
+#endif
+
+#define XML_RPT_ALGINMENT (XML_DB_TYPES_START+1)
+namespace rptxml
+{
+ using namespace ::xmloff::token;
+ using namespace ::com::sun::star::awt;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::sdb;
+ using namespace ::com::sun::star::form;
+ using namespace ::com::sun::star::beans;
+
+OPropertyHandlerFactory::OPropertyHandlerFactory()
+{
+}
+// -----------------------------------------------------------------------------
+OPropertyHandlerFactory::~OPropertyHandlerFactory()
+{
+}
+// -----------------------------------------------------------------------------
+const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 _nType) const
+{
+ const XMLPropertyHandler* pHandler = NULL;
+
+ switch(_nType)
+ {
+ case XML_RPT_ALGINMENT:
+ {
+ static 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 }
+ };
+
+ pHandler = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, ::getCppuType((const com::sun::star::drawing::TextVerticalAdjust*)0) );
+ }
+ break;
+ default:
+ ;
+ }
+
+ if ( !pHandler )
+ pHandler = OControlPropertyHandlerFactory::GetPropertyHandler(_nType);
+ return pHandler;
+}
+// -----------------------------------------------------------------------------
+#define MAP_CONST( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TEXT, context }
+#define MAP_CONST_T( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE, context }
+#define MAP_CONST_ASCII_T( name, prefix, token, type, context ) { name, sizeof(name)-1,XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE, context }
+#define MAP_CONST_P( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_PARAGRAPH, context }
+#define MAP_CONST_S( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_SECTION, context }
+#define MAP_CONST_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TEXT, context }
+#define GMAP( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_GRAPHIC, context }
+#define MAP_CONST_C_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context }
+#define MAP_CONST_C( name, prefix, token, type, context ) { name, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context }
+#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0}
+// -----------------------------------------------------------------------------
+UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap()
+{
+ static const XMLPropertyMapEntry s_aXMLCellStylesProperties[] =
+ {
+ MAP_CONST_C( PROPERTY_FORMATKEY, STYLE, DATA_STYLE_NAME, XML_TYPE_NUMBER | MID_FLAG_SPECIAL_ITEM, CTF_RPT_NUMBERFORMAT ),
+
+ MAP_CONST_P( PROPERTY_CONTROLBACKGROUND,
+ FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
+ MAP_CONST_P( PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
+ FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
+ MAP_CONST_C_ASCII( "BorderLeft", FO, BORDER_LEFT, XML_TYPE_BORDER, 0 ),
+ MAP_CONST_C_ASCII( "BorderRight", FO, BORDER_RIGHT, XML_TYPE_BORDER, 0 ),
+ MAP_CONST_C_ASCII( "BorderTop", FO, BORDER_TOP, XML_TYPE_BORDER, 0 ),
+ MAP_CONST_C_ASCII( "BorderBottom", FO, BORDER_BOTTOM, XML_TYPE_BORDER, 0 ),
+ MAP_END()
+ };
+ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory());
+}
+// -----------------------------------------------------------------------------
+const XMLPropertyMapEntry* OXMLHelper::GetTableStyleProps()
+{
+ static const XMLPropertyMapEntry aXMLTableStylesProperties[] =
+ {
+ MAP_CONST_T( PROPERTY_BACKCOLOR, FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
+ MAP_CONST_T( PROPERTY_BACKTRANSPARENT,FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ),
+ // MAP_CONST_T( PROPERTY_KEEPTOGETHER, STYLE, MAY_BREAK_BETWEEN_ROWS, XML_TYPE_BOOL , 0 ),
+ MAP_END()
+ };
+ return aXMLTableStylesProperties;
+}
+// -----------------------------------------------------------------------------
+const XMLPropertyMapEntry* OXMLHelper::GetRowStyleProps()
+{
+ static const XMLPropertyMapEntry aXMLStylesProperties[] =
+ {
+ MAP_CONST_S( "Height", STYLE, ROW_HEIGHT, XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, 0),
+ MAP_END()
+ };
+ return aXMLStylesProperties;
+}
+// -----------------------------------------------------------------------------
+const XMLPropertyMapEntry* OXMLHelper::GetColumnStyleProps()
+{
+ static const XMLPropertyMapEntry aXMLColumnStylesProperties[] =
+ {
+ //MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_BREAKBEFORE, 0),
+ //MAP( "IsVisible", XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_EQUAL|MID_FLAG_SPECIAL_ITEM, CTF_SC_ISVISIBLE ),
+ MAP_CONST_S( "Width", STYLE, COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_MEASURE, 0 ),
+ // MAP( "OptimalWidth", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_BOOL, 0),
+ MAP_END()
+ };
+ return aXMLColumnStylesProperties;
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetReportPrintOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ // { XML_ALL_PAGES, report::ReportPrintOption::ALL_PAGES }, // default
+ { XML_NOT_WITH_REPORT_HEADER, report::ReportPrintOption::NOT_WITH_REPORT_HEADER },
+ { XML_NOT_WITH_REPORT_FOOTER, report::ReportPrintOption::NOT_WITH_REPORT_FOOTER },
+ { XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER, report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetForceNewPageOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ // { XML_NONE, report::ForceNewPage::NONE }, // default
+ { XML_BEFORE_SECTION, report::ForceNewPage::BEFORE_SECTION },
+ { XML_AFTER_SECTION, report::ForceNewPage::AFTER_SECTION },
+ { XML_BEFORE_AFTER_SECTION, report::ForceNewPage::BEFORE_AFTER_SECTION },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+//// -----------------------------------------------------------------------------
+//const SvXMLEnumMapEntry* OXMLHelper::GetGroupOnOptions()
+//{
+// static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+// {
+// // { XML_DEFAULT ,report::GroupOn::DEFAULT }, // default
+// { XML_PREFIX_CHARACTERS ,report::GroupOn::PREFIX_CHARACTERS },
+// { XML_YEAR ,report::GroupOn::YEAR },
+// { XML_QUARTAL , report::GroupOn::QUARTAL },
+// { XML_MONTH , report::GroupOn::MONTH },
+// { XML_WEEK , report::GroupOn::WEEK },
+// { XML_DAY , report::GroupOn::DAY },
+// { XML_HOUR , report::GroupOn::HOUR },
+// { XML_MINUTE , report::GroupOn::MINUTE },
+// { XML_INTERVAL , report::GroupOn::INTERVAL },
+// { XML_TOKEN_INVALID, 0 }
+// };
+// return s_aXML_EnumMap;
+//}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetKeepTogetherOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ // { XML_NO, report::KeepTogether::NO }, // default
+ { XML_WHOLE_GROUP, report::KeepTogether::WHOLE_GROUP },
+ { XML_WITH_FIRST_DETAIL, report::KeepTogether::WITH_FIRST_DETAIL },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetImagePositionOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ { XML_START, 0 },
+ { XML_END, 1 },
+ { XML_TOP, 2 },
+ { XML_BOTTOM, 3 },
+ { XML_CENTER, (sal_uInt16)-1 },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetImageAlignOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ { XML_START, 0 },
+ { XML_CENTER, 1 },
+ { XML_END, 2 },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetCommandTypeOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ { XML_TABLE, CommandType::TABLE },
+ { XML_QUERY, CommandType::QUERY },
+ // { XML_COMMAND, CommandType::COMMAND }, // default
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< util::XNumberFormatsSupplier > OXMLHelper::GetNumberFormatsSupplier(const uno::Reference<report::XReportDefinition>& _xReportDefinition)
+{
+ uno::Reference< util::XNumberFormatsSupplier > xSupplier;
+ uno::Reference< uno::XInterface> xParent = _xReportDefinition->getParent();
+ if ( xParent.is() )
+ {
+ uno::Reference< sdb::XOfficeDatabaseDocument > xDatabaseDocument(xParent,uno::UNO_QUERY);
+ if ( !xDatabaseDocument.is() )
+ {
+ uno::Reference< container::XChild> xChild(xParent,uno::UNO_QUERY);
+ while( !xDatabaseDocument.is() && xChild.is() )
+ {
+ xParent = xChild->getParent();
+ xDatabaseDocument.set(xParent,uno::UNO_QUERY);
+ xChild.set(xParent,uno::UNO_QUERY);
+ }
+ }
+ if ( xDatabaseDocument.is() )
+ {
+ uno::Reference<beans::XPropertySet> xProp(xDatabaseDocument->getDataSource(),uno::UNO_QUERY);
+ if ( xProp.is() )
+ xSupplier.set(xProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberFormatsSupplier"))),uno::UNO_QUERY);
+ }
+ }
+ else
+ {
+ ::comphelper::MediaDescriptor aDescriptor( _xReportDefinition->getArgs() );
+ uno::Sequence<beans::PropertyValue> aComponentData;
+ aComponentData = aDescriptor.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ComponentData")),aComponentData);
+ if ( aComponentData.getLength() )
+ {
+ ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData );
+ uno::Reference<sdbc::XConnection> xConnection;
+ xConnection = aComponentDataMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),xConnection);
+ xSupplier = dbtools::getNumberFormats(xConnection);
+ }
+ }
+ return xSupplier;
+}
+// -----------------------------------------------------------------------------
+#define PROPERTY_ID_FONTNAME 1
+#define PROPERTY_ID_FONTHEIGHT 2
+#define PROPERTY_ID_FONTWIDTH 3
+#define PROPERTY_ID_FONTSTYLENAME 4
+#define PROPERTY_ID_FONTFAMILY 5
+#define PROPERTY_ID_FONTCHARSET 6
+#define PROPERTY_ID_FONTPITCH 7
+#define PROPERTY_ID_FONTCHARWIDTH 8
+#define PROPERTY_ID_FONTWEIGHT 9
+#define PROPERTY_ID_FONTSLANT 10
+#define PROPERTY_ID_FONTUNDERLINE 11
+#define PROPERTY_ID_FONTSTRIKEOUT 12
+#define PROPERTY_ID_FONTORIENTATION 13
+#define PROPERTY_ID_FONTKERNING 14
+#define PROPERTY_ID_FONTWORDLINEMODE 15
+#define PROPERTY_ID_FONTTYPE 16
+void OXMLHelper::copyStyleElements(const ::rtl::OUString& _sStyleName,const SvXMLStylesContext* _pAutoStyles,const uno::Reference<beans::XPropertySet>& _xProp)
+{
+ if ( !_xProp.is() || !_sStyleName.getLength() || !_pAutoStyles )
+ return;
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName));
+ if ( pAutoStyle )
+ {
+ ::com::sun::star::awt::FontDescriptor aFont;
+ static comphelper::PropertyMapEntry pMap[] =
+ {
+ {PROPERTY_FONTNAME, static_cast<sal_uInt16>(PROPERTY_FONTNAME.length), PROPERTY_ID_FONTNAME, &::getCppuType(&aFont.Name) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_CHARFONTHEIGHT, static_cast<sal_uInt16>(PROPERTY_CHARFONTHEIGHT.length), PROPERTY_ID_FONTHEIGHT, &::getCppuType(&aFont.Height) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTWIDTH, static_cast<sal_uInt16>(PROPERTY_FONTWIDTH.length), PROPERTY_ID_FONTWIDTH, &::getCppuType(&aFont.Width) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTSTYLENAME, static_cast<sal_uInt16>(PROPERTY_FONTSTYLENAME.length), PROPERTY_ID_FONTSTYLENAME, &::getCppuType(&aFont.StyleName) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTFAMILY, static_cast<sal_uInt16>(PROPERTY_FONTFAMILY.length), PROPERTY_ID_FONTFAMILY, &::getCppuType(&aFont.Family) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTCHARSET, static_cast<sal_uInt16>(PROPERTY_FONTCHARSET.length), PROPERTY_ID_FONTCHARSET, &::getCppuType(&aFont.CharSet) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTPITCH, static_cast<sal_uInt16>(PROPERTY_FONTPITCH.length), PROPERTY_ID_FONTPITCH, &::getCppuType(&aFont.Pitch) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTCHARWIDTH, static_cast<sal_uInt16>(PROPERTY_FONTCHARWIDTH.length), PROPERTY_ID_FONTCHARWIDTH, &::getCppuType(&aFont.CharacterWidth),PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTWEIGHT, static_cast<sal_uInt16>(PROPERTY_FONTWEIGHT.length), PROPERTY_ID_FONTWEIGHT, &::getCppuType(&aFont.Weight) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTSLANT, static_cast<sal_uInt16>(PROPERTY_FONTSLANT.length), PROPERTY_ID_FONTSLANT, &::getCppuType(&aFont.Slant) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTUNDERLINE, static_cast<sal_uInt16>(PROPERTY_FONTUNDERLINE.length), PROPERTY_ID_FONTUNDERLINE, &::getCppuType(&aFont.Underline) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_CHARSTRIKEOUT, static_cast<sal_uInt16>(PROPERTY_CHARSTRIKEOUT.length), PROPERTY_ID_FONTSTRIKEOUT, &::getCppuType(&aFont.Strikeout) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTORIENTATION, static_cast<sal_uInt16>(PROPERTY_FONTORIENTATION.length), PROPERTY_ID_FONTORIENTATION, &::getCppuType(&aFont.Orientation) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTKERNING, static_cast<sal_uInt16>(PROPERTY_FONTKERNING.length), PROPERTY_ID_FONTKERNING, &::getCppuType(&aFont.Kerning) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_CHARWORDMODE, static_cast<sal_uInt16>(PROPERTY_CHARWORDMODE.length), PROPERTY_ID_FONTWORDLINEMODE, &::getCppuType(&aFont.WordLineMode) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_FONTTYPE, static_cast<sal_uInt16>(PROPERTY_FONTTYPE.length), PROPERTY_ID_FONTTYPE, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},
+ //{PROPERTY_BACKGROUNDCOLOR, static_cast<sal_uInt16>(PROPERTY_BACKGROUNDCOLOR.length), PROPERTY_ID_BACKGROUNDCOLOR, &::getCppuType(&nBackgroundColor) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_PARAADJUST, static_cast<sal_uInt16>(PROPERTY_PARAADJUST.length), PROPERTY_ID_ALIGN, &::getCppuType(&nAlign) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_CONTROLBORDER, static_cast<sal_uInt16>(PROPERTY_CONTROLBORDER.length), PROPERTY_ID_BORDER, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_CONTROLBORDERCOLOR, static_cast<sal_uInt16>(PROPERTY_CONTROLBORDERCOLOR.length), PROPERTY_ID_BORDERCOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_CHARCOLOR, static_cast<sal_uInt16>(PROPERTY_TEXTCOLOR.length), PROPERTY_ID_TEXTCOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_FORMATKEY, static_cast<sal_uInt16>(PROPERTY_FORMATKEY.length), PROPERTY_ID_FORMATKEY, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},,
+ //{PROPERTY_CHARUNDERLINECOLOR, static_cast<sal_uInt16>(PROPERTY_CHARUNDERLINECOLOR.length), PROPERTY_ID_TEXTLINECOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},,
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ try
+ {
+ uno::Reference<beans::XPropertySet> xProp = comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
+ pAutoStyle->FillPropertySet(xProp);
+ xProp->getPropertyValue(PROPERTY_FONTNAME) >>= aFont.Name;
+ xProp->getPropertyValue(PROPERTY_CHARFONTHEIGHT) >>= aFont.Height;
+ xProp->getPropertyValue(PROPERTY_FONTWIDTH) >>= aFont.Width;
+ xProp->getPropertyValue(PROPERTY_FONTSTYLENAME) >>= aFont.StyleName;
+ xProp->getPropertyValue(PROPERTY_FONTFAMILY) >>= aFont.Family;
+ xProp->getPropertyValue(PROPERTY_FONTCHARSET) >>= aFont.CharSet;
+ xProp->getPropertyValue(PROPERTY_FONTPITCH) >>= aFont.Pitch;
+ xProp->getPropertyValue(PROPERTY_FONTCHARWIDTH) >>= aFont.CharacterWidth;
+ xProp->getPropertyValue(PROPERTY_FONTWEIGHT) >>= aFont.Weight;
+ xProp->getPropertyValue(PROPERTY_FONTSLANT) >>= aFont.Slant;
+ xProp->getPropertyValue(PROPERTY_FONTUNDERLINE) >>= aFont.Underline;
+ xProp->getPropertyValue(PROPERTY_CHARSTRIKEOUT) >>= aFont.Strikeout;
+ xProp->getPropertyValue(PROPERTY_FONTORIENTATION) >>= aFont.Orientation;
+ xProp->getPropertyValue(PROPERTY_FONTKERNING) >>= aFont.Kerning;
+ xProp->getPropertyValue(PROPERTY_CHARWORDMODE) >>= aFont.WordLineMode;
+ xProp->getPropertyValue(PROPERTY_FONTTYPE) >>= aFont.Type;
+ uno::Reference<report::XReportControlFormat> xReportControlModel(_xProp,uno::UNO_QUERY);
+ if ( xReportControlModel.is() )
+ try
+ {
+ xReportControlModel->setFontDescriptor(aFont);
+ }
+ catch(beans::UnknownPropertyException){}
+ pAutoStyle->FillPropertySet(_xProp);
+ if ( xReportControlModel.is() )
+ {
+ sal_Int16 nTextAlign = xReportControlModel->getParaAdjust();
+ switch(nTextAlign)
+ {
+ case style::ParagraphAdjust_LEFT:
+ nTextAlign = awt::TextAlign::LEFT;
+ break;
+ case style::ParagraphAdjust_CENTER:
+ nTextAlign = awt::TextAlign::CENTER;
+ break;
+ case style::ParagraphAdjust_RIGHT:
+ nTextAlign = awt::TextAlign::RIGHT;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ xReportControlModel->setParaAdjust(nTextAlign);
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"OXMLHelper::copyStyleElements -> exception catched");
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference<beans::XPropertySet> OXMLHelper::createBorderPropertySet()
+{
+ static comphelper::PropertyMapEntry pMap[] =
+ {
+ {PROPERTY_BORDERLEFT, static_cast<sal_uInt16>(PROPERTY_BORDERLEFT.length), 0, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_BORDERRIGHT, static_cast<sal_uInt16>(PROPERTY_BORDERRIGHT.length), 1, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_BORDERTOP, static_cast<sal_uInt16>(PROPERTY_BORDERTOP.length), 2, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_BORDERBOTTOM, static_cast<sal_uInt16>(PROPERTY_BORDERBOTTOM.length), 3, &::getCppuType((const table::BorderLine*)0) ,PropertyAttribute::BOUND,0},
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ return comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
+}
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx
new file mode 100644
index 000000000000..fcf26c146e98
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlHelper.hxx
@@ -0,0 +1,112 @@
+#ifndef RPT_XMLHELPER_HXX
+#define RPT_XMLHELPER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlHelper.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:17 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
+#include <xmloff/xmlprmap.hxx>
+#endif
+#ifndef _XMLOFF_CONTEXTID_HXX_
+#include <xmloff/contextid.hxx>
+#endif
+#ifndef _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
+#include <xmloff/controlpropertyhdl.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#endif
+
+#include <memory>
+
+#define CTF_RPT_NUMBERFORMAT (XML_DB_CTF_START + 1)
+#define CTF_RPT_PARAVERTALIGNMENT (XML_DB_CTF_START + 2)
+
+#define XML_STYLE_FAMILY_REPORT_ID 700
+#define XML_STYLE_FAMILY_REPORT_NAME "report-element"
+#define XML_STYLE_FAMILY_REPORT_PREFIX "rptelem"
+
+
+class SvXMLImport;
+class SvXMLExport;
+class SvXMLStylesContext;
+namespace rptxml
+{
+ class OPropertyHandlerFactory : public ::xmloff::OControlPropertyHandlerFactory
+ {
+ OPropertyHandlerFactory(const OPropertyHandlerFactory&);
+ void operator =(const OPropertyHandlerFactory&);
+ protected:
+ mutable ::std::auto_ptr<XMLConstantsPropertyHandler> m_pDisplayHandler;
+ mutable ::std::auto_ptr<XMLPropertyHandler> m_pTextAlignHandler;
+ public:
+ OPropertyHandlerFactory();
+ virtual ~OPropertyHandlerFactory();
+
+ virtual const XMLPropertyHandler* GetPropertyHandler(sal_Int32 _nType) const;
+ };
+
+ class OXMLHelper
+ {
+ public:
+ static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap();
+
+ static const SvXMLEnumMapEntry* GetReportPrintOptions();
+ static const SvXMLEnumMapEntry* GetForceNewPageOptions();
+ static const SvXMLEnumMapEntry* GetKeepTogetherOptions();
+ static const SvXMLEnumMapEntry* GetImagePositionOptions();
+ static const SvXMLEnumMapEntry* GetImageAlignOptions();
+ static const SvXMLEnumMapEntry* GetCommandTypeOptions();
+
+ static const XMLPropertyMapEntry* GetTableStyleProps();
+ static const XMLPropertyMapEntry* GetColumnStyleProps();
+
+ static const XMLPropertyMapEntry* GetRowStyleProps();
+
+ static com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatsSupplier > GetNumberFormatsSupplier(const com::sun::star::uno::Reference< com::sun::star::report::XReportDefinition>& _xReportDefinition);
+
+ static void copyStyleElements(const ::rtl::OUString& _sStyleName,const SvXMLStylesContext* _pAutoStyles,const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet>& _xProp);
+ static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet> createBorderPropertySet();
+ };
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLHELPER_HXX
+
diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx
new file mode 100644
index 000000000000..9f68a974eaf0
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlImage.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLIMAGE_HXX
+#include "xmlImage.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCOMPONENT_HXX
+#include "xmlComponent.hxx"
+#endif
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#include "xmlReportElement.hxx"
+#endif
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#include "xmlControlProperty.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+DBG_NAME( rpt_OXMLImage )
+
+OXMLImage::OXMLImage( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XImageControl > & _xComponent
+ ,OXMLTable* _pContainer) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer)
+{
+ DBG_CTOR( rpt_OXMLImage,NULL);
+
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+ const SvXMLNamespaceMap& rMap = m_rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetControlElemTokenMap();
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_IMAGE_DATA:
+ _xComponent->setImageURL(rImport.GetAbsoluteReference( sValue ));
+ break;
+ case XML_TOK_PRESERVE_IRI:
+ _xComponent->setPreserveIRI(s_sTRUE == sValue);
+ break;
+ case XML_TOK_SCALE:
+ _xComponent->setScaleImage(s_sTRUE == sValue);
+ break;
+ case XML_TOK_DATA_FORMULA:
+ {
+ sal_Int32 nLen = sValue.getLength();
+ if ( nLen )
+ {
+ sValue = sValue.copy(5,nLen-6);
+ _xComponent->setDataField(sValue);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the image props");
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLImage::~OXMLImage()
+{
+
+ DBG_DTOR( rpt_OXMLImage,NULL);
+}
+// -----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlImage.hxx b/reportdesign/source/filter/xml/xmlImage.hxx
new file mode 100644
index 000000000000..2a5fc0e6eb4f
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImage.hxx
@@ -0,0 +1,65 @@
+#ifndef RPT_XMLIMAGE_HXX
+#define RPT_XMLIMAGE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlImage.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XImageControl_HPP_
+#include <com/sun/star/report/XImageControl.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLImage : public OXMLReportElementBase
+ {
+ OXMLImage(const OXMLImage&);
+ void operator =(const OXMLImage&);
+ public:
+
+ OXMLImage( ORptFilter& rImport, sal_uInt16 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::report::XImageControl >& _xComponent
+ ,OXMLTable* _pContainer);
+ virtual ~OXMLImage();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLIMAGE_HXX
diff --git a/reportdesign/source/filter/xml/xmlMasterFields.cxx b/reportdesign/source/filter/xml/xmlMasterFields.cxx
new file mode 100644
index 000000000000..b5f87575f317
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlMasterFields.cxx
@@ -0,0 +1,146 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlMasterFields.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLMASTERFIELDS_HXX
+#include "xmlMasterFields.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLSUBDOCUMENT_HXX
+#include "xmlSubDocument.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+DBG_NAME( rpt_OXMLMasterFields )
+
+OXMLMasterFields::OXMLMasterFields( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,OXMLSubDocument* _pSubDocument
+ ) :
+ SvXMLImportContext( rImport, nPrfx, rLName)
+,m_pSubDocument(_pSubDocument)
+{
+ DBG_CTOR( rpt_OXMLMasterFields,NULL);
+
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetSubDocumentElemTokenMap();
+
+ ::rtl::OUString sMasterField,sDetailField;
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_MASTER:
+ sMasterField = sValue;
+ break;
+ case XML_TOK_SUB_DETAIL:
+ sDetailField = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+ if ( !sDetailField.getLength() )
+ sDetailField = sMasterField;
+ m_pSubDocument->addFieldPair(::std::pair< ::rtl::OUString,::rtl::OUString >(sMasterField,sDetailField));
+}
+// -----------------------------------------------------------------------------
+
+OXMLMasterFields::~OXMLMasterFields()
+{
+ DBG_DTOR( rpt_OXMLMasterFields,NULL);
+}
+
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLMasterFields::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ const SvXMLTokenMap& rTokenMap = static_cast<ORptFilter&>(GetImport()).GetSubDocumentElemTokenMap();
+
+ switch( rTokenMap.Get( _nPrefix, _rLocalName ) )
+ {
+ case XML_TOK_MASTER_DETAIL_FIELD:
+ {
+ GetImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLMasterFields(static_cast<ORptFilter&>(GetImport()), _nPrefix, _rLocalName,xAttrList ,m_pSubDocument);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
+
+ return pContext;
+}
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlMasterFields.hxx b/reportdesign/source/filter/xml/xmlMasterFields.hxx
new file mode 100644
index 000000000000..a2f2dae27267
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlMasterFields.hxx
@@ -0,0 +1,67 @@
+#ifndef RPT_XMLMASTERFIELDS_HXX
+#define RPT_XMLMASTERFIELDS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlMasterFields.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLSubDocument;
+ class OXMLMasterFields : public SvXMLImportContext
+ {
+ OXMLSubDocument* m_pSubDocument;
+ OXMLMasterFields(const OXMLMasterFields&);
+ void operator =(const OXMLMasterFields&);
+ public:
+
+ OXMLMasterFields( ORptFilter& rImport, sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
+ ,OXMLSubDocument* _pSubDocument);
+ virtual ~OXMLMasterFields();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLMasterFields_HXX
diff --git a/reportdesign/source/filter/xml/xmlPropertyHandler.cxx b/reportdesign/source/filter/xml/xmlPropertyHandler.cxx
new file mode 100644
index 000000000000..dcf8e6e8cbd0
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlPropertyHandler.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlPropertyHandler.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlPropertyHandler.hxx"
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_TEXTIMP_HXX_
+#include <xmloff/txtimp.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+
+//--------------------------------------------------------------------------
+namespace rptxml
+{
+//--------------------------------------------------------------------------
+ using namespace ::com::sun::star;
+ using namespace xmloff;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+DBG_NAME( rpt_OXMLRptPropHdlFactory )
+
+OXMLRptPropHdlFactory::OXMLRptPropHdlFactory()
+{
+ DBG_CTOR( rpt_OXMLRptPropHdlFactory,NULL);
+
+}
+// -----------------------------------------------------------------------------
+OXMLRptPropHdlFactory::~OXMLRptPropHdlFactory()
+{
+
+ DBG_DTOR( rpt_OXMLRptPropHdlFactory,NULL);
+}
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlPropertyHandler.hxx b/reportdesign/source/filter/xml/xmlPropertyHandler.hxx
new file mode 100644
index 000000000000..4629327a2980
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlPropertyHandler.hxx
@@ -0,0 +1,62 @@
+#ifndef RPT_XMLPROPHANDLER_HXX
+#define RPT_XMLPROPHANDLER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlPropertyHandler.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
+#include <xmloff/xmlprmap.hxx>
+#endif
+#ifndef _XMLOFF_CONTEXTID_HXX_
+#include <xmloff/contextid.hxx>
+#endif
+#ifndef _XMLOFF_PROPERTYHANDLERFACTORY_HXX
+#include <xmloff/prhdlfac.hxx>
+#endif
+
+namespace rptxml
+{
+ class OXMLRptPropHdlFactory : public XMLPropertyHandlerFactory
+ {
+ private:
+ OXMLRptPropHdlFactory(const OXMLRptPropHdlFactory&);
+ void operator =(const OXMLRptPropHdlFactory&);
+ public:
+ OXMLRptPropHdlFactory();
+ virtual ~OXMLRptPropHdlFactory();
+ };
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
+#endif //RPT_XMLPROPHANDLER_HXX
+
diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx
new file mode 100644
index 000000000000..339d00dd9414
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReport.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLREPORT_HXX
+#include "xmlReport.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLGROUP_HXX
+#include "xmlGroup.hxx"
+#endif
+#ifndef RPT_XMLSECTION_HXX
+#include "xmlSection.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLFUNCTION_HXX
+#include "xmlFunction.hxx"
+#endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
+#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace uno;
+ using namespace xml::sax;
+
+ Sequence< ::rtl::OUString> lcl_getColumnNames(const ::rtl::OUString& _sValue)
+ {
+ String sColumns = _sValue;
+ Sequence< ::rtl::OUString> aSeq(sColumns.GetTokenCount(','));
+ ::rtl::OUString* pIter = aSeq.getArray();
+ ::rtl::OUString* pEnd = pIter + aSeq.getLength();
+ for(;pIter != pEnd;++pIter)
+ *pIter = sColumns.GetToken(',');
+ return aSeq;
+ }
+DBG_NAME( rpt_OXMLReport )
+
+OXMLReport::OXMLReport( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,const uno::Reference< report::XReportDefinition >& _xComponent
+ ,OXMLTable* _pContainer) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer)
+ ,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLReport,NULL);
+ OSL_ENSURE(m_xComponent.is(),"No Report definition!");
+
+ impl_initRuntimeDefaults();
+
+ const SvXMLNamespaceMap& rMap = m_rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetReportElemTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_COMMAND_TYPE:
+ {
+ sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
+ SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ m_xComponent->setCommandType(nRet);
+ }
+ break;
+ case XML_TOK_COMMAND:
+ m_xComponent->setCommand(sValue);
+ break;
+ case XML_TOK_FILTER:
+ m_xComponent->setFilter(sValue);
+ break;
+ case XML_TOK_CAPTION:
+ m_xComponent->setCaption(sValue);
+ break;
+ case XML_TOK_ESCAPE_PROCESSING:
+ m_xComponent->setEscapeProcessing(sValue == s_sTRUE);
+ break;
+ case XML_TOK_REPORT_MIMETYPE:
+ m_xComponent->setMimeType(sValue);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLReport::~OXMLReport()
+{
+ DBG_DTOR( rpt_OXMLReport,NULL);
+}
+
+// -----------------------------------------------------------------------------
+
+void OXMLReport::impl_initRuntimeDefaults() const
+{
+ OSL_PRECOND( m_xComponent.is(), "OXMLReport::impl_initRuntimeDefaults: no component!" );
+ if ( !m_xComponent.is() )
+ return;
+
+ try
+ {
+ m_xComponent->setCommandType( sdb::CommandType::COMMAND );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+SvXMLImportContext* OXMLReport::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = _CreateChildContext(nPrefix,rLocalName,xAttrList);
+ if ( pContext )
+ return pContext;
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetReportElemTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_REPORT_FUNCTION:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLFunction( m_rImport, nPrefix, rLocalName,xAttrList,m_xComponent.get());
+ }
+ break;
+ case XML_TOK_REPORT_HEADER:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xComponent->setReportHeaderOn(sal_True);
+ pContext = new OXMLSection( m_rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getReportHeader());
+ }
+ break;
+ case XML_TOK_PAGE_HEADER:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xComponent->setPageHeaderOn(sal_True);
+ pContext = new OXMLSection( m_rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getPageHeader());
+ }
+ break;
+ case XML_TOK_GROUP:
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLGroup( m_rImport, nPrefix, rLocalName,xAttrList);
+ break;
+ case XML_TOK_DETAIL:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLSection( m_rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getDetail());
+ }
+ break;
+ case XML_TOK_PAGE_FOOTER:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xComponent->setPageFooterOn(sal_True);
+ pContext = new OXMLSection( m_rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getPageFooter(),sal_False);
+ }
+ break;
+ case XML_TOK_REPORT_FOOTER:
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ m_xComponent->setReportFooterOn(sal_True);
+ pContext = new OXMLSection( m_rImport, nPrefix, rLocalName,xAttrList ,m_xComponent->getReportFooter());
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlReport.hxx b/reportdesign/source/filter/xml/xmlReport.hxx
new file mode 100644
index 000000000000..64c3b88dc73b
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReport.hxx
@@ -0,0 +1,73 @@
+#ifndef RPT_XMLREPORT_HXX
+#define RPT_XMLREPORT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReport.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLReport : public OXMLReportElementBase
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xComponent;
+ OXMLReport(const OXMLReport&);
+ void operator =(const OXMLReport&);
+ public:
+
+ OXMLReport( ORptFilter& rImport, sal_uInt16 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::report::XReportDefinition >& _xComponent
+ ,OXMLTable* _pContainer);
+ virtual ~OXMLReport();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ private:
+ /** initializes our object's properties whose runtime (API) default is different from the file
+ format default.
+ */
+ void impl_initRuntimeDefaults() const;
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLREPORT_HXX
diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx
new file mode 100644
index 000000000000..9aa731c16e9a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReportElement.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#include "xmlReportElement.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCOMPONENT_HXX
+#include "xmlComponent.hxx"
+#endif
+#ifndef RPT_XMLCONDPRTEXPR_HXX
+#include "xmlCondPrtExpr.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPT_XMLFORMATCONDITION_HXX
+#include "xmlFormatCondition.hxx"
+#endif
+
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace report;
+ using namespace uno;
+ using namespace xml::sax;
+DBG_NAME( rpt_OXMLReportElement )
+
+OXMLReportElement::OXMLReportElement( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XReportControlModel > & _xComponent) :
+ SvXMLImportContext( rImport, nPrfx, rLName )
+,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLReportElement,NULL);
+
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetReportElementElemTokenMap();
+
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE:
+ m_xComponent->setPrintWhenGroupChange(s_sTRUE == sValue);
+ break;
+ case XML_TOK_PRINT_REPEATED_VALUES:
+ m_xComponent->setPrintRepeatedValues(sValue == s_sTRUE ? sal_True : sal_False);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLReportElement::~OXMLReportElement()
+{
+
+ DBG_DTOR( rpt_OXMLReportElement,NULL);
+}
+// -----------------------------------------------------------------------------
+
+SvXMLImportContext* OXMLReportElement::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetReportElementElemTokenMap();
+
+ switch( rTokenMap.Get( _nPrefix, _rLocalName ) )
+ {
+ case XML_TOK_COMPONENT:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLComponent( rImport, _nPrefix, _rLocalName,xAttrList,m_xComponent.get());
+ break;
+ case XML_TOK_REP_CONDITIONAL_PRINT_EXPRESSION:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLCondPrtExpr( rImport, _nPrefix, _rLocalName,xAttrList,m_xComponent.get());
+ break;
+ case XML_TOK_FORMATCONDITION:
+ {
+ uno::Reference< report::XFormatCondition > xNewCond = m_xComponent->createFormatCondition();
+ m_xComponent->insertByIndex(m_xComponent->getCount(),uno::makeAny(xNewCond));
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLFormatCondition( rImport, _nPrefix, _rLocalName,xAttrList,xNewCond);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
+
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLReportElement::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlReportElement.hxx b/reportdesign/source/filter/xml/xmlReportElement.hxx
new file mode 100644
index 000000000000..108babbdc4be
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElement.hxx
@@ -0,0 +1,70 @@
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#define RPT_XMLREPORTELEMENT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReportElement.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLMODEL_HPP_
+#include <com/sun/star/report/XReportControlModel.hpp>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLReportElement : public SvXMLImportContext
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel > m_xComponent;
+ ORptFilter& GetOwnImport();
+ OXMLReportElement(const OXMLReportElement&);
+ void operator =(const OXMLReportElement&);
+ public:
+
+ OXMLReportElement( ORptFilter& rImport, sal_uInt16 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::report::XReportControlModel >& _xComponent);
+ virtual ~OXMLReportElement();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLREPORTELEMENT_HXX
diff --git a/reportdesign/source/filter/xml/xmlReportElementBase.cxx b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
new file mode 100644
index 000000000000..d53e2b6ad47d
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReportElementBase.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#include "xmlControlProperty.hxx"
+#endif
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#include "xmlReportElement.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+
+OXMLReportElementBase::OXMLReportElementBase( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ , const OUString& rLName
+ ,const Reference< XReportComponent > & _xComponent
+ ,OXMLTable* _pContainer) :
+ SvXMLImportContext( rImport, nPrfx, rLName )
+,m_rImport(rImport)
+,m_pContainer(_pContainer)
+,m_xComponent(_xComponent)
+{
+}
+// -----------------------------------------------------------------------------
+
+OXMLReportElementBase::~OXMLReportElementBase()
+{
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLReportElementBase::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = _CreateChildContext(nPrefix,rLocalName,xAttrList);
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLReportElementBase::_CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetControlElemTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_REPORT_ELEMENT:
+ {
+ uno::Reference<report::XReportControlModel> xReportModel(m_xComponent,uno::UNO_QUERY);
+ if ( xReportModel.is() )
+ {
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLReportElement( m_rImport, nPrefix, rLocalName,xAttrList,xReportModel);
+ }
+ }
+ break;
+ case XML_TOK_PROPERTIES:
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLControlProperty( m_rImport, nPrefix, rLocalName,xAttrList,m_xComponent.get());
+ break;
+ default:
+ break;
+ }
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLReportElementBase::EndElement()
+{
+ try
+ {
+ if ( m_pContainer && m_pContainer->getSection().is() && m_xComponent.is() )
+ m_pContainer->getSection()->add(m_xComponent.get());
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught while inserting a new control!");
+ }
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlReportElementBase.hxx b/reportdesign/source/filter/xml/xmlReportElementBase.hxx
new file mode 100644
index 000000000000..db4ff4677491
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.hxx
@@ -0,0 +1,81 @@
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#define RPT_XMLREPORTELEMENTBASE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlReportElementBase.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable;
+ class OXMLReportElementBase : public SvXMLImportContext
+ {
+ OXMLReportElementBase(const OXMLReportElementBase&);
+ void operator =(const OXMLReportElementBase&);
+ protected:
+ ORptFilter& m_rImport;
+ OXMLTable* m_pContainer;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > m_xComponent;
+
+ virtual SvXMLImportContext* _CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ public:
+
+ OXMLReportElementBase( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent
+ ,OXMLTable* _pContainer);
+ virtual ~OXMLReportElementBase();
+
+ 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();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLREPORTELEMENTBASE_HXX
diff --git a/reportdesign/source/filter/xml/xmlRow.cxx b/reportdesign/source/filter/xml/xmlRow.cxx
new file mode 100644
index 000000000000..638e48fb9c2c
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlRow.cxx
@@ -0,0 +1,213 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlRow.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_GENERICPROPERTYSET_HXX_
+#include <comphelper/genericpropertyset.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+
+namespace rptxml
+{
+ using namespace ::comphelper;
+ using namespace ::rtl;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+ using namespace ::com::sun::star::xml::sax;
+
+DBG_NAME( rpt_OXMLRow )
+
+OXMLRow::OXMLRow( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,OXMLTable* _pContainer) :
+ SvXMLImportContext( rImport, nPrfx, _sLocalName )
+ ,m_pContainer(_pContainer)
+{
+ DBG_CTOR( rpt_OXMLRow,NULL);
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetColumnTokenMap();
+
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_COLUMN_STYLE_NAME:
+ m_sStyleName = sValue;
+ break;
+ case XML_TOK_NUMBER_ROWS_SPANNED:
+ m_pContainer->setRowSpanned(sValue.toInt32());
+ break;
+ default:
+ break;
+ }
+ }
+
+}
+// -----------------------------------------------------------------------------
+
+OXMLRow::~OXMLRow()
+{
+ DBG_DTOR( rpt_OXMLRow,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLRow::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetControlPropertyElemTokenMap();
+
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_COLUMN:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRow( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_ROW:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRow( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_CELL:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRow( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ case XML_TOK_COV_CELL:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRow( rImport, nPrefix, rLocalName,xAttrList,m_pContainer);
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLRow::EndElement()
+{
+ if ( m_sStyleName.getLength() )
+ {
+ const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles();
+ if ( pAutoStyles )
+ {
+ PropertySetInfo* pInfo = new PropertySetInfo();
+ static PropertyMapEntry pMap[] =
+ {
+ {PROPERTY_WIDTH, static_cast<sal_uInt16>(PROPERTY_WIDTH.length), 0, &::getCppuType(static_cast< sal_Int32* >( NULL )) ,PropertyAttribute::BOUND,0},
+ {PROPERTY_HEIGHT, static_cast<sal_uInt16>(PROPERTY_HEIGHT.length), 0, &::getCppuType(static_cast< sal_Int32* >( NULL )) ,PropertyAttribute::BOUND,0},
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ pInfo->add(pMap);
+ Reference<XPropertySet> xProp = GenericPropertySet_CreateInstance(pInfo);
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_COLUMN,m_sStyleName));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nWidth = 0;
+ xProp->getPropertyValue(PROPERTY_WIDTH) >>= nWidth;
+ m_pContainer->addWidth(nWidth);
+ }
+ else
+ {
+ pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_ROW,m_sStyleName));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(xProp);
+ sal_Int32 nHeight = 0;
+ xProp->getPropertyValue(PROPERTY_HEIGHT) >>= nHeight;
+ m_pContainer->addHeight(nHeight);
+ }
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLRow::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlRow.hxx b/reportdesign/source/filter/xml/xmlRow.hxx
new file mode 100644
index 000000000000..35f9a11c05e3
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlRow.hxx
@@ -0,0 +1,73 @@
+#ifndef RPT_XMLCOLUMN_HXX
+#define RPT_XMLCOLUMN_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlRow.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable;
+ class OXMLRowColumn : public SvXMLImportContext
+ {
+ ::rtl::OUString m_sStyleName;
+ OXMLTable* m_pContainer;
+
+ ORptFilter& GetOwnImport();
+ OXMLRowColumn(const OXMLRowColumn&);
+ void operator =(const OXMLRowColumn&);
+ public:
+
+ OXMLRowColumn( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
+ ,OXMLTable* _pContainer = NULL);
+ virtual ~OXMLRowColumn();
+
+ 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();
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLCOLUMN_HXX
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
new file mode 100644
index 000000000000..81350d805884
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlSection.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLSECTION_HXX
+#include "xmlSection.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#ifndef RPT_XMLCondPrtExpr_HXX
+#include "xmlCondPrtExpr.hxx"
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_REPORTPRINTOPTION_HPP_
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#endif
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::xmloff;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+
+ sal_uInt16 lcl_getReportPrintOption(const ::rtl::OUString& _sValue)
+ {
+ sal_uInt16 nRet = report::ReportPrintOption::ALL_PAGES;
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
+ SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
+ return nRet;
+ }
+
+
+DBG_NAME( rpt_OXMLSection )
+
+OXMLSection::OXMLSection( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const OUString& _sLocalName,
+ const uno::Reference< xml::sax::XAttributeList > & _xAttrList
+ ,const uno::Reference< report::XSection >& _xSection
+ ,sal_Bool _bPageHeader)
+:SvXMLImportContext( rImport, nPrfx, _sLocalName )
+,m_xSection(_xSection)
+,m_bPageHeader(_bPageHeader)
+{
+ DBG_CTOR( rpt_OXMLSection,NULL);
+
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetSectionElemTokenMap();
+
+ const sal_Int16 nLength = (m_xSection.is() && _xAttrList.is()) ? _xAttrList->getLength() : 0;
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+
+ case XML_TOK_PAGE_PRINT_OPTION:
+ if ( _bPageHeader )
+ m_xSection->getReportDefinition()->setPageHeaderOption(lcl_getReportPrintOption(sValue));
+ else
+ m_xSection->getReportDefinition()->setPageFooterOption(lcl_getReportPrintOption(sValue));
+ break;
+
+ default:
+ OSL_ENSURE(0,"OXMLSection: Unknown attribute!");
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the section props");
+ }
+}
+// -----------------------------------------------------------------------------
+OXMLSection::~OXMLSection()
+{
+ DBG_DTOR( rpt_OXMLSection,NULL);
+}
+// -----------------------------------------------------------------------------
+
+SvXMLImportContext* OXMLSection::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetSectionElemTokenMap();
+ uno::Reference<lang::XMultiServiceFactory> xFactor = rImport.getServiceFactory();
+
+ switch( rTokenMap.Get( _nPrefix, _rLocalName ) )
+ {
+ case XML_TOK_CONDITIONAL_PRINT_EXPRESSION:
+ pContext = new OXMLCondPrtExpr( rImport, _nPrefix, _rLocalName,xAttrList,m_xSection.get());
+ break;
+ case XML_TOK_TABLE:
+ pContext = new OXMLTable( rImport, _nPrefix, _rLocalName,xAttrList,m_xSection);
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( rImport, _nPrefix, _rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLSection::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlSection.hxx b/reportdesign/source/filter/xml/xmlSection.hxx
new file mode 100644
index 000000000000..8efe91e4f577
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSection.hxx
@@ -0,0 +1,76 @@
+#ifndef RPT_XMLSECTION_HXX
+#define RPT_XMLSECTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlSection.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLSection : public SvXMLImportContext
+ {
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
+ sal_Bool m_bPageHeader;
+ ORptFilter& GetOwnImport();
+
+ OXMLSection(const OXMLSection&);
+ void operator =(const OXMLSection&);
+ public:
+
+ OXMLSection( ORptFilter& rImport
+ ,sal_uInt16 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::report::XSection >& _xSection
+ ,sal_Bool _bPageHeader = sal_True);
+ virtual ~OXMLSection();
+
+ virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLSECTION_HXX
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx
new file mode 100644
index 000000000000..f82f2aafc533
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx
@@ -0,0 +1,503 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlStyleImport.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLIMPPR_HXX
+#include <xmloff/xmlimppr.hxx>
+#endif
+#include <xmloff/txtimppr.hxx>
+#ifndef _XMLOFF_FAMILIES_HXX_
+#include <xmloff/families.hxx>
+#endif
+#ifndef _XMLOFF_XMLNUMFI_HXX
+#include <xmloff/xmlnumfi.hxx>
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_HPP_
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TABLE_BORDERLINE_HPP_
+#include <com/sun/star/table/BorderLine.hpp>
+#endif
+#ifndef _COMPHELPER_EXTRACT_HXX_
+#include <comphelper/extract.hxx>
+#endif
+#ifndef _XMLOFF_XMLPROPERTYSETCONTEXT_HXX
+#include <xmloff/xmlprcon.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#include <xmloff/XMLGraphicsDefaultStyle.hxx>
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#define XML_LINE_LEFT 0
+#define XML_LINE_RIGHT 1
+#define XML_LINE_TOP 2
+#define XML_LINE_BOTTOM 3
+
+namespace rptxml
+{
+
+using namespace ::rtl;
+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::container;
+using namespace xmloff::token;
+
+// -----------------------------------------------------------------------------
+
+class OSpecialHanldeXMLImportPropertyMapper : public SvXMLImportPropertyMapper
+{
+public:
+ OSpecialHanldeXMLImportPropertyMapper(const UniReference< XMLPropertySetMapper >& rMapper,SvXMLImport& _rImport) : SvXMLImportPropertyMapper(rMapper ,_rImport)
+ {
+ }
+ /** 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
+ {
+ // nothing to do here
+ return sal_True;
+ }
+};
+
+TYPEINIT1( OControlStyleContext, XMLPropStyleContext );
+TYPEINIT1( OReportStylesContext, SvXMLStylesContext );
+DBG_NAME( rpt_OControlStyleContext )
+
+OControlStyleContext::OControlStyleContext( ORptFilter& 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 ),
+ sNumberFormat(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NumberFormat"))),
+ pStyles(&rStyles),
+ m_nNumberFormat(-1),
+ m_rImport(rImport),
+ bConditionalFormatCreated(sal_False),
+ bParentSet(sal_False)
+{
+ DBG_CTOR( rpt_OControlStyleContext,NULL);
+
+}
+// -----------------------------------------------------------------------------
+
+OControlStyleContext::~OControlStyleContext()
+{
+
+ DBG_DTOR( rpt_OControlStyleContext,NULL);
+}
+// -----------------------------------------------------------------------------
+
+void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPropSet )
+{
+ if ( !IsDefaultStyle() )
+ {
+ if ( GetFamily() == XML_STYLE_FAMILY_TABLE_CELL )
+ {
+ if ((m_nNumberFormat == -1) && m_sDataStyleName.getLength())
+ {
+ SvXMLNumFormatContext* pStyle = PTR_CAST(SvXMLNumFormatContext,pStyles->FindStyleChildContext(
+ XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True));
+ if ( !pStyle )
+ {
+ OReportStylesContext* pMyStyles = PTR_CAST(OReportStylesContext,GetOwnImport().GetAutoStyles());
+ if ( pMyStyles )
+ pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles->
+ FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True));
+ else
+ DBG_ERROR("not possible to get style");
+ }
+ if ( pStyle )
+ {
+ m_nNumberFormat = pStyle->GetKey();
+ AddProperty(CTF_RPT_NUMBERFORMAT, uno::makeAny(m_nNumberFormat));
+ }
+ }
+ }
+ }
+ XMLPropStyleContext::FillPropertySet(rPropSet);
+}
+// -----------------------------------------------------------------------------
+void OControlStyleContext::SetDefaults()
+{
+}
+// -----------------------------------------------------------------------------
+
+void OControlStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue)
+{
+ sal_Int32 nIndex(static_cast<OReportStylesContext *>(pStyles)->GetIndex(nContextID));
+ DBG_ASSERT(nIndex != -1, "Property not found in Map");
+ XMLPropertyState aPropState(nIndex, rValue);
+ GetProperties().push_back(aPropState); // has to be insertes in a sort order later
+}
+// -----------------------------------------------------------------------------
+void OControlStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
+ const OUString& rLocalName,
+ const OUString& rValue )
+{
+ // TODO: use a map here
+ if( IsXMLToken(rLocalName, XML_DATA_STYLE_NAME ) )
+ m_sDataStyleName = rValue;
+ else if ( IsXMLToken(rLocalName, XML_MASTER_PAGE_NAME ) )
+ sPageStyle = rValue;
+ else
+ XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue );
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OControlStyleContext::GetOwnImport() const
+{
+ return m_rImport;
+}
+// -----------------------------------------------------------------------------
+DBG_NAME( rpt_OReportStylesContext )
+
+OReportStylesContext::OReportStylesContext( ORptFilter& rImport,
+ sal_uInt16 nPrfx ,
+ const OUString& rLName ,
+ const Reference< XAttributeList > & xAttrList,
+ const sal_Bool bTempAutoStyles ) :
+ SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList ),
+ m_sTableStyleFamilyName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME ))),
+ m_sColumnStyleFamilyName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME ))),
+ m_sRowStyleFamilyName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME ))),
+ m_sCellStyleFamilyName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME ))),
+ m_rImport(rImport),
+ m_nNumberFormatIndex(-1),
+ bAutoStyles(bTempAutoStyles)
+{
+ DBG_CTOR( rpt_OReportStylesContext,NULL);
+
+}
+// -----------------------------------------------------------------------------
+
+OReportStylesContext::~OReportStylesContext()
+{
+
+ DBG_DTOR( rpt_OReportStylesContext,NULL);
+}
+// -----------------------------------------------------------------------------
+
+void OReportStylesContext::EndElement()
+{
+ SvXMLStylesContext::EndElement();
+ if (bAutoStyles)
+ GetImport().GetTextImport()->SetAutoStyles( this );
+ else
+ GetImport().GetStyles()->CopyStylesToDoc(sal_True);
+}
+// -----------------------------------------------------------------------------
+
+UniReference < SvXMLImportPropertyMapper >
+ OReportStylesContext::GetImportPropertyMapper(
+ sal_uInt16 nFamily ) const
+{
+ UniReference < SvXMLImportPropertyMapper > xMapper(SvXMLStylesContext::GetImportPropertyMapper(nFamily));
+
+ if (!xMapper.is())
+ {
+ ORptFilter& rImport = GetOwnImport();
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ {
+ if( !m_xCellImpPropMapper.is() )
+ {
+ m_xCellImpPropMapper =
+ new XMLTextImportPropertyMapper/*OSpecialHanldeXMLImportPropertyMapper*/( rImport.GetCellStylesPropertySetMapper(), m_rImport , const_cast<XMLFontStylesContext*>(m_rImport.GetFontDecls()));
+
+ m_xCellImpPropMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(m_rImport, const_cast<XMLFontStylesContext*>(m_rImport.GetFontDecls())));
+ }
+ xMapper = m_xCellImpPropMapper;
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ {
+ if( !m_xColumnImpPropMapper.is() )
+ m_xColumnImpPropMapper =
+ new SvXMLImportPropertyMapper( rImport.GetColumnStylesPropertySetMapper(), m_rImport );
+
+ xMapper = m_xColumnImpPropMapper;
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ {
+ if( !m_xRowImpPropMapper.is() )
+ m_xRowImpPropMapper =new OSpecialHanldeXMLImportPropertyMapper( rImport.GetRowStylesPropertySetMapper(), m_rImport );
+ xMapper = m_xRowImpPropMapper;
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ {
+ if( !m_xTableImpPropMapper.is() )
+ {
+ UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory();
+ m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac), m_rImport );
+ //m_xTableImpPropMapper = new SvXMLImportPropertyMapper( rImport.GetTableStylesPropertySetMapper(), m_rImport );
+ }
+ xMapper = m_xTableImpPropMapper;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ return xMapper;
+}
+// -----------------------------------------------------------------------------
+SvXMLStyleContext *OReportStylesContext::CreateDefaultStyleStyleChildContext(
+ 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_SD_GRAPHICS_ID:
+ // There are no writer specific defaults for graphic styles!
+ pStyle = new XMLGraphicsDefaultStyle( GetImport(), nPrefix,
+ rLocalName, xAttrList, *this );
+ break;
+ default:
+ pStyle = SvXMLStylesContext::CreateDefaultStyleStyleChildContext( nFamily,
+ nPrefix,
+ rLocalName,
+ xAttrList );
+ break;
+ }
+ return pStyle;
+}
+// ----------------------------------------------------------------------------
+SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext(
+ sal_uInt16 nFamily, sal_uInt16 nPrefix, const OUString& rLocalName,
+ const Reference< xml::sax::XAttributeList > & xAttrList )
+{
+ SvXMLStyleContext *pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily, nPrefix,
+ rLocalName,
+ xAttrList );
+ if (!pStyle)
+ {
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ pStyle = new OControlStyleContext( GetOwnImport(), nPrefix, rLocalName,
+ xAttrList, *this, nFamily );
+ break;
+ default:
+ OSL_ENSURE(0,"OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check.");
+ break;
+ }
+ }
+
+ return pStyle;
+}
+// -----------------------------------------------------------------------------
+Reference < XNameContainer >
+ OReportStylesContext::GetStylesContainer( sal_uInt16 nFamily ) const
+{
+ Reference < XNameContainer > xStyles(SvXMLStylesContext::GetStylesContainer(nFamily));
+ if (!xStyles.is())
+ {
+ OUString sName;
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ {
+ if( m_xTableStyles.is() )
+ xStyles.set(m_xTableStyles);
+ else
+ sName =
+ OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "TableStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ {
+ if( m_xCellStyles.is() )
+ xStyles.set(m_xCellStyles);
+ else
+ sName =
+ OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ {
+ if( m_xColumnStyles.is() )
+ xStyles.set(m_xColumnStyles);
+ else
+ sName =
+ OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColumnStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ {
+ if( m_xRowStyles.is() )
+ xStyles.set(m_xRowStyles);
+ else
+ sName =
+ OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "RowStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_SD_GRAPHICS_ID:
+ xStyles = ((SvXMLImport *)&GetImport())->GetTextImport()->GetFrameStyles();
+ break;
+ default:
+ OSL_ENSURE(0,"OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check.");
+ break;
+ }
+ if( !xStyles.is() && sName.getLength() && GetOwnImport().GetModel().is() )
+ {
+ Reference< XStyleFamiliesSupplier > xFamiliesSupp(
+ GetOwnImport().GetModel(), UNO_QUERY );
+ if (xFamiliesSupp.is())
+ {
+ Reference< XNameAccess > xFamilies(xFamiliesSupp->getStyleFamilies());
+
+ xStyles.set(xFamilies->getByName( sName ), uno::UNO_QUERY);
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ m_xTableStyles.set(xStyles);
+ break;
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ m_xCellStyles.set(xStyles);
+ break;
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ m_xColumnStyles.set(xStyles);
+ break;
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ m_xRowStyles.set(xStyles);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ return xStyles;
+}
+// -----------------------------------------------------------------------------
+
+OUString OReportStylesContext::GetServiceName( sal_uInt16 nFamily ) const
+{
+ rtl::OUString sServiceName = SvXMLStylesContext::GetServiceName(nFamily);
+ if (!sServiceName.getLength())
+ {
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ sServiceName = m_sTableStyleFamilyName;
+ break;
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ sServiceName = m_sColumnStyleFamilyName;
+ break;
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ sServiceName = m_sRowStyleFamilyName;
+ break;
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ sServiceName = m_sCellStyleFamilyName;
+ break;
+ default:
+ break;
+ }
+ }
+ return sServiceName;
+}
+// -----------------------------------------------------------------------------
+
+sal_Int32 OReportStylesContext::GetIndex(const sal_Int16 nContextID)
+{
+ if ( nContextID == CTF_RPT_NUMBERFORMAT )
+ {
+ if (m_nNumberFormatIndex == -1)
+ m_nNumberFormatIndex =
+ GetImportPropertyMapper(XML_STYLE_FAMILY_TABLE_CELL)->getPropertySetMapper()->FindEntryIndex(nContextID);
+ return m_nNumberFormatIndex;
+ }
+ return -1;
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OReportStylesContext::GetOwnImport() const
+{
+ return m_rImport;
+}
+// -----------------------------------------------------------------------------
+sal_uInt16 OReportStylesContext::GetFamily( const ::rtl::OUString& rFamily ) const
+{
+ sal_uInt16 nFamily = SvXMLStylesContext::GetFamily(rFamily);
+ return nFamily;
+}
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx
new file mode 100644
index 000000000000..55ee77e4d267
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx
@@ -0,0 +1,190 @@
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#define RPT_XMLSTYLEIMPORT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlStyleImport.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+#ifndef _XMLOFF_XMLIMP_HXX
+#include <xmloff/xmlimp.hxx>
+#endif
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _XMLOFF_PROPMAPPINGTYPES_HXX
+#include <xmloff/maptype.hxx>
+#endif
+#ifndef _XMLOFF_PRSTYLEI_HXX_
+#include <xmloff/prstylei.hxx>
+#endif
+#ifndef _XMLOFF_XMLIMPPR_HXX
+#include <xmloff/xmlimppr.hxx>
+#endif
+#ifndef _XMLTEXTMASTERPAGECONTEXT_HXX
+#include <xmloff/XMLTextMasterPageContext.hxx>
+#endif
+#ifndef _XMLTEXTMASTERSTYLESCONTEXT_HXX
+#include <xmloff/XMLTextMasterStylesContext.hxx>
+#endif
+#ifndef _XMLOFF_CONTEXTID_HXX_
+#include <xmloff/contextid.hxx>
+#endif
+#ifndef _XMLOFF_FORMS_CONTROLPROPERTYHDL_HXX_
+#include <xmloff/controlpropertyhdl.hxx>
+#endif
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+
+ class OControlStyleContext : public XMLPropStyleContext
+ {
+ ::rtl::OUString m_sDataStyleName;
+ ::rtl::OUString sPageStyle;
+ const rtl::OUString sNumberFormat;
+ SvXMLStylesContext* pStyles;
+ // std::vector<ScXMLMapContent> aMaps;
+ com::sun::star::uno::Any aConditionalFormat;
+ sal_Int32 m_nNumberFormat;
+ ORptFilter& m_rImport;
+ sal_Bool bConditionalFormatCreated : 1;
+ sal_Bool bParentSet : 1;
+
+ ORptFilter& GetOwnImport() const;
+
+ OControlStyleContext(const OControlStyleContext&);
+ void operator =(const OControlStyleContext&);
+ protected:
+
+ virtual void SetAttribute( sal_uInt16 nPrefixKey,
+ const ::rtl::OUString& rLocalName,
+ const ::rtl::OUString& rValue );
+
+ public:
+
+ TYPEINFO();
+
+ OControlStyleContext( ORptFilter& 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, sal_Bool bDefaultStyle = sal_False );
+
+ virtual ~OControlStyleContext();
+
+
+ virtual void FillPropertySet(const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet > & rPropSet );
+
+ virtual void SetDefaults();
+
+ void AddProperty(sal_Int16 nContextID, const com::sun::star::uno::Any& aValue);
+
+ sal_Int32 GetNumberFormat() { return m_nNumberFormat; }
+ };
+
+ class OReportStylesContext : public SvXMLStylesContext
+ {
+ const ::rtl::OUString m_sTableStyleFamilyName;
+ const ::rtl::OUString m_sColumnStyleFamilyName;
+ const ::rtl::OUString m_sRowStyleFamilyName;
+ const ::rtl::OUString m_sCellStyleFamilyName;
+ ORptFilter& m_rImport;
+ sal_Int32 m_nNumberFormatIndex;
+ sal_Int32 nMasterPageNameIndex;
+ sal_Bool bAutoStyles : 1;
+
+ //mutable UniReference < SvXMLImportPropertyMapper > m_xControlImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > m_xCellImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > m_xColumnImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > m_xRowImpPropMapper;
+ mutable UniReference < SvXMLImportPropertyMapper > m_xTableImpPropMapper;
+
+ mutable ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > m_xCellStyles;
+ mutable ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > m_xColumnStyles;
+ mutable ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > m_xRowStyles;
+ mutable ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer > m_xTableStyles;
+
+ ORptFilter& GetOwnImport() const;
+
+ OReportStylesContext(const OReportStylesContext&);
+ void operator =(const OReportStylesContext&);
+ protected:
+
+ // Create a style context.
+ 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();
+
+ OReportStylesContext( ORptFilter& rImport, sal_uInt16 nPrfx ,
+ const ::rtl::OUString& rLName ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
+ const sal_Bool bAutoStyles );
+ virtual ~OReportStylesContext();
+
+ virtual void EndElement();
+
+ virtual UniReference < SvXMLImportPropertyMapper > GetImportPropertyMapper(
+ sal_uInt16 nFamily ) const;
+ virtual ::com::sun::star::uno::Reference <
+ ::com::sun::star::container::XNameContainer >
+ GetStylesContainer( sal_uInt16 nFamily ) const;
+ virtual ::rtl::OUString GetServiceName( sal_uInt16 nFamily ) const;
+ virtual sal_uInt16 GetFamily( const ::rtl::OUString& rFamily ) const;
+
+ sal_Int32 GetIndex(const sal_Int16 nContextID);
+ };
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLSTYLEIMPORT_HXX
diff --git a/reportdesign/source/filter/xml/xmlSubDocument.cxx b/reportdesign/source/filter/xml/xmlSubDocument.cxx
new file mode 100644
index 000000000000..bd3789e786c9
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSubDocument.cxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlSubDocument.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLSUBDOCUMENT_HXX
+#include "xmlSubDocument.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLMASTERFIELDS_HXX
+#include "xmlMasterFields.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::report;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::xml::sax;
+DBG_NAME( rpt_OXMLSubDocument )
+
+OXMLSubDocument::OXMLSubDocument( ORptFilter& rImport,
+ sal_uInt16 nPrfx
+ ,const OUString& rLName
+ ,const Reference< XReportDefinition > & _xComponent
+ ,OXMLTable* _pContainer) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer)
+,m_xComponent(_xComponent)
+{
+ DBG_CTOR( rpt_OXMLSubDocument,NULL);
+ OSL_ENSURE(m_xComponent.is(),"Component is NULL!");
+}
+// -----------------------------------------------------------------------------
+
+OXMLSubDocument::~OXMLSubDocument()
+{
+ DBG_DTOR( rpt_OXMLSubDocument,NULL);
+}
+
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLSubDocument::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = OXMLReportElementBase::CreateChildContext(_nPrefix,_rLocalName,xAttrList);
+ if ( pContext )
+ return pContext;
+ const SvXMLTokenMap& rTokenMap = static_cast<ORptFilter&>(GetImport()).GetSubDocumentElemTokenMap();
+
+ switch( rTokenMap.Get( _nPrefix, _rLocalName ) )
+ {
+ case XML_TOK_MASTER_DETAIL_FIELDS:
+ {
+ GetImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLMasterFields(static_cast<ORptFilter&>(GetImport()), _nPrefix, _rLocalName,xAttrList ,this);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLSubDocument::EndElement()
+{
+ if ( !m_aMasterFields.empty() )
+ m_xComponent->setMasterFields(Sequence< ::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
+ if ( !m_aDetailFields.empty() )
+ m_xComponent->setDetailFields(Sequence< ::rtl::OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
+}
+// -----------------------------------------------------------------------------
+void OXMLSubDocument::addFieldPair(const ::std::pair< ::rtl::OUString,::rtl::OUString >& _aPair)
+{
+ m_aMasterFields.push_back(_aPair.first);
+ m_aDetailFields.push_back(_aPair.second);
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlSubDocument.hxx b/reportdesign/source/filter/xml/xmlSubDocument.hxx
new file mode 100644
index 000000000000..be1ed9387515
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSubDocument.hxx
@@ -0,0 +1,77 @@
+#ifndef RPT_XMLSUBDOCUMENT_HXX
+#define RPT_XMLSUBDOCUMENT_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlSubDocument.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#include "xmlReportElementBase.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLSubDocument : public OXMLReportElementBase
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xComponent;
+ ::std::vector< ::rtl::OUString> m_aMasterFields;
+ ::std::vector< ::rtl::OUString> m_aDetailFields;
+ OXMLSubDocument(const OXMLSubDocument&);
+ void operator =(const OXMLSubDocument&);
+ public:
+
+ OXMLSubDocument( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xComponent
+ ,OXMLTable* _pContainer);
+ virtual ~OXMLSubDocument();
+
+ 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();
+
+ void addFieldPair(const ::std::pair< ::rtl::OUString,::rtl::OUString >& _aPair);
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLSubDocument_HXX
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
new file mode 100644
index 000000000000..48269d7a6f27
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -0,0 +1,341 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlTable.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLTABLE_HXX
+#include "xmlTable.hxx"
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_FORCENEWPAGE_HPP_
+#include <com/sun/star/report/ForceNewPage.hpp>
+#endif
+#ifndef RPT_XMLCONDPRTEXPR_HXX
+#include "xmlCondPrtExpr.hxx"
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#include "xmlstrings.hrc"
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+
+namespace rptxml
+{
+ using namespace ::rtl;
+ using namespace ::xmloff;
+ using namespace ::com::sun::star;
+ using ::com::sun::star::uno::Reference;
+ using namespace ::com::sun::star::xml::sax;
+ using ::com::sun::star::xml::sax::XAttributeList;
+
+ sal_uInt16 lcl_getForceNewPageOption(const ::rtl::OUString& _sValue)
+ {
+ sal_uInt16 nRet = report::ForceNewPage::NONE;
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
+ SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap );
+ return nRet;
+ }
+DBG_NAME( rpt_OXMLTable )
+
+OXMLTable::OXMLTable( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,const uno::Reference< report::XSection >& _xSection
+ )
+:SvXMLImportContext( rImport, nPrfx, _sLocalName )
+,m_xSection(_xSection)
+,m_nColSpan(1)
+,m_nRowSpan(0)
+,m_nRowIndex(0)
+,m_nColumnIndex(0)
+{
+ DBG_CTOR( rpt_OXMLTable,NULL);
+ OSL_ENSURE(_xAttrList.is(),"Attribute list is NULL!");
+ const SvXMLNamespaceMap& rMap = rImport.GetNamespaceMap();
+ const SvXMLTokenMap& rTokenMap = rImport.GetSectionElemTokenMap();
+
+ const sal_Int16 nLength = (m_xSection.is() && _xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ try
+ {
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( rTokenMap.Get( nPrefix, sLocalName ) )
+ {
+ case XML_TOK_VISIBLE:
+ m_xSection->setVisible(sValue == s_sTRUE);
+ break;
+ case XML_TOK_FORCE_NEW_PAGE:
+ m_xSection->setForceNewPage(lcl_getForceNewPageOption(sValue));
+ break;
+ case XML_TOK_FORCE_NEW_COLUMN:
+ m_xSection->setNewRowOrCol(lcl_getForceNewPageOption(sValue));
+ break;
+ case XML_TOK_KEEP_TOGETHER:
+ m_xSection->setKeepTogether(sValue == s_sTRUE);
+ break;
+ case XML_TOK_REPEAT_SECTION:
+ m_xSection->setRepeatSection(sValue == s_sTRUE );
+ break;
+ case XML_TOK_SECTION_NAME:
+ m_xSection->setName(sValue);
+ break;
+ case XML_TOK_SECT_STYLE_NAME:
+ m_sStyleName = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the section props");
+ }
+}
+// -----------------------------------------------------------------------------
+OXMLTable::~OXMLTable()
+{
+ DBG_DTOR( rpt_OXMLTable,NULL);
+}
+// -----------------------------------------------------------------------------
+
+SvXMLImportContext* OXMLTable::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+ ORptFilter& rImport = GetOwnImport();
+ const SvXMLTokenMap& rTokenMap = rImport.GetColumnTokenMap();
+ Reference<XMultiServiceFactory> xFactor = rImport.getServiceFactory();
+
+ switch( rTokenMap.Get( _nPrefix, _rLocalName ) )
+ {
+ case XML_TOK_TABLE_COLUMNS:
+ case XML_TOK_TABLE_ROWS:
+ pContext = new OXMLRowColumn( rImport, _nPrefix, _rLocalName,xAttrList ,this);
+ break;
+ case XML_TOK_ROW:
+ incrementRowIndex();
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRowColumn( rImport, _nPrefix, _rLocalName,xAttrList,this);
+ break;
+ case XML_TOK_COLUMN:
+ rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLRowColumn( rImport, _nPrefix, _rLocalName,xAttrList,this);
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( rImport, _nPrefix, _rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+ORptFilter& OXMLTable::GetOwnImport()
+{
+ return static_cast<ORptFilter&>(GetImport());
+}
+// -----------------------------------------------------------------------------
+void OXMLTable::EndElement()
+{
+ try
+ {
+ if ( m_xSection.is() )
+ {
+ if ( m_sStyleName.getLength() )
+ {
+ const SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles();
+ if ( pAutoStyles )
+ {
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_TABLE,m_sStyleName));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(m_xSection.get());
+ }
+ }
+ } // if ( m_sStyleName.getLength() )
+ // set height
+ ::std::vector<sal_Int32>::iterator aIter = m_aHeight.begin();
+ ::std::vector<sal_Int32>::iterator aEnd = m_aHeight.end();
+ sal_Int32 nHeight = 0;
+ for (; aIter != aEnd; ++aIter)
+ nHeight += *aIter;
+ m_xSection->setHeight( nHeight );
+ // set positions, widths, and heights
+ sal_Int32 nLeftMargin = rptui::getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ sal_Int32 nPosY = 0;
+ ::std::vector< ::std::vector<TCell> >::iterator aRowIter = m_aGrid.begin();
+ ::std::vector< ::std::vector<TCell> >::iterator aRowEnd = m_aGrid.end();
+ for (sal_Int32 i = 0; aRowIter != aRowEnd; ++aRowIter,++i)
+ {
+ sal_Int32 nPosX = nLeftMargin;
+ ::std::vector<TCell>::iterator aColIter = (*aRowIter).begin();
+ ::std::vector<TCell>::iterator aColEnd = (*aRowIter).end();
+ for (sal_Int32 j = 0; aColIter != aColEnd; ++aColIter,++j)
+ {
+ TCell& rCell = *aColIter;
+ if ( rCell.xElement.is())
+ {
+ uno::Reference<report::XShape> xShape(rCell.xElement,uno::UNO_QUERY);
+ if ( xShape.is() )
+ {
+ xShape->setPositionX(xShape->getPositionX() + nLeftMargin);
+ }
+ else
+ {
+ sal_Int32 nWidth = rCell.nWidth;
+ sal_Int32 nColSpan = rCell.nColSpan;
+ if ( nColSpan > 1 )
+ {
+ ::std::vector<TCell>::iterator aWidthIter = aColIter + 1;
+ while ( nColSpan > 1 )
+ {
+ nWidth += (aWidthIter++)->nWidth;
+ --nColSpan;
+ }
+ }
+ nHeight = rCell.nHeight;
+ sal_Int32 nRowSpan = rCell.nRowSpan;
+ if ( nRowSpan > 1 )
+ {
+ ::std::vector< ::std::vector<TCell> >::iterator aHeightIter = aRowIter + 1;
+ while( nRowSpan > 1)
+ {
+ nHeight += (*aHeightIter)[j].nHeight;
+ ++aHeightIter;
+ --nRowSpan;
+ }
+ }
+ Reference<XFixedLine> xFixedLine(rCell.xElement,uno::UNO_QUERY);
+ if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
+ {
+ OSL_ENSURE(static_cast<sal_uInt32>(j+1) < m_aWidth.size(),"Illegal pos of col iter. There should be an empty cell for the next line part.");
+ nWidth += m_aWidth[j+1];
+
+ }
+ try
+ {
+ rCell.xElement->setSize(awt::Size(nWidth,nHeight));
+ rCell.xElement->setPosition(awt::Point(nPosX,nPosY));
+ }
+ catch(beans::PropertyVetoException)
+ {
+ OSL_ENSURE(0,"Could set the correct positions!");
+ }
+ }
+ }
+ nPosX += m_aWidth[j];
+ }
+ nPosY += m_aHeight[i];
+ }
+ } // if ( m_xComponent.is() )
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"OXMLTable::EndElement -> exception catched");
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLTable::addCell(const Reference<XReportComponent>& _xElement)
+{
+ OSL_ENSURE(static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size(),
+ "OXMLTable::addCell: Invalid column and row index");
+ if ( static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size() )
+ {
+ TCell& rCell = m_aGrid[m_nRowIndex-1][m_nColumnIndex-1];
+ rCell.xElement = _xElement;
+ rCell.nWidth = m_aWidth[m_nColumnIndex-1];
+ rCell.nHeight = m_aHeight[m_nRowIndex-1];
+ rCell.nColSpan = m_nColSpan;
+ rCell.nRowSpan = m_nRowSpan;
+ }
+
+ m_nColSpan = m_nRowSpan = 1;
+}
+// -----------------------------------------------------------------------------
+void OXMLTable::incrementRowIndex()
+{
+ ++m_nRowIndex;
+ m_nColumnIndex = 0;
+ m_aGrid.push_back(::std::vector<TCell>(m_aWidth.size()));
+}
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlTable.hxx b/reportdesign/source/filter/xml/xmlTable.hxx
new file mode 100644
index 000000000000..bda48ceefe4f
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlTable.hxx
@@ -0,0 +1,111 @@
+#ifndef RPT_XMLTABLE_HXX
+#define RPT_XMLTABLE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlTable.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _XMLOFF_XMLICTXT_HXX
+#include <xmloff/xmlictxt.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable : public SvXMLImportContext
+ {
+ public:
+ struct TCell
+ {
+ sal_Int32 nWidth;
+ sal_Int32 nHeight;
+ sal_Int32 nColSpan;
+ sal_Int32 nRowSpan;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> xElement;
+ TCell() : nWidth(0),nHeight(0),nColSpan(1),nRowSpan(1){}
+ };
+ private:
+ ::std::vector< ::std::vector<TCell> > m_aGrid;
+ ::std::vector<sal_Int32> m_aHeight;
+ ::std::vector<sal_Int32> m_aWidth;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
+ ::rtl::OUString m_sStyleName;
+ sal_Int32 m_nColSpan;
+ sal_Int32 m_nRowSpan;
+ sal_Int32 m_nRowIndex;
+ sal_Int32 m_nColumnIndex;
+ ORptFilter& GetOwnImport();
+
+ OXMLTable(const OXMLTable&);
+ void operator =(const OXMLTable&);
+ public:
+
+ OXMLTable( ORptFilter& rImport
+ ,sal_uInt16 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::report::XSection >& _xSection
+ );
+ virtual ~OXMLTable();
+
+ 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();
+
+ inline void addHeight(sal_Int32 _nHeight) { m_aHeight.push_back( _nHeight ); }
+ inline void addWidth(sal_Int32 _nWidth) { m_aWidth.push_back( _nWidth ); }
+
+ inline void setColumnSpanned(sal_Int32 _nColSpan) { m_nColSpan = _nColSpan; }
+ inline void setRowSpanned( sal_Int32 _nRowSpan) { m_nRowSpan = _nRowSpan; }
+
+ void incrementRowIndex();
+ inline void incrementColumnIndex() { ++m_nColumnIndex; }
+
+ inline sal_Int32 getRowIndex() const { return m_nRowIndex; }
+ inline sal_Int32 getColumnIndex() const { return m_nColumnIndex; }
+
+ void addCell(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xElement);
+
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const { return m_xSection; }
+ };
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
+#endif // RPT_XMLTABLE_HXX
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
new file mode 100644
index 000000000000..df9197e60a2a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -0,0 +1,1068 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlfilter.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _COM_SUN_STAR_PACKAGES_ZIP_ZIPIOEXCEPTION_HPP_
+#include <com/sun/star/packages/zip/ZipIOException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
+#include <com/sun/star/embed/ElementModes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XOFFICEDATABASEDOCUMENT_HPP_
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#endif
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef RPT_XMLGROUP_HXX
+#include "xmlGroup.hxx"
+#endif
+#ifndef RPT_XMLREPORT_HXX
+#include "xmlReport.hxx"
+#endif
+#ifndef RPT_XMLHELPER_HXX
+#include "xmlHelper.hxx"
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _XMLOFF_XMLNMSPE_HXX
+#include <xmloff/xmlnmspe.hxx>
+#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include <xmloff/xmltoken.hxx>
+#endif
+#ifndef _XMLOFF_TEXTIMP_HXX_
+#include <xmloff/txtimp.hxx>
+#endif
+#ifndef _XMLOFF_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+#ifndef _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
+#include <xmloff/XMLFontStylesContext.hxx>
+#endif
+#ifndef _RTL_LOGFILE_HXX_
+#include <rtl/logfile.hxx>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_INPUTSOURCE_HPP_
+#include <com/sun/star/xml/sax/InputSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XPARSER_HPP_
+#include <com/sun/star/xml/sax/XParser.hpp>
+#endif
+#ifndef _XMLOFF_PROGRESSBARHELPER_HXX
+#include <xmloff/ProgressBarHelper.hxx>
+#endif
+#ifndef _SFXDOCFILE_HXX //autogen wg. SfxMedium
+#include <sfx2/docfile.hxx>
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XNAMINGSERVICE_HPP_
+#include <com/sun/star/uno/XNamingService.hpp>
+#endif
+#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _XMLOFF_DOCUMENTSETTINGSCONTEXT_HXX
+#include <xmloff/DocumentSettingsContext.hxx>
+#endif
+#ifndef _XMLOFF_XMLUCONV_HXX
+#include <xmloff/xmluconv.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XMODIFIABLE_HPP_
+#include <com/sun/star/util/XModifiable.hpp>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef RPT_XMLENUMS_HXX
+#include "xmlEnums.hxx"
+#endif
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#include "xmlStyleImport.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#ifndef RPT_XMLPROPHANDLER_HXX
+#include "xmlPropertyHandler.hxx"
+#endif
+#include <xmloff/txtprmap.hxx>
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#include "ReportDefinition.hxx"
+#endif
+
+
+
+//--------------------------------------------------------------------------
+namespace rptxml
+{
+using namespace ::com::sun::star::uno;
+using ::com::sun::star::uno::Reference;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::report;
+using namespace ::com::sun::star::xml::sax;
+using namespace xmloff;
+ sal_Char __READONLY_DATA sXML_np__rpt[] = "_report";
+ sal_Char __READONLY_DATA sXML_np___rpt[] = "__report";
+
+ using namespace ::com::sun::star::util;
+
+class RptMLMasterStylesContext_Impl : public XMLTextMasterStylesContext
+{
+ ORptFilter& m_rImport;
+ RptMLMasterStylesContext_Impl(const RptMLMasterStylesContext_Impl&);
+ void operator =(const RptMLMasterStylesContext_Impl&);
+public:
+
+ TYPEINFO();
+
+ RptMLMasterStylesContext_Impl(
+ ORptFilter& rImport, sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName ,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList );
+ virtual ~RptMLMasterStylesContext_Impl();
+ virtual void EndElement();
+};
+
+TYPEINIT1( RptMLMasterStylesContext_Impl, XMLTextMasterStylesContext );
+
+RptMLMasterStylesContext_Impl::RptMLMasterStylesContext_Impl(
+ ORptFilter& rImport, sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName ,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList ) :
+ XMLTextMasterStylesContext( rImport, nPrfx, rLName, xAttrList )
+ ,m_rImport(rImport)
+{
+}
+
+RptMLMasterStylesContext_Impl::~RptMLMasterStylesContext_Impl()
+{
+}
+
+void RptMLMasterStylesContext_Impl::EndElement()
+{
+ FinishStyles( sal_True );
+ m_rImport.FinishStyles();
+}
+ /// read a component (file + filter version)
+sal_Int32 ReadThroughComponent(
+ const uno::Reference<XInputStream>& xInputStream,
+ const uno::Reference<XComponent>& xModelComponent,
+ const sal_Char* /*pStreamName*/,
+ const uno::Reference<XMultiServiceFactory> & rFactory,
+ const uno::Reference< XDocumentHandler >& _xFilter,
+ sal_Bool /*bEncrypted*/ )
+{
+ DBG_ASSERT(xInputStream.is(), "input stream missing");
+ DBG_ASSERT(xModelComponent.is(), "document missing");
+ DBG_ASSERT(rFactory.is(), "factory missing");
+
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "rptxml", "oj", "ReadThroughComponent" );
+
+ // prepare ParserInputSrouce
+ InputSource aParserInput;
+ aParserInput.aInputStream = xInputStream;
+
+ // get parser
+ uno::Reference< XParser > xParser(
+ rFactory->createInstance(
+ ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
+ UNO_QUERY );
+ DBG_ASSERT( xParser.is(), "Can't create parser" );
+ if( !xParser.is() )
+ return 1;
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" );
+
+ // get filter
+ DBG_ASSERT( _xFilter.is(), "Can't instantiate filter component." );
+ if( !_xFilter.is() )
+ return 1;
+
+ // connect parser and filter
+ xParser->setDocumentHandler( _xFilter );
+
+ // connect model and filter
+ uno::Reference < XImporter > xImporter( _xFilter, UNO_QUERY );
+ xImporter->setTargetDocument( xModelComponent );
+
+
+#ifdef TIMELOG
+ // if we do profiling, we want to know the stream
+ RTL_LOGFILE_TRACE_AUTHOR1( "rptxml", "oj",
+ "ReadThroughComponent : parsing \"%s\"", pStreamName );
+#endif
+
+ // finally, parser the stream
+ try
+ {
+ xParser->parseStream( aParserInput );
+ }
+ catch( SAXParseException&
+
+#if OSL_DEBUG_LEVEL > 1
+r
+#endif
+)
+ {
+#if OSL_DEBUG_LEVEL > 1
+ ByteString aError( "SAX parse exception catched while importing:\n" );
+ aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
+ aError += ByteString::CreateFromInt32( r.LineNumber );
+ aError += ',';
+ aError += ByteString::CreateFromInt32( r.ColumnNumber );
+
+ DBG_ERROR( aError.GetBuffer() );
+#endif
+ return 1;
+ }
+ catch( SAXException& )
+ {
+ return 1;
+ }
+ catch( packages::zip::ZipIOException& )
+ {
+ return ERRCODE_IO_BROKENPACKAGE;
+ }
+ catch( IOException& )
+ {
+ return 1;
+ }
+ catch( Exception& )
+ {
+ return 1;
+ }
+
+ // success!
+ return 0;
+}
+
+/// read a component (storage version)
+sal_Int32 ReadThroughComponent(
+ uno::Reference< embed::XStorage > xStorage,
+ const uno::Reference<XComponent>& xModelComponent,
+ const sal_Char* pStreamName,
+ const sal_Char* pCompatibilityStreamName,
+ const uno::Reference<XMultiServiceFactory> & rFactory,
+ const ::rtl::OUString& _sFilterName)
+{
+ DBG_ASSERT( xStorage.is(), "Need storage!");
+ DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
+
+ if ( xStorage.is() )
+ {
+ uno::Reference< io::XStream > xDocStream;
+ sal_Bool bEncrypted = sal_False;
+
+ try
+ {
+ // open stream (and set parser input)
+ ::rtl::OUString sStreamName = ::rtl::OUString::createFromAscii(pStreamName);
+ if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
+ {
+ // stream name not found! Then try the compatibility name.
+ // if no stream can be opened, return immediatly with OK signal
+
+ // do we even have an alternative name?
+ if ( NULL == pCompatibilityStreamName )
+ return 0;
+
+ // if so, does the stream exist?
+ sStreamName = ::rtl::OUString::createFromAscii(pCompatibilityStreamName);
+ if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
+ return 0;
+ }
+
+ // get input stream
+ xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
+
+ uno::Reference< beans::XPropertySet > xProps( xDocStream, uno::UNO_QUERY_THROW );
+ uno::Any aAny = xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
+ aAny >>= bEncrypted;
+ }
+ catch( packages::WrongPasswordException& )
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch ( uno::Exception& )
+ {
+ return 1; // TODO/LATER: error handling
+ }
+
+
+ uno::Reference< XDocumentHandler > xFilter(rFactory->createInstance(_sFilterName),uno::UNO_QUERY);
+ uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
+ // read from the stream
+ return ReadThroughComponent( xInputStream
+ ,xModelComponent
+ ,pStreamName
+ ,rFactory
+ ,xFilter
+ ,bEncrypted );
+ }
+
+ // TODO/LATER: better error handling
+ return 1;
+}
+
+//---------------------------------------------------------------------
+uno::Reference< uno::XInterface > ORptImportHelper::create(uno::Reference< uno::XComponentContext > const & xContext)
+{
+ return static_cast< XServiceInfo* >(new ORptFilter(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),IMPORT_SETTINGS ));
+}
+//---------------------------------------------------------------------
+::rtl::OUString ORptImportHelper::getImplementationName_Static( ) throw (RuntimeException)
+{
+ return ::rtl::OUString(SERVICE_SETTINGSIMPORTER);
+}
+//---------------------------------------------------------------------
+Sequence< ::rtl::OUString > ORptImportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = SERVICE_IMPORTFILTER;
+ return aSupported;
+}
+//---------------------------------------------------------------------
+Reference< XInterface > ORptContentImportHelper::create(const Reference< XComponentContext > & xContext)
+{
+ return static_cast< XServiceInfo* >(new ORptFilter(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),IMPORT_AUTOSTYLES | IMPORT_CONTENT | IMPORT_SCRIPTS |
+ IMPORT_FONTDECLS ));
+}
+//---------------------------------------------------------------------
+::rtl::OUString ORptContentImportHelper::getImplementationName_Static( ) throw (RuntimeException)
+{
+ return ::rtl::OUString(SERVICE_CONTENTIMPORTER);
+}
+//---------------------------------------------------------------------
+Sequence< ::rtl::OUString > ORptContentImportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = SERVICE_IMPORTFILTER;
+ return aSupported;
+}
+
+//---------------------------------------------------------------------
+Reference< XInterface > ORptStylesImportHelper::create(Reference< XComponentContext > const & xContext)
+{
+ return static_cast< XServiceInfo* >(new ORptFilter(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),
+ IMPORT_STYLES | IMPORT_MASTERSTYLES | IMPORT_AUTOSTYLES |
+ IMPORT_FONTDECLS ));
+}
+//---------------------------------------------------------------------
+::rtl::OUString ORptStylesImportHelper::getImplementationName_Static( ) throw (RuntimeException)
+{
+ return ::rtl::OUString(SERVICE_STYLESIMPORTER);
+}
+//---------------------------------------------------------------------
+Sequence< ::rtl::OUString > ORptStylesImportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = SERVICE_IMPORTFILTER;
+ return aSupported;
+}
+
+// -------------
+// - ORptFilter -
+// -------------
+
+ORptFilter::ORptFilter( const uno::Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nImportFlags )
+ :SvXMLImport(_rxMSF,nImportFlags)
+{
+ GetMM100UnitConverter().setCoreMeasureUnit(MAP_100TH_MM);
+ GetMM100UnitConverter().setXMLMeasureUnit(MAP_CM);
+ GetNamespaceMap().Add( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__rpt) ),
+ GetXMLToken(XML_N_RPT),
+ XML_NAMESPACE_REPORT );
+
+ GetNamespaceMap().Add( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np___rpt) ),
+ GetXMLToken(XML_N_RPT_OASIS),
+ XML_NAMESPACE_REPORT );
+
+ m_xPropHdlFactory = new OXMLRptPropHdlFactory;
+ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap();
+ m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory);
+ m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory);
+ m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS );
+}
+
+// -----------------------------------------------------------------------------
+
+ORptFilter::~ORptFilter() throw()
+{
+}
+//------------------------------------------------------------------------------
+uno::Reference< XInterface > ORptFilter::create(uno::Reference< XComponentContext > const & xContext)
+{
+ return *(new ORptFilter(uno::Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)));
+}
+
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptFilter::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.OReportFilter"));
+}
+
+//--------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ORptFilter::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > ORptFilter::getSupportedServiceNames_Static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aServices(1);
+ aServices.getArray()[0] = SERVICE_IMPORTFILTER;
+
+ return aServices;
+}
+
+//--------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL ORptFilter::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL ORptFilter::supportsService(const ::rtl::OUString& ServiceName) throw( uno::RuntimeException )
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL ORptFilter::filter( const Sequence< PropertyValue >& rDescriptor )
+ throw (RuntimeException)
+{
+ Window* pFocusWindow = Application::GetFocusWindow();
+ sal_Bool bRet = sal_False;
+
+ if( pFocusWindow )
+ pFocusWindow->EnterWait();
+
+ if ( GetModel().is() )
+ bRet = implImport( rDescriptor );
+
+ if ( pFocusWindow )
+ pFocusWindow->LeaveWait();
+
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+sal_Bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
+ throw (RuntimeException)
+{
+ ::rtl::OUString sFileName;
+ uno::Reference< embed::XStorage > xStorage;
+ uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier;
+
+ const PropertyValue* pIter = rDescriptor.getConstArray();
+ const PropertyValue* pEnd = pIter + rDescriptor.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ if( pIter->Name.equalsAscii( "FileName" ) )
+ pIter->Value >>= sFileName;
+ else if( pIter->Name.equalsAscii( "Storage" ) )
+ pIter->Value >>= xStorage;
+ else if( pIter->Name.equalsAscii( "ComponentData" ) )
+ {
+ Sequence< PropertyValue > aComponent;
+ pIter->Value >>= aComponent;
+ const PropertyValue* pComponentIter = aComponent.getConstArray();
+ const PropertyValue* pComponentEnd = pComponentIter + aComponent.getLength();
+ for(;pComponentIter != pComponentEnd;++pComponentIter)
+ {
+ if( pComponentIter->Name.equalsAscii( "ActiveConnection" ) )
+ {
+ uno::Reference<sdbc::XConnection> xCon(pComponentIter->Value,uno::UNO_QUERY);
+ xNumberFormatsSupplier = ::dbtools::getNumberFormats(xCon);
+ break;
+ }
+ }
+ }
+ }
+
+ if ( sFileName.getLength() != 0 )
+ {
+ uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY);
+
+ SfxMediumRef pMedium = new SfxMedium(
+ sFileName, ( STREAM_READ | STREAM_NOCREATE ), FALSE, 0 );
+
+ if( pMedium )
+ {
+ try
+ {
+ xStorage = pMedium->GetStorage();
+ // nError = pMedium->GetError();
+ }
+ catch(const Exception&)
+ {
+ }
+ } // if( pMedium )
+ } // if ( bRet = (sFileName.getLength() != 0) )
+ sal_Bool bRet = xStorage.is();
+ if ( bRet )
+ {
+ m_xReportDefinition.set(GetModel(),UNO_QUERY_THROW);
+ OSL_ENSURE(m_xReportDefinition.is(),"ReportDefinition is NULL!");
+ if ( !m_xReportDefinition.is() )
+ return sal_False;
+
+ m_pReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
+ if ( !m_pReportModel )
+ return sal_False;
+
+ if ( !xNumberFormatsSupplier.is() )
+ xNumberFormatsSupplier = OXMLHelper::GetNumberFormatsSupplier(m_xReportDefinition);
+ SetNumberFormatsSupplier(xNumberFormatsSupplier);
+
+
+ uno::Reference<XComponent> xModel(GetModel(),UNO_QUERY);
+ sal_Int32 nRet = ReadThroughComponent( xStorage
+ ,xModel
+ ,"settings.xml"
+ ,"Settings.xml"
+ ,getServiceFactory()
+ ,SERVICE_SETTINGSIMPORTER
+ );
+ if ( nRet == 0 )
+ nRet = ReadThroughComponent(
+ xStorage, xModel, "styles.xml", "Styles.xml", getServiceFactory(),
+ SERVICE_STYLESIMPORTER );
+
+ if ( nRet == 0 )
+ nRet = ReadThroughComponent( xStorage
+ ,xModel
+ ,"content.xml"
+ ,"Content.xml"
+ ,getServiceFactory()
+ ,SERVICE_CONTENTIMPORTER
+ );
+
+ bRet = nRet == 0;
+
+ if ( bRet )
+ {
+ uno::Reference< XModifiable > xModi(GetModel(),UNO_QUERY);
+ if ( xModi.is() )
+ xModi->setModified(sal_False);
+ }
+ else
+ {
+ switch( nRet )
+ {
+ case ERRCODE_IO_BROKENPACKAGE:
+ if( xStorage.is() )
+ {
+ // TODO/LATER: no way to transport the error outside from the filter!
+ break;
+ }
+ // fall through intented
+ default:
+ {
+ // TODO/LATER: this is completely wrong! Filter code should never call ErrorHandler directly! But for now this is the only way!
+ ErrorHandler::HandleError( nRet );
+ if( nRet & ERRCODE_WARNING_MASK )
+ bRet = sal_True;
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* ORptFilter::CreateContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList >& xAttrList )
+{
+ SvXMLImportContext *pContext = 0;
+
+ const SvXMLTokenMap& rTokenMap = GetDocElemTokenMap();
+ switch( rTokenMap.Get( nPrefix, rLocalName ) )
+ {
+ case XML_TOK_DOC_SETTINGS:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new XMLDocumentSettingsContext( *this, nPrefix, rLocalName,xAttrList );
+ break;
+ case XML_TOK_DOC_REPORT:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ {
+ const SvXMLStylesContext* pAutoStyles = GetAutoStyles();
+ if ( pAutoStyles )
+ {
+ XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_PAGE_MASTER,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pm1"))));
+ if ( pAutoStyle )
+ {
+ pAutoStyle->FillPropertySet(getReportDefinition().get());
+ }
+ }
+ pContext = new OXMLReport( *this, nPrefix, rLocalName,xAttrList,getReportDefinition(),NULL );
+ }
+ break;
+ case XML_TOK_DOC_STYLES:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = CreateStylesContext( rLocalName, xAttrList, sal_False);
+ break;
+ case XML_TOK_DOC_AUTOSTYLES:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = CreateStylesContext( rLocalName, xAttrList, sal_True);
+ break;
+ case XML_TOK_DOC_FONTDECLS:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = CreateFontDeclsContext( rLocalName,xAttrList );
+ break;
+ case XML_TOK_DOC_MASTERSTYLES:
+ {
+ SvXMLStylesContext* pStyleContext = new RptMLMasterStylesContext_Impl(*this, nPrefix, rLocalName,xAttrList);//CreateMasterStylesContext( rLocalName,xAttrList );
+ pContext = pStyleContext;
+ SetMasterStyles( pStyleContext );
+ }
+ break;
+ default:
+ break;
+ }
+
+ if ( !pContext )
+ pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetDocElemTokenMap() const
+{
+ if ( !m_pDocElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_OFFICE, XML_SETTINGS, XML_TOK_DOC_SETTINGS },
+ //{ XML_NAMESPACE_OOO, XML_SETTINGS, XML_TOK_DOC_SETTINGS },
+ { XML_NAMESPACE_OFFICE, XML_STYLES, XML_TOK_DOC_STYLES },
+ //{ XML_NAMESPACE_OOO, XML_STYLES, XML_TOK_DOC_STYLES },
+ { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES },
+ //{ XML_NAMESPACE_OOO, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES },
+ { XML_NAMESPACE_OFFICE, XML_REPORT, XML_TOK_DOC_REPORT },
+ { XML_NAMESPACE_OOO, XML_REPORT, XML_TOK_DOC_REPORT },
+ { XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS },
+ { XML_NAMESPACE_OFFICE, XML_MASTER_STYLES, XML_TOK_DOC_MASTERSTYLES },
+ //{ XML_NAMESPACE_OOO, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS },
+ XML_TOKEN_MAP_END
+ };
+ m_pDocElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pDocElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetReportElemTokenMap() const
+{
+ if ( !m_pReportElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_REPORT_HEADER, XML_TOK_REPORT_HEADER },
+ { XML_NAMESPACE_REPORT, XML_PAGE_HEADER , XML_TOK_PAGE_HEADER },
+ { XML_NAMESPACE_REPORT, XML_GROUP, XML_TOK_GROUP },
+ { XML_NAMESPACE_REPORT, XML_DETAIL , XML_TOK_DETAIL },
+ { XML_NAMESPACE_REPORT, XML_PAGE_FOOTER , XML_TOK_PAGE_FOOTER },
+ { XML_NAMESPACE_REPORT, XML_REPORT_FOOTER, XML_TOK_REPORT_FOOTER },
+ { XML_NAMESPACE_REPORT, XML_HEADER_ON_NEW_PAGE, XML_TOK_HEADER_ON_NEW_PAGE },
+ { XML_NAMESPACE_REPORT, XML_FOOTER_ON_NEW_PAGE, XML_TOK_FOOTER_ON_NEW_PAGE },
+ { XML_NAMESPACE_REPORT, XML_COMMAND_TYPE, XML_TOK_COMMAND_TYPE },
+ { XML_NAMESPACE_REPORT, XML_COMMAND, XML_TOK_COMMAND },
+ { XML_NAMESPACE_REPORT, XML_FILTER, XML_TOK_FILTER },
+ { XML_NAMESPACE_REPORT, XML_CAPTION, XML_TOK_CAPTION },
+ { XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING, XML_TOK_ESCAPE_PROCESSING },
+ { XML_NAMESPACE_REPORT, XML_FUNCTION, XML_TOK_REPORT_FUNCTION },
+ { XML_NAMESPACE_OFFICE, XML_MIMETYPE, XML_TOK_REPORT_MIMETYPE },
+ XML_TOKEN_MAP_END
+ };
+ m_pReportElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pReportElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetSubDocumentElemTokenMap() const
+{
+ if ( !m_pSubDocumentElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, XML_TOK_MASTER_DETAIL_FIELDS},
+ { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELD, XML_TOK_MASTER_DETAIL_FIELD},
+ { XML_NAMESPACE_REPORT, XML_MASTER, XML_TOK_MASTER},
+ { XML_NAMESPACE_REPORT, XML_DETAIL, XML_TOK_SUB_DETAIL},
+ XML_TOKEN_MAP_END
+ };
+ m_pSubDocumentElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pSubDocumentElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetFunctionElemTokenMap() const
+{
+ if ( !m_pFunctionElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_NAME, XML_TOK_FUNCTION_NAME },
+ { XML_NAMESPACE_REPORT, XML_FORMULA, XML_TOK_FUNCTION_FORMULA},
+ { XML_NAMESPACE_REPORT, XML_PRE_EVALUATED, XML_TOK_PRE_EVALUATED },
+ { XML_NAMESPACE_REPORT, XML_INITIAL_FORMULA,XML_TOK_INITIAL_FORMULA },
+ { XML_NAMESPACE_REPORT, XML_DEEP_TRAVERSING,XML_TOK_DEEP_TRAVERSING },
+ XML_TOKEN_MAP_END
+ };
+ m_pFunctionElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pFunctionElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetFormatElemTokenMap() const
+{
+ if ( !m_pFormatElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_ENABLED , XML_TOK_ENABLED },
+ { XML_NAMESPACE_REPORT, XML_FORMULA , XML_TOK_FORMULA },
+ { XML_NAMESPACE_REPORT, XML_STYLE_NAME , XML_TOK_FORMAT_STYLE_NAME },
+ XML_TOKEN_MAP_END
+ };
+ m_pFormatElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pFormatElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetGroupElemTokenMap() const
+{
+ if ( !m_pGroupElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_START_NEW_COLUMN , XML_TOK_START_NEW_COLUMN },
+ { XML_NAMESPACE_REPORT, XML_RESET_PAGE_NUMBER , XML_TOK_RESET_PAGE_NUMBER },
+ { XML_NAMESPACE_REPORT, XML_PRINT_HEADER_ON_EACH_PAGE , XML_TOK_PRINT_HEADER_ON_EACH_PAGE },
+ { XML_NAMESPACE_REPORT, XML_RESET_PAGE_NUMBER , XML_TOK_RESET_PAGE_NUMBER },
+ { XML_NAMESPACE_REPORT, XML_GROUP_EXPRESSION , XML_TOK_GROUP_EXPRESSION },
+ { XML_NAMESPACE_REPORT, XML_GROUP_HEADER , XML_TOK_GROUP_HEADER },
+ { XML_NAMESPACE_REPORT, XML_GROUP , XML_TOK_GROUP_GROUP },
+ { XML_NAMESPACE_REPORT, XML_DETAIL , XML_TOK_GROUP_DETAIL },
+ { XML_NAMESPACE_REPORT, XML_GROUP_FOOTER , XML_TOK_GROUP_FOOTER },
+ { XML_NAMESPACE_REPORT, XML_SORT_ASCENDING , XML_TOK_SORT_ASCENDING },
+ { XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER , XML_TOK_GROUP_KEEP_TOGETHER },
+ { XML_NAMESPACE_REPORT, XML_FUNCTION , XML_TOK_GROUP_FUNCTION },
+ //{ XML_NAMESPACE_REPORT, XML_ , XML_TOK_ },
+ XML_TOKEN_MAP_END
+ };
+ m_pGroupElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pGroupElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetReportElementElemTokenMap() const
+{
+ if ( !m_pElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_REPORT, XML_PRINT_REPEATED_VALUES ,XML_TOK_PRINT_REPEATED_VALUES },
+ { XML_NAMESPACE_REPORT, XML_PRINT_ONLY_WHEN_GROUP_CHANGE,XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE },
+ { XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION,XML_TOK_REP_CONDITIONAL_PRINT_EXPRESSION },
+ { XML_NAMESPACE_REPORT, XML_REPORT_COMPONENT ,XML_TOK_COMPONENT },
+ { XML_NAMESPACE_REPORT, XML_FORMAT_CONDITION ,XML_TOK_FORMATCONDITION },
+ XML_TOKEN_MAP_END
+ };
+ m_pElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetControlElemTokenMap() const
+{
+ if ( !m_pControlElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_FORM, XML_LABEL ,XML_TOK_LABEL },
+ { XML_NAMESPACE_FORM, XML_PROPERTIES ,XML_TOK_PROPERTIES },
+ { XML_NAMESPACE_FORM, XML_SIZE ,XML_TOK_SIZE },
+ { XML_NAMESPACE_FORM, XML_IMAGE_DATA ,XML_TOK_IMAGE_DATA },
+ { XML_NAMESPACE_REPORT, XML_SCALE ,XML_TOK_SCALE },
+ { XML_NAMESPACE_FORM, XML_IMAGE_POSITION ,XML_TOK_IMAGE_POSITION },
+ { XML_NAMESPACE_FORM, XML_IMAGE_ALIGN ,XML_TOK_IMAGE_ALIGN },
+ { XML_NAMESPACE_REPORT, XML_REPORT_ELEMENT ,XML_TOK_REPORT_ELEMENT },
+ { XML_NAMESPACE_REPORT, XML_FORMULA ,XML_TOK_DATA_FORMULA },
+ { XML_NAMESPACE_REPORT, XML_PRESERVE_IRI ,XML_TOK_PRESERVE_IRI },
+ { XML_NAMESPACE_REPORT, XML_SELECT_PAGE ,XML_TOK_SELECT_PAGE },
+ XML_TOKEN_MAP_END
+ };
+ m_pControlElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pControlElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetControlPropertyElemTokenMap() const
+{
+ if ( !m_pControlElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_FORM, XML_PROPERTY_NAME ,XML_TOK_PROPERTY_NAME },
+ { XML_NAMESPACE_OOO, XML_VALUE_TYPE ,XML_TOK_VALUE_TYPE },
+ { XML_NAMESPACE_FORM, XML_LIST_PROPERTY ,XML_TOK_LIST_PROPERTY },
+ { XML_NAMESPACE_OOO, XML_VALUE ,XML_TOK_VALUE },
+ { XML_NAMESPACE_OOO, XML_CURRENCY ,XML_TOK_CURRENCY },
+ { XML_NAMESPACE_OOO, XML_DATE_VALUE ,XML_TOK_DATE_VALUE },
+ { XML_NAMESPACE_OOO, XML_TIME_VALUE ,XML_TOK_TIME_VALUE },
+ { XML_NAMESPACE_OOO, XML_STRING_VALUE ,XML_TOK_STRING_VALUE },
+ { XML_NAMESPACE_OOO, XML_BOOLEAN_VALUE ,XML_TOK_BOOLEAN_VALUE },
+ XML_TOKEN_MAP_END
+ };
+ m_pControlElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pControlElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetComponentElemTokenMap() const
+{
+ if ( !m_pComponentElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_DRAW, XML_NAME , XML_TOK_NAME },
+ { XML_NAMESPACE_DRAW, XML_TEXT_STYLE_NAME , XML_TOK_TEXT_STYLE_NAME },
+ { XML_NAMESPACE_REPORT, XML_TRANSFORM , XML_TOK_TRANSFORM },
+ XML_TOKEN_MAP_END
+ };
+ m_pComponentElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pComponentElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetColumnTokenMap() const
+{
+ if ( !m_pColumnTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_TABLE, XML_NAME , XML_TOK_NAME },
+ { XML_NAMESPACE_TABLE, XML_STYLE_NAME , XML_TOK_COLUMN_STYLE_NAME },
+ { XML_NAMESPACE_TABLE, XML_TABLE_COLUMN , XML_TOK_COLUMN },
+ { XML_NAMESPACE_TABLE, XML_TABLE_ROW , XML_TOK_ROW },
+ { XML_NAMESPACE_TABLE, XML_TABLE_CELL , XML_TOK_CELL },
+ { XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS , XML_TOK_TABLE_COLUMNS },
+ { XML_NAMESPACE_TABLE, XML_TABLE_ROWS , XML_TOK_TABLE_ROWS },
+ { XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL , XML_TOK_COV_CELL },
+ { XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_SPANNED , XML_TOK_NUMBER_COLUMNS_SPANNED },
+ { XML_NAMESPACE_TABLE, XML_NUMBER_ROWS_SPANNED , XML_TOK_NUMBER_ROWS_SPANNED },
+ XML_TOKEN_MAP_END
+ };
+ m_pColumnTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pColumnTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetSectionElemTokenMap() const
+{
+ if ( !m_pSectionElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_TABLE, XML_TABLE , XML_TOK_TABLE },
+ { XML_NAMESPACE_TABLE, XML_NAME , XML_TOK_SECTION_NAME },
+ { XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION, XML_TOK_CONDITIONAL_PRINT_EXPRESSION},
+ { XML_NAMESPACE_REPORT, XML_VISIBLE , XML_TOK_VISIBLE },
+ { XML_NAMESPACE_REPORT, XML_FORCE_NEW_PAGE , XML_TOK_FORCE_NEW_PAGE },
+ { XML_NAMESPACE_REPORT, XML_FORCE_NEW_COLUMN , XML_TOK_FORCE_NEW_COLUMN },
+ { XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER , XML_TOK_KEEP_TOGETHER },
+ { XML_NAMESPACE_REPORT, XML_REPEAT_SECTION , XML_TOK_REPEAT_SECTION },
+ { XML_NAMESPACE_TABLE, XML_STYLE_NAME , XML_TOK_SECT_STYLE_NAME },
+ { XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION , XML_TOK_PAGE_PRINT_OPTION },
+
+ XML_TOKEN_MAP_END
+ };
+ m_pSectionElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pSectionElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetCellElemTokenMap() const
+{
+ if ( !m_pCellElemTokenMap.get() )
+ {
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { XML_NAMESPACE_TEXT, XML_P , XML_TOK_P },
+ { XML_NAMESPACE_REPORT, XML_FIXED_CONTENT , XML_TOK_FIXED_CONTENT },
+ { XML_NAMESPACE_REPORT, XML_FORMATTED_TEXT , XML_TOK_FORMATTED_TEXT },
+ { XML_NAMESPACE_REPORT, XML_IMAGE , XML_TOK_IMAGE },
+ { XML_NAMESPACE_REPORT, XML_SUB_DOCUMENT , XML_TOK_SUB_DOCUMENT },
+ { XML_NAMESPACE_DRAW, XML_CUSTOM_SHAPE , XML_TOK_CUSTOM_SHAPE },
+ { XML_NAMESPACE_TEXT, XML_PAGE_NUMBER , XML_TOK_PAGE_NUMBER },
+ { XML_NAMESPACE_TEXT, XML_PAGE_COUNT , XML_TOK_PAGE_COUNT },
+ { XML_NAMESPACE_TEXT, XML_TAB , 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_TOKEN_MAP_END
+ };
+ m_pCellElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap ));
+ }
+ return *m_pCellElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* ORptFilter::CreateStylesContext(const ::rtl::OUString& rLocalName,
+ const uno::Reference< XAttributeList>& xAttrList, sal_Bool bIsAutoStyle )
+{
+ SvXMLImportContext* pContext = bIsAutoStyle ? GetAutoStyles() : GetStyles();
+ if ( !pContext )
+ {
+ pContext = new OReportStylesContext(*this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, bIsAutoStyle);
+ if (bIsAutoStyle)
+ //xAutoStyles = pContext;
+ SetAutoStyles((SvXMLStylesContext*)pContext);
+ else
+ //xStyles = pContext;
+ SetStyles((SvXMLStylesContext*)pContext);
+ }
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+SvXMLImport& ORptFilter::getGlobalContext()
+{
+ return *this;
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::enterEventContext()
+{
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::leaveEventContext()
+{
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext *ORptFilter::CreateFontDeclsContext(
+ const ::rtl::OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+{
+ XMLFontStylesContext *pFSContext =
+ new XMLFontStylesContext( *this, XML_NAMESPACE_OFFICE,
+ rLocalName, xAttrList,
+ gsl_getSystemTextEncoding() );
+ SetFontDecls( pFSContext );
+ return pFSContext;
+}
+// -----------------------------------------------------------------------------
+XMLShapeImportHelper* ORptFilter::CreateShapeImport()
+{
+ return new XMLShapeImportHelper( *this,GetModel() );
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::FinishStyles()
+{
+ if( GetStyles() )
+ GetStyles()->FinishStyles( sal_True );
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptFilter::convertFormula(const ::rtl::OUString& _sFormula)
+{
+ //sal_Int32 nLen = _sFormula.getLength();
+ //if ( nLen )
+ //{
+ // const static ::rtl::OUString s_sField(RTL_CONSTASCII_USTRINGPARAM("field:["));
+ // sal_Int32 nPos = _sFormula.indexOf(s_sField);
+ // if ( nPos == -1 )
+ // nPos = 4; // "rpt:"
+ // else
+ // {
+ // nPos = s_sField.getLength();
+ // --nLen; // eat "]"
+ // }
+ // return _sFormula.copy(nPos,nLen-nPos);
+ //}
+ return _sFormula;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ORptFilter::startDocument( void )
+ throw( xml::sax::SAXException, uno::RuntimeException )
+{
+ m_xReportDefinition.set(GetModel(),UNO_QUERY_THROW);
+ OSL_ENSURE(m_xReportDefinition.is(),"ReportDefinition is NULL!");
+ if ( m_xReportDefinition.is() )
+ {
+ m_pReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
+ OSL_ENSURE(m_pReportModel,"Report model is NULL!");
+
+ uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier = OXMLHelper::GetNumberFormatsSupplier(m_xReportDefinition);
+ SetNumberFormatsSupplier(xNumberFormatsSupplier);
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::endDocument( void )
+ throw( xml::sax::SAXException, uno::RuntimeException )
+{
+ DBG_ASSERT( GetModel().is(), "model missing; maybe startDocument wasn't called?" );
+ if( !GetModel().is() )
+ return;
+
+ // this method will modify the document directly -> lock SolarMutex
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ // Clear the shape import to sort the shapes (and not in the
+ // destructor that might be called after the import has finished
+ // for Java filters.
+ if( HasShapeImport() )
+ ClearShapeImport();
+
+ // delegate to parent: takes care of error handling
+ SvXMLImport::endDocument();
+}
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx
new file mode 100644
index 000000000000..da3cd6b24246
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlfilter.hxx
@@ -0,0 +1,277 @@
+#ifndef RPT_XMLFILTER_HXX
+#define RPT_XMLFILTER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlfilter.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
+#include <com/sun/star/container/XNamed.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XFILTER_HPP_
+#include <com/sun/star/document/XFilter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XIMPORTER_HPP_
+#include <com/sun/star/document/XImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XEXPORTER_HPP_
+#include <com/sun/star/document/XExporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
+#include <com/sun/star/lang/XComponent.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE5_HXX_
+#include <cppuhelper/implbase5.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _UNOTOOLS_TEMPFILE_HXX
+#include <unotools/tempfile.hxx>
+#endif
+#ifndef _UNOTOOLS_LOCALFILEHELPER_HXX
+#include <unotools/localfilehelper.hxx>
+#endif
+#ifndef _UNTOOLS_UCBSTREAMHELPER_HXX
+#include <unotools/ucbstreamhelper.hxx>
+#endif
+#ifndef _XMLOFF_XMLIMP_HXX
+#include <xmloff/xmlimp.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#include <memory>
+#include <boost/shared_ptr.hpp>
+
+#ifndef _XMLOFF_PROPERTYHANDLERFACTORY_HXX
+#include <xmloff/prhdlfac.hxx>
+#endif
+#ifndef _XMLOFF_PROPERTYSETMAPPER_HXX
+#include <xmloff/xmlprmap.hxx>
+#endif
+
+namespace rptui
+{
+ class OReportModel;
+}
+namespace rptxml
+{
+using namespace ::xmloff::token;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::document;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::report;
+using namespace ::com::sun::star::xml::sax;
+
+// -------------
+// - ORptFilter -
+// -------------
+class ORptFilter : public SvXMLImport
+{
+public:
+ DECLARE_STL_USTRINGACCESS_MAP(Sequence<PropertyValue>,TPropertyNameMap);
+
+private:
+ com::sun::star::uno::Any m_aViewSettings;
+ Reference< XComponent > m_xSrcDoc;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pDocElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pReportElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pGroupsElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pGroupElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pSectionElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pComponentElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pControlElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pFunctionElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pSubDocumentElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pFormatElemTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pColumnTokenMap;
+ mutable ::std::auto_ptr<SvXMLTokenMap> m_pCellElemTokenMap;
+
+ UniReference < XMLPropertyHandlerFactory > m_xPropHdlFactory;
+ UniReference < XMLPropertySetMapper > m_xCellStylesPropertySetMapper;
+ UniReference < XMLPropertySetMapper > m_xColumnStylesPropertySetMapper;
+ UniReference < XMLPropertySetMapper > m_xRowStylesPropertySetMapper;
+ UniReference < XMLPropertySetMapper > m_xTableStylesPropertySetMapper;
+
+ Reference<XReportDefinition> m_xReportDefinition;
+ ::boost::shared_ptr<rptui::OReportModel> m_pReportModel;
+ sal_Int32 m_nPreviewMode;
+
+ sal_Bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
+
+ SvXMLImportContext* CreateStylesContext(const ::rtl::OUString& rLocalName,
+ const Reference< XAttributeList>& xAttrList, sal_Bool bIsAutoStyle );
+ SvXMLImportContext *CreateFontDeclsContext(const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+protected:
+ // SvXMLImport
+ virtual SvXMLImportContext *CreateContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
+
+ virtual XMLShapeImportHelper* CreateShapeImport();
+
+ virtual ~ORptFilter() throw();
+public:
+
+ ORptFilter( const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nImportFlags = IMPORT_ALL );
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) throw(RuntimeException);
+
+ // ::com::sun::star::lang::XServiceInfo
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+
+ inline Reference< XMultiServiceFactory > getORB() { return SvXMLImport::getServiceFactory(); }
+ inline Reference<XReportDefinition> getReportDefinition() const { return m_xReportDefinition; }
+ /** return the SdrModel of the real model
+ *
+ * \return
+ */
+ ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const { return m_pReportModel; }
+ void FinishStyles();
+
+ virtual void SAL_CALL startDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL endDocument(void)
+ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException );
+
+ const SvXMLTokenMap& GetDocElemTokenMap() const;
+ const SvXMLTokenMap& GetReportElemTokenMap() const;
+ const SvXMLTokenMap& GetGroupElemTokenMap() const;
+ const SvXMLTokenMap& GetSectionElemTokenMap() const;
+ const SvXMLTokenMap& GetComponentElemTokenMap() const;
+ const SvXMLTokenMap& GetReportElementElemTokenMap() const;
+ const SvXMLTokenMap& GetControlElemTokenMap() const;
+ const SvXMLTokenMap& GetControlPropertyElemTokenMap() const;
+ const SvXMLTokenMap& GetFunctionElemTokenMap() const;
+ const SvXMLTokenMap& GetFormatElemTokenMap() const;
+ const SvXMLTokenMap& GetSubDocumentElemTokenMap() const;
+ const SvXMLTokenMap& GetColumnTokenMap() const;
+ const SvXMLTokenMap& GetCellElemTokenMap() const;
+
+ inline UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper() const { return m_xCellStylesPropertySetMapper; }
+ inline UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper() const { return m_xColumnStylesPropertySetMapper; }
+ inline UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper() const { return m_xRowStylesPropertySetMapper; }
+ inline UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper() const { return m_xTableStylesPropertySetMapper; }
+ static ::rtl::OUString convertFormula(const ::rtl::OUString& _sFormula);
+
+ virtual SvXMLImport& getGlobalContext();
+
+ virtual void enterEventContext();
+ virtual void leaveEventContext();
+};
+
+/** Imports only settings
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptImportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+/** Imports only content
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptContentImportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+/** Imports only styles
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptStylesImportHelper
+{
+public:
+ static ::rtl::OUString getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+};
+
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_XMLFILTER_HXX
diff --git a/reportdesign/source/filter/xml/xmlservices.cxx b/reportdesign/source/filter/xml/xmlservices.cxx
new file mode 100644
index 000000000000..d429ffcc6c64
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlservices.cxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlservices.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:18 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _CPPUHELPER_IMPLEMENATIONENTRY_HXX_
+#include <cppuhelper/implementationentry.hxx>
+#endif
+
+#ifndef RPT_XMLFILTER_HXX
+#include "xmlfilter.hxx"
+#endif
+#ifndef RPT_XMLEXPORT_HXX
+#include "xmlExport.hxx"
+#endif
+
+#ifndef RPTXML_DBLOADER2_HXX
+#include "dbloader2.hxx"
+#endif
+
+
+
+/********************************************************************************************/
+
+using namespace ::rtl;
+using namespace ::rptxml;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+/********************************************************************************************/
+// registry functions
+namespace
+{
+
+cppu::ImplementationEntry entries[] = {
+ { &ORptFilter::create, &ORptFilter::getImplementationName_Static, &ORptFilter::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptTypeDetection::create, &ORptTypeDetection::getImplementationName_Static, &ORptTypeDetection::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ODBFullExportHelper::create, &ODBFullExportHelper::getImplementationName_Static, &ODBFullExportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptExportHelper::create, &ORptExportHelper::getImplementationName_Static, &ORptExportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptExport::create, &ORptExport::getImplementationName_Static, &ORptExport::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptContentExportHelper::create, &ORptContentExportHelper::getImplementationName_Static, &ORptContentExportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptStylesExportHelper::create, &ORptStylesExportHelper::getImplementationName_Static, &ORptStylesExportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+
+ { &ORptImportHelper::create, &ORptImportHelper::getImplementationName_Static, &ORptImportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptContentImportHelper::create, &ORptContentImportHelper::getImplementationName_Static, &ORptContentImportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptStylesImportHelper::create, &ORptStylesImportHelper::getImplementationName_Static, &ORptStylesImportHelper::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+}
+
+extern "C" void * SAL_CALL component_getFactory(
+ char const * implName, void * serviceManager, void * registryKey)
+{
+ return cppu::component_getFactoryHelper(
+ implName, serviceManager, registryKey, entries);
+}
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ char const ** envTypeName, uno_Environment **)
+{
+ *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(
+ void * serviceManager, void * registryKey)
+{
+ return cppu::component_writeInfoHelper(
+ serviceManager, registryKey, entries);
+}
diff --git a/reportdesign/source/inc/GroupProperties.hxx b/reportdesign/source/inc/GroupProperties.hxx
new file mode 100644
index 000000000000..4519b8007872
--- /dev/null
+++ b/reportdesign/source/inc/GroupProperties.hxx
@@ -0,0 +1,62 @@
+#ifndef RPT_SHARED_GROUPS_PROPERTIES_HXX
+#define RPT_SHARED_GROUPS_PROPERTIES_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupProperties.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+namespace rptshared
+{
+ /** struct for the group properties
+ */
+ struct GroupProperties
+ {
+ ::sal_Int32 m_nGroupInterval;
+ ::rtl::OUString m_sExpression;
+ ::sal_Int16 m_nGroupOn;
+ ::sal_Int16 m_nKeepTogether;
+ ::sal_Bool m_eSortAscending;
+ ::sal_Bool m_bStartNewColumn;
+ ::sal_Bool m_bResetPageNumber;
+
+ GroupProperties()
+ :m_nGroupInterval(1)
+ ,m_nGroupOn(0)
+ ,m_nKeepTogether(0)
+ ,m_eSortAscending(sal_True)
+ ,m_bStartNewColumn(sal_False)
+ ,m_bResetPageNumber(sal_False)
+ {}
+ };
+}
+#endif //RPT_SHARED_GROUPS_PROPERTIES_HXX
diff --git a/reportdesign/source/inc/constasciistring.hxx b/reportdesign/source/inc/constasciistring.hxx
new file mode 100644
index 000000000000..48ca8e20ceba
--- /dev/null
+++ b/reportdesign/source/inc/constasciistring.hxx
@@ -0,0 +1,61 @@
+#ifndef _RPTSHARED_CONSTASCIISTRING_HXX_
+#define _RPTSHARED_CONSTASCIISTRING_HXX_
+
+#ifndef CONSTASCII_INCLUDED_INDIRECT
+#error "don't include this file directly! use stringconstants.hrc instead!"
+#endif
+
+// no namespaces. This file is included from several other files _within_ a namespace.
+
+//============================================================
+//= a helper for static ascii pseudo-unicode strings
+//============================================================
+// string constants
+struct ConstAsciiString
+{
+ const sal_Char* ascii;
+ sal_Int32 length;
+
+ inline operator const ::rtl::OUString& () const;
+ inline operator const sal_Char* () const { return ascii; }
+
+ inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength);
+ inline ~ConstAsciiString();
+
+private:
+ mutable ::rtl::OUString* ustring;
+};
+
+//------------------------------------------------------------
+inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength)
+ :ascii(_pAsciiZeroTerminated)
+ ,length(_nLength)
+ ,ustring(NULL)
+{
+}
+
+//------------------------------------------------------------
+inline ConstAsciiString::~ConstAsciiString()
+{
+ delete ustring;
+ ustring = NULL;
+}
+
+//------------------------------------------------------------
+inline ConstAsciiString::operator const ::rtl::OUString& () const
+{
+ if (!ustring)
+ ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US);
+ return *ustring;
+}
+
+//============================================================
+
+#define DECLARE_CONSTASCII_USTRING( name ) \
+ extern const ConstAsciiString name
+
+#define IMPLEMENT_CONSTASCII_USTRING( name, string ) \
+ const ConstAsciiString name(string, sizeof(string)-1)
+
+
+#endif // _RPTSHARED_CONSTASCIISTRING_HXX_
diff --git a/reportdesign/source/inc/corestrings.hrc b/reportdesign/source/inc/corestrings.hrc
new file mode 100644
index 000000000000..1ad0d52b49f3
--- /dev/null
+++ b/reportdesign/source/inc/corestrings.hrc
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: corestrings.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#define REPORTDESIGN_SHARED_CORESTRINGS_HRC
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+namespace reportdesign
+{
+#define STRINGCONSTANTS_INCLUDED_INDIRECT
+#include "stringconstants.hrc"
+#undef STRINGCONSTANTS_INCLUDED_INDIRECT
+}
+
+#endif // REPORTDESIGN_SHARED_CORESTRINGS_HRC
diff --git a/reportdesign/source/inc/stringconstants.hrc b/reportdesign/source/inc/stringconstants.hrc
new file mode 100644
index 000000000000..b77665b1a0c3
--- /dev/null
+++ b/reportdesign/source/inc/stringconstants.hrc
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stringconstants.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _REPORTDESIGN_STRINGCONSTANTS_HRC_
+#define _REPORTDESIGN_STRINGCONSTANTS_HRC_
+
+#ifndef STRINGCONSTANTS_INCLUDED_INDIRECT
+#error "don't include this file directly! use dbastrings.hrc or dbustrings.hrc instead!"
+#endif
+
+#define CONSTASCII_INCLUDED_INDIRECT
+#include "constasciistring.hxx"
+#undef CONSTASCII_INCLUDED_INDIRECT
+
+//============================================================
+//= service names
+//============================================================
+
+DECLARE_CONSTASCII_USTRING(SERVICE_FIXEDTEXT);
+DECLARE_CONSTASCII_USTRING(SERVICE_FIXEDLINE);
+DECLARE_CONSTASCII_USTRING(SERVICE_FORMATTEDFIELD);
+DECLARE_CONSTASCII_USTRING(SERVICE_IMAGECONTROL);
+DECLARE_CONSTASCII_USTRING(SERVICE_FORMATCONDITION);
+DECLARE_CONSTASCII_USTRING(SERVICE_REPORTENGINE);
+DECLARE_CONSTASCII_USTRING(SERVICE_FUNCTION);
+DECLARE_CONSTASCII_USTRING(SERVICE_REPORTDEFINITION);
+DECLARE_CONSTASCII_USTRING(SERVICE_SHAPE);
+DECLARE_CONSTASCII_USTRING(SERVICE_SECTION);
+DECLARE_CONSTASCII_USTRING(SERVICE_GROUP);
+//============================================================
+//= property names
+//============================================================
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_VISIBLE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_NAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_HEIGHT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BACKCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BACKTRANSPARENT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLBACKGROUND);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLBACKGROUNDTRANSPARENT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORCENEWPAGE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_NEWROWORCOL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_KEEPTOGETHER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CANGROW );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CANSHRINK );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPEATSECTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_GROUP );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTDEFINITION);
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_HEADER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FOOTER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_GROUPINTERVAL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_EXPRESSION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_GROUPON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_SORTASCENDING );
+DECLARE_CONSTASCII_USTRING(PROPERTY_GROUPS );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_MASTERFIELDS );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DETAILFIELDS );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTHEADER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTFOOTER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEHEADER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEFOOTER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DETAIL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CAPTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BACKGRAPHICURL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_COMMAND );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BACKGRAPHICLOCATION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ORIENTATION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAPERFORMAT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAPERSIZE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_GROUPKEEPTOGETHER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEHEADEROPTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEFOOTEROPTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTHEADERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTFOOTERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEHEADERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGEFOOTERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_HEADERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FOOTERON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_WIDTH );
+DECLARE_CONSTASCII_USTRING(PROPERTY_POSITIONX );
+DECLARE_CONSTASCII_USTRING(PROPERTY_POSITIONY );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DATAFIELD );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PARAADJUST );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLTEXTEMPHASISMARK );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARRELIEF );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_VERTICALALIGN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_IMAGEPOSITION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_IMAGEURL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINECOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LABEL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVEDEFAULT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVEMAX );
+DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVEMIN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATKEY );
+DECLARE_CONSTASCII_USTRING(PROPERTY_MAXTEXTLEN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LISTSOURCE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATSSUPPLIER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_SCALEIMAGE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLBORDER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLBORDERCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BORDER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULTCONTROL );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_LEFTMARGIN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_RIGHTMARGIN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TOPMARGIN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BOTTOMMARGIN );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_PRINTREPEATEDVALUES );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CONDITIONALPRINTEXPRESSION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_STARTNEWCOLUMN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_STARTNEWPAGE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_RESETPAGENUMBER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_MINHEIGHTNEWPAGE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_SHAPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PRINTWHENGROUPCHANGE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_STATE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TRISTATE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LISTSOURCETYPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTCHARWIDTH);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTCHARSET);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTFAMILY);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTHEIGHT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTHEIGHT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTKERNING);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTNAME);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTORIENTATION);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTPITCH);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTSLANT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARSTRIKEOUT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTSTRIKEOUT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTSTYLENAME);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTUNDERLINE);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTWEIGHT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTWIDTH);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTWORDLINEMODE);
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTTYPE);
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_ENABLED );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHAREMPHASIS );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTNAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILY );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSET );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCH );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARHEIGHT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWEIGHT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARPOSTURE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWORDMODE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARROTATION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTH );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_STATUSINDICATOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_SECTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILTER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ESCAPEPROCESSING );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_MULTILINE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ACTIVECONNECTION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMULA );
+DECLARE_CONSTASCII_USTRING(PROPERTY_INITIALFORMULA );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PREEVALUATED );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DEEPTRAVERSING );
+DECLARE_CONSTASCII_USTRING(PROPERTY_MIMETYPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_BACKGROUNDCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTLINECOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTRELIEF );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTEMPHASISMARK );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ZORDER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TRANSFORMATION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEENGINE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEDATA );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEGEOMETRY );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_NUMBERINGTYPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PAGESTYLELAYOUT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ISLANDSCAPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_ALIGN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TYPE );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_PRESERVEIRI );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_LINESTYLE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LINEDASH );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LINECOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LINETRANSPARENCE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_LINEWIDTH );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFLASH );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARAUTOKERNING );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARESCAPEMENTHEIGHT);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARLOCALE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARESCAPEMENT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCASEMAP );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCOMBINEISON );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCOMBINEPREFIX );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCOMBINESUFFIX );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARHIDDEN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARSHADOWED );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARCONTOURED );
+DECLARE_CONSTASCII_USTRING(PROPERTY_HYPERLINKURL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_HYPERLINKTARGET );
+DECLARE_CONSTASCII_USTRING(PROPERTY_HYPERLINKNAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_VISITEDCHARSTYLENAME);
+DECLARE_CONSTASCII_USTRING(PROPERTY_UNVISITEDCHARSTYLENAME);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARKERNING );
+
+
+//============================================================
+//= service names
+//============================================================
+#endif // _REPORTDESIGN_STRINGCONSTANTS_HRC_
+
diff --git a/reportdesign/source/inc/uistrings.hrc b/reportdesign/source/inc/uistrings.hrc
new file mode 100644
index 000000000000..ec1c8c4c7859
--- /dev/null
+++ b/reportdesign/source/inc/uistrings.hrc
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uistrings.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#define REPORTDESIGN_SHARED_UISTRINGS_HRC
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+namespace rptui
+{
+#define STRINGCONSTANTS_INCLUDED_INDIRECT
+#include "stringconstants.hrc"
+#undef STRINGCONSTANTS_INCLUDED_INDIRECT
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_REPORTNAME );
+DECLARE_CONSTASCII_USTRING(CFG_REPORTDESIGNER );
+DECLARE_CONSTASCII_USTRING(DBREPORTHEADER );
+DECLARE_CONSTASCII_USTRING(DBREPORTFOOTER );
+DECLARE_CONSTASCII_USTRING(DBPAGEHEADER );
+DECLARE_CONSTASCII_USTRING(DBPAGEFOOTER );
+DECLARE_CONSTASCII_USTRING(DBGROUPHEADER );
+DECLARE_CONSTASCII_USTRING(DBGROUPFOOTER );
+DECLARE_CONSTASCII_USTRING(DBCOLUMNHEADER );
+DECLARE_CONSTASCII_USTRING(DBCOLUMNFOOTER );
+DECLARE_CONSTASCII_USTRING(DBDETAIL );
+DECLARE_CONSTASCII_USTRING(REPORTCONTROLFORMAT );
+DECLARE_CONSTASCII_USTRING(CURRENT_WINDOW );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_EMPTY_IS_NULL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILTERPROPOSAL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_POSITION );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATKEYDATE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATKEYTIME );
+
+}
+
+#endif // REPORTDESIGN_SHARED_UISTRINGS_HRC
+
diff --git a/reportdesign/source/inc/xmlstrings.hrc b/reportdesign/source/inc/xmlstrings.hrc
new file mode 100644
index 000000000000..e1dbc3e0f01f
--- /dev/null
+++ b/reportdesign/source/inc/xmlstrings.hrc
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlstrings.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#define REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+
+#ifndef _RTL_USTRING_HXX_
+#include <rtl/ustring.hxx>
+#endif
+
+namespace rptxml
+{
+#define STRINGCONSTANTS_INCLUDED_INDIRECT
+#include "stringconstants.hrc"
+#undef STRINGCONSTANTS_INCLUDED_INDIRECT
+
+ //============================================================
+ //= XML
+ //============================================================
+ DECLARE_CONSTASCII_USTRING(SERVICE_SETTINGSIMPORTER);
+ DECLARE_CONSTASCII_USTRING(SERVICE_STYLESIMPORTER);
+ DECLARE_CONSTASCII_USTRING(SERVICE_CONTENTIMPORTER);
+ DECLARE_CONSTASCII_USTRING(SERVICE_IMPORTFILTER);
+
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERLEFT);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERRIGHT);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERTOP);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERBOTTOM);
+}
+
+#endif // REPORTDESIGN_SHARED_XMLSTRINGS_HRC
diff --git a/reportdesign/source/shared/corestrings.cxx b/reportdesign/source/shared/corestrings.cxx
new file mode 100644
index 000000000000..cf5317f6ecdc
--- /dev/null
+++ b/reportdesign/source/shared/corestrings.cxx
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: corestrings.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:28 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "corestrings.hrc"
+
+namespace reportdesign
+{
+#include "stringconstants.cxx"
+}
+
diff --git a/reportdesign/source/shared/makefile.mk b/reportdesign/source/shared/makefile.mk
new file mode 100644
index 000000000000..574588a26704
--- /dev/null
+++ b/reportdesign/source/shared/makefile.mk
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+LIBTARGET=NO
+TARGET=shared
+LIB1TARGET=$(SLB)$/coreshared.lib
+LIB2TARGET=$(SLB)$/xmlshared.lib
+LIB3TARGET=$(SLB)$/uishared.lib
+
+#ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Types -------------------------------------
+
+# --- Files -------------------------------------
+
+SLOFILES= \
+ $(SLO)$/corestrings.obj \
+ $(SLO)$/uistrings.obj \
+ $(SLO)$/xmlstrings.obj \
+
+
+LIB1OBJFILES= \
+ $(SLO)$/corestrings.obj
+
+
+LIB2OBJFILES= \
+ $(SLO)$/xmlstrings.obj
+
+LIB3OBJFILES= \
+ $(SLO)$/uistrings.obj
+
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/reportdesign/source/shared/stringconstants.cxx b/reportdesign/source/shared/stringconstants.cxx
new file mode 100644
index 000000000000..80645bb4772c
--- /dev/null
+++ b/reportdesign/source/shared/stringconstants.cxx
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stringconstants.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "stringconstants.hrc"
+
+//============================================================
+//= service names
+//============================================================
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_FIXEDTEXT , "com.sun.star.report.FixedText");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_FORMATTEDFIELD , "com.sun.star.report.FormattedField");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_IMAGECONTROL , "com.sun.star.report.ImageControl");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_FORMATCONDITION , "com.sun.star.report.FormatCondition");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_REPORTENGINE , "com.sun.star.report.ReportEngine");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_FUNCTION , "com.sun.star.report.Function");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_REPORTDEFINITION , "com.sun.star.report.ReportDefinition");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_SHAPE , "com.sun.star.report.Shape");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_FIXEDLINE , "com.sun.star.report.FixedLine");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_SECTION , "com.sun.star.report.Section");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_GROUP , "com.sun.star.report.Group");
+
+//============================================================
+//= property names
+//============================================================
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VISIBLE , "Visible");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NAME , "Name");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HEIGHT , "Height");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKCOLOR , "BackColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKTRANSPARENT , "BackTransparent");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLBACKGROUND , "ControlBackground");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLBACKGROUNDTRANSPARENT , "ControlBackgroundTransparent");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORCENEWPAGE , "ForceNewPage");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NEWROWORCOL , "NewRowOrCol");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_KEEPTOGETHER , "KeepTogether");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANGROW , "CanGrow");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANSHRINK , "CanShrink");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPEATSECTION , "RepeatSection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUP , "Group");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTDEFINITION , "ReportDefinition");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HEADER , "Header");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FOOTER , "Footer");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUPINTERVAL , "GroupInterval");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EXPRESSION , "Expression");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUPON , "GroupOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SORTASCENDING , "SortAscending");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUPS , "Groups");
+
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MASTERFIELDS , "MasterFields");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DETAILFIELDS , "DetailFields");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTHEADER , "ReportHeader");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTFOOTER , "ReportFooter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEHEADER , "PageHeader");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEFOOTER , "PageFooter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DETAIL , "Detail");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CAPTION , "Caption");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKGRAPHICURL , "BackGraphicURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMAND , "Command");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKGRAPHICLOCATION , "BackGraphicLocation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ORIENTATION , "Orientation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAPERFORMAT , "PaperFormat");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAPERSIZE , "Size");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_GROUPKEEPTOGETHER , "GroupKeepTogether");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEHEADEROPTION , "PageHeaderOption");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEFOOTEROPTION , "PageFooterOption");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE , "CommandType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTHEADERON , "ReportHeaderOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTFOOTERON , "ReportFooterOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEHEADERON , "PageHeaderOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGEFOOTERON , "PageFooterOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HEADERON , "HeaderOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FOOTERON , "FooterOn");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_WIDTH , "Width");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_POSITIONX , "PositionX");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_POSITIONY , "PositionY");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATAFIELD , "DataField");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PARAADJUST , "ParaAdjust");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALIGN , "Align");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTOR , "FontDescriptor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLTEXTEMPHASISMARK , "ControlTextEmphasis");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARRELIEF , "CharRelief");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCOLOR , "CharColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VERTICALALIGN , "ParaVertAlignment");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_IMAGEPOSITION , "ImagePosition");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_IMAGEURL , "ImageURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINECOLOR , "CharUnderlineColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LABEL , "Label");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVEDEFAULT , "EffectiveDefault");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVEMAX , "EffectiveMax");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVEMIN , "EffectiveMin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATKEY , "FormatKey");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXTEXTLEN , "MaxTextLen");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LISTSOURCE , "ListSource");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATSSUPPLIER , "FormatsSupplier");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCALEIMAGE , "ScaleImage");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLBORDER , "ControlBorder");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLBORDERCOLOR , "ControlBorderColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDER , "Border");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDERCOLOR , "BorderColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULTCONTROL , "DefaultControl");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LEFTMARGIN , "LeftMargin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RIGHTMARGIN , "RightMargin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TOPMARGIN , "TopMargin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BOTTOMMARGIN , "BottomMargin");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRINTREPEATEDVALUES , "PrintRepeatedValues");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONDITIONALPRINTEXPRESSION , "ConditionalPrintExpression");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SHAPE , "Shape");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STARTNEWCOLUMN , "StartNewColumn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESETPAGENUMBER , "ResetPageNumber");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRINTWHENGROUPCHANGE , "PrintWhenGroupChange");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STATE , "State");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TRISTATE , "TriState");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LISTSOURCETYPE , "ListSourceType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTCHARWIDTH, "FontCharWidth");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTCHARSET, "CharFontCharSet");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTFAMILY, "CharFontFamily");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTHEIGHT, "CharHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTHEIGHT, "FontHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTKERNING, "FontKerning");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTNAME, "FontName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTORIENTATION, "CharRotation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTPITCH, "CharFontPitch");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTSLANT, "CharPosture");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARSTRIKEOUT, "CharStrikeout");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTSTRIKEOUT, "FontStrikeout");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTSTYLENAME, "CharFontStyleName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTUNDERLINE, "CharUnderline");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTWEIGHT, "CharWeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTWIDTH, "FontWidth");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTWORDLINEMODE, "FontWordLineMode");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTTYPE, "FontType");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ENABLED , "Enabled");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHAREMPHASIS, "CharEmphasis");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTNAME, "CharFontName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAME,"CharFontStyleName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILY, "CharFontFamily");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSET, "CharFontCharSet");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCH, "CharFontPitch");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARHEIGHT, "CharHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINE, "CharUnderline");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWEIGHT, "CharWeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARPOSTURE, "CharPosture");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWORDMODE, "CharWordMode");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARROTATION, "CharRotation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTH, "CharScaleWidth");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STATUSINDICATOR, "StatusIndicator");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SECTION, "Section");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTER, "Filter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MULTILINE, "MultiLine");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ESCAPEPROCESSING, "EscapeProcessing");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ACTIVECONNECTION, "ActiveConnection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMULA, "Formula");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_INITIALFORMULA, "InitialFormula");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PREEVALUATED, "PreEvaluated");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEEPTRAVERSING, "DeepTraversing");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MIMETYPE, "MimeType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKGROUNDCOLOR, "BackgroundColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR, "TextColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTLINECOLOR , "TextLineColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTRELIEF , "FontRelief");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTEMPHASISMARK, "FontEmphasisMark");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ZORDER, "ZOrder");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TRANSFORMATION, "Transformation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEENGINE, "CustomShapeEngine");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEDATA, "CustomShapeData");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CUSTOMSHAPEGEOMETRY,"CustomShapeGeometry");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NUMBERINGTYPE, "NumberingType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PAGESTYLELAYOUT, "PageStyleLayout");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISLANDSCAPE, "IsLandscape");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPE , "Type");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINESTYLE , "LineStyle");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINEDASH , "LineDash");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINECOLOR , "LineColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINETRANSPARENCE, "LineTransparence");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINEWIDTH , "LineWidth");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRESERVEIRI , "PreserveIRI");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFLASH, "CharFlash");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARESCAPEMENTHEIGHT, "CharEscapementHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARLOCALE, "CharLocale");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARESCAPEMENT, "CharEscapement");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCASEMAP, "CharCaseMap");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCOMBINEISON, "CharCombineIsOn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCOMBINEPREFIX, "CharCombinePrefix");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCOMBINESUFFIX, "CharCombineSuffix");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARHIDDEN, "CharHidden");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARSHADOWED, "CharShadowed");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCONTOURED, "CharContoured");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARAUTOKERNING, "CharAutoKerning");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARKERNING, "CharKerning");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HYPERLINKURL , "HyperLinkURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HYPERLINKTARGET , "HyperLinkTarget");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HYPERLINKNAME , "HyperLinkName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VISITEDCHARSTYLENAME, "VisitedCharStyleName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UNVISITEDCHARSTYLENAME, "UnvisitedCharStyleName");
+
diff --git a/reportdesign/source/shared/uistrings.cxx b/reportdesign/source/shared/uistrings.cxx
new file mode 100644
index 000000000000..be4d237eaf7f
--- /dev/null
+++ b/reportdesign/source/shared/uistrings.cxx
@@ -0,0 +1,62 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uistrings.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "uistrings.hrc"
+
+namespace rptui
+{
+#include "stringconstants.cxx"
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTNAME , "ReportName");
+ IMPLEMENT_CONSTASCII_USTRING(CFG_REPORTDESIGNER , "ReportDesigner");
+ IMPLEMENT_CONSTASCII_USTRING(DBREPORTHEADER , "ReportHeader");
+ IMPLEMENT_CONSTASCII_USTRING(DBREPORTFOOTER , "ReportFooter");
+ IMPLEMENT_CONSTASCII_USTRING(DBPAGEHEADER , "PageHeader");
+ IMPLEMENT_CONSTASCII_USTRING(DBPAGEFOOTER , "PageFooter");
+ IMPLEMENT_CONSTASCII_USTRING(DBGROUPHEADER , "GroupHeader");
+ IMPLEMENT_CONSTASCII_USTRING(DBGROUPFOOTER , "GroupFooter");
+ IMPLEMENT_CONSTASCII_USTRING(DBCOLUMNHEADER , "ColumnHeader");
+ IMPLEMENT_CONSTASCII_USTRING(DBCOLUMNFOOTER , "ColumnFooter");
+ IMPLEMENT_CONSTASCII_USTRING(DBDETAIL , "Detail");
+ IMPLEMENT_CONSTASCII_USTRING(REPORTCONTROLFORMAT , "ReportControlFormat");
+ IMPLEMENT_CONSTASCII_USTRING(CURRENT_WINDOW , "CurrentWindow");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTCOLOR , "FontColor");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EMPTY_IS_NULL , "ConvertEmptyToNull");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTERPROPOSAL , "UseFilterValueProposal");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_POSITION , "Position");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATKEYDATE , "FormatKeyDate");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATKEYTIME , "FormatKeyTime");
+}
+
diff --git a/reportdesign/source/shared/xmlstrings.cxx b/reportdesign/source/shared/xmlstrings.cxx
new file mode 100644
index 000000000000..06ada427d30b
--- /dev/null
+++ b/reportdesign/source/shared/xmlstrings.cxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: xmlstrings.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlstrings.hrc"
+
+namespace rptxml
+{
+#include "stringconstants.cxx"
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_SETTINGSIMPORTER , "com.sun.star.comp.Report.XMLOasisSettingsImporter");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_STYLESIMPORTER , "com.sun.star.comp.Report.XMLOasisStylesImporter");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_CONTENTIMPORTER , "com.sun.star.comp.Report.XMLOasisContentImporter");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_IMPORTFILTER , "com.sun.star.comp.document.ImportFilter");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDERLEFT , "BorderLeft");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDERRIGHT , "BorderRight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDERTOP , "BorderTop");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDERBOTTOM , "BorderBottom");
+}
+
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
new file mode 100644
index 000000000000..1aff442b9be4
--- /dev/null
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -0,0 +1,418 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AddField.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_ADDFIELDWINDOW_HXX
+#include "AddField.hxx"
+#endif
+#include "UITools.hxx"
+
+#ifndef _SVX_DBAEXCHANGE_HXX_
+#include <svx/dbaexchange.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
+#include <com/sun/star/sdb/CommandType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _SV_WAITOBJ_HXX
+#include <vcl/waitobj.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _SVDPAGV_HXX
+#include <svx/svdpagv.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+
+namespace rptui
+{
+const long STD_WIN_SIZE_X = 120;
+const long STD_WIN_SIZE_Y = 150;
+
+const long LISTBOX_BORDER = 2;
+
+using namespace ::com::sun::star;
+using namespace sdbc;
+using namespace sdb;
+using namespace uno;
+using namespace datatransfer;
+using namespace beans;
+using namespace lang;
+using namespace container;
+using namespace ::svx;
+class OAddFieldWindowListBox : public SvTreeListBox
+{
+ OAddFieldWindow* m_pTabWin;
+
+ OAddFieldWindowListBox(const OAddFieldWindowListBox&);
+ void operator =(const OAddFieldWindowListBox&);
+protected:
+// virtual void Command( const CommandEvent& rEvt );
+
+public:
+ OAddFieldWindowListBox( OAddFieldWindow* pParent );
+ virtual ~OAddFieldWindowListBox();
+
+ sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
+ sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
+
+ uno::Sequence< beans::PropertyValue > getSelectedFieldDescriptor();
+
+protected:
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+ // SvLBox
+ virtual BOOL DoubleClickHdl();
+private:
+ using SvTreeListBox::ExecuteDrop;
+};
+// -----------------------------------------------------------------------------
+uno::Sequence< beans::PropertyValue > OAddFieldWindowListBox::getSelectedFieldDescriptor()
+{
+ uno::Sequence< beans::PropertyValue > aArgs(GetSelectionCount());
+ sal_Int32 i = 0;
+ SvLBoxEntry* pSelected = FirstSelected();
+ while( pSelected )
+ {
+ // build a descriptor for the currently selected field
+ ::svx::ODataAccessDescriptor aDescriptor;
+ m_pTabWin->fillDescriptor(pSelected,aDescriptor);
+ aArgs[i++].Value <<= aDescriptor.createPropertyValueSequence();
+ pSelected = NextSelected(pSelected);
+ }
+ return aArgs;
+}
+//==================================================================
+// class OAddFieldWindowListBox
+//==================================================================
+DBG_NAME( rpt_OAddFieldWindowListBox );
+//------------------------------------------------------------------------------
+OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* pParent )
+ :SvTreeListBox( pParent, WB_HASBUTTONS|WB_BORDER )
+ ,m_pTabWin( pParent )
+{
+ DBG_CTOR( rpt_OAddFieldWindowListBox,NULL);
+ SetHelpId( HID_FIELD_SEL );
+ SetSelectionMode(MULTIPLE_SELECTION);
+ SetHighlightRange( );
+}
+
+//------------------------------------------------------------------------------
+OAddFieldWindowListBox::~OAddFieldWindowListBox()
+{
+ DBG_DTOR( rpt_OAddFieldWindowListBox,NULL);
+}
+
+//------------------------------------------------------------------------------
+sal_Int8 OAddFieldWindowListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
+{
+ return DND_ACTION_NONE;
+}
+
+//------------------------------------------------------------------------------
+sal_Int8 OAddFieldWindowListBox::ExecuteDrop( const ExecuteDropEvent& /*rEvt*/ )
+{
+ return DND_ACTION_NONE;
+}
+
+//------------------------------------------------------------------------------
+BOOL OAddFieldWindowListBox::DoubleClickHdl()
+{
+ if ( m_pTabWin->createSelectionControls() )
+ return sal_True;
+
+ return SvTreeListBox::DoubleClickHdl();
+}
+
+//------------------------------------------------------------------------------
+void OAddFieldWindowListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ )
+{
+ if ( GetSelectionCount() != 1 )
+ // no drag without a field or with more than one
+ return;
+
+ ::svx::ODataAccessDescriptor aDescriptor;
+ m_pTabWin->fillDescriptor(FirstSelected(),aDescriptor);
+
+ TransferableHelper* pTransferColumn = new ::svx::OColumnTransferable(aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR );
+ Reference< XTransferable> xEnsureDelete = pTransferColumn;
+ EndSelection();
+ pTransferColumn->StartDrag( this, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
+}
+//========================================================================
+// class OAddFieldWindow
+//========================================================================
+DBG_NAME( rpt_OAddFieldWindow );
+//-----------------------------------------------------------------------
+OAddFieldWindow::OAddFieldWindow(::rptui::OReportController& _rController,Window* pParent)
+ :FloatingWindow(pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE))
+ ,::comphelper::OPropertyChangeListener(m_aMutex)
+ ,m_pListBox(new OAddFieldWindowListBox( this ))
+ ,m_rController( _rController )
+ ,m_nCommandType(0)
+ ,m_bEscapeProcessing(sal_False)
+ ,m_pChangeListener(NULL)
+{
+ DBG_CTOR( rpt_OAddFieldWindow,NULL);
+ SetHelpId( HID_FIELD_SEL_WIN );
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
+
+ m_pListBox->Show();
+
+ SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
+ Show();
+
+ try
+ {
+ // be notified when the settings of report definition change
+ uno::Reference< beans::XPropertySet > xRowSetProps( m_rController.getRowSet(), uno::UNO_QUERY_THROW );
+ m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer( this, xRowSetProps );
+ m_pChangeListener->addProperty( PROPERTY_COMMAND );
+ m_pChangeListener->addProperty( PROPERTY_COMMANDTYPE );
+ m_pChangeListener->addProperty( PROPERTY_ESCAPEPROCESSING );
+ m_pChangeListener->addProperty( PROPERTY_FILTER );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//-----------------------------------------------------------------------
+OAddFieldWindow::~OAddFieldWindow()
+{
+ if (m_pChangeListener.is())
+ m_pChangeListener->dispose();
+ DBG_DTOR( rpt_OAddFieldWindow,NULL);
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::GetFocus()
+{
+ if ( m_pListBox.get() )
+ m_pListBox->GrabFocus();
+ else
+ FloatingWindow::GetFocus();
+}
+//-----------------------------------------------------------------------
+sal_Bool OAddFieldWindow::createSelectionControls( )
+{
+ WaitObject aObj(this);
+ uno::Sequence< beans::PropertyValue > aArgs = m_pListBox->getSelectedFieldDescriptor();
+ // we use this way to create undo actions
+ if ( aArgs.getLength() )
+ m_rController.executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
+
+ return aArgs.getLength() != 0;
+}
+
+//-----------------------------------------------------------------------
+long OAddFieldWindow::PreNotify( NotifyEvent& _rNEvt )
+{
+ if ( EVENT_KEYINPUT == _rNEvt.GetType() )
+ {
+ const KeyCode& rKeyCode = _rNEvt.GetKeyEvent()->GetKeyCode();
+ if ( ( 0 == rKeyCode.GetModifier() ) && ( KEY_RETURN == rKeyCode.GetCode() ) )
+ {
+ if ( createSelectionControls() )
+ return 1;
+ }
+ }
+
+ return FloatingWindow::PreNotify( _rNEvt );
+}
+//-----------------------------------------------------------------------
+void OAddFieldWindow::_propertyChanged( const beans::PropertyChangeEvent& _evt ) throw( uno::RuntimeException )
+{
+ OSL_ENSURE( _evt.Source == m_rController.getRowSet(), "OAddFieldWindow::_propertyChanged: where did this come from?" );
+ (void)_evt;
+ Update();
+}
+
+//-----------------------------------------------------------------------
+namespace
+{
+ void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Sequence< ::rtl::OUString >& _rEntries )
+ {
+ const ::rtl::OUString* pEntries = _rEntries.getConstArray();
+ sal_Int32 nEntries = _rEntries.getLength();
+ for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
+ _rListBox.InsertEntry( *pEntries );
+ }
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::Update()
+{
+ m_xColumns.clear();
+
+ try
+ {
+ // ListBox loeschen
+ m_pListBox->Clear();
+ String aTitle(ModuleRes(RID_STR_FIELDSELECTION));
+ SetText(aTitle);
+
+ uno::Reference< beans::XPropertySet > xRowSetProps( m_rController.getRowSet(), uno::UNO_QUERY_THROW );
+
+ ::rtl::OUString sCommand( m_aCommandName );
+ sal_Int32 nCommandType( m_nCommandType );
+ sal_Bool bEscapeProcessing( m_bEscapeProcessing );
+ ::rtl::OUString sFilter( m_sFilter );
+
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand );
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nCommandType );
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPEPROCESSING ) >>= bEscapeProcessing );
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter );
+
+ if ( ( sCommand == m_aCommandName )
+ && ( nCommandType == m_nCommandType )
+ && ( bEscapeProcessing == m_bEscapeProcessing )
+ && ( sFilter == m_sFilter )
+ )
+ return;
+
+ m_aCommandName = sCommand;
+ m_nCommandType = nCommandType;
+ m_bEscapeProcessing = bEscapeProcessing;
+ m_sFilter = sFilter;
+
+ // add the columns to the list
+ m_xColumns.clear();
+ uno::Reference< sdbc::XConnection> xCon = getConnection();
+ if ( xCon.is() && m_aCommandName.getLength() )
+ m_xColumns = dbtools::getFieldsByCommandDescriptor( xCon, GetCommandType(), GetCommand(), m_xHoldAlive );
+ if ( m_xColumns.is() )
+ lcl_addToList( *m_pListBox, m_xColumns->getElementNames() );
+
+ // add the parameter columns to the list
+ Sequence< ::rtl::OUString > aParamNames( getParameterNames( m_rController.getRowSet() ) );
+ lcl_addToList( *m_pListBox, aParamNames );
+
+ // set title
+ aTitle.AppendAscii(" ");
+ aTitle += m_aCommandName.getStr();
+ SetText( aTitle );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::Resize()
+{
+ FloatingWindow::Resize();
+
+ Point aPos(GetPosPixel());
+ Size aSize( GetOutputSizePixel() );
+
+ //////////////////////////////////////////////////////////////////////
+
+ // Groesse der form::ListBox anpassen
+ Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER );
+ Size aLBSize( aSize );
+ aLBSize.Width() -= (2*LISTBOX_BORDER);
+ aLBSize.Height() -= (2*LISTBOX_BORDER);
+
+ m_pListBox->SetPosSizePixel( aLBPos, aLBSize );
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const
+{
+ return m_rController.getConnection();
+}
+// -----------------------------------------------------------------------------
+void OAddFieldWindow::fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor)
+{
+ if ( _pSelected && m_xColumns.is() )
+ {
+ uno::Reference<sdb::XDocumentDataSource> xDocument( m_rController.getDataSource(), uno::UNO_QUERY );
+ if ( xDocument.is() )
+ {
+ uno::Reference<frame::XModel> xModel(xDocument->getDatabaseDocument(),uno::UNO_QUERY);
+ if ( xModel.is() )
+ _rDescriptor[ daDatabaseLocation ] <<= xModel->getURL();
+ }
+
+ _rDescriptor[ ::svx::daCommand ] <<= GetCommand();
+ _rDescriptor[ ::svx::daCommandType ] <<= GetCommandType();
+ _rDescriptor[ ::svx::daEscapeProcessing ] <<= GetEscapeProcessing();
+ _rDescriptor[ ::svx::daConnection ] <<= getConnection();
+
+ ::rtl::OUString sColumnName = m_pListBox->GetEntryText( _pSelected );
+ _rDescriptor[ ::svx::daColumnName ] <<= sColumnName;
+ if ( m_xColumns->hasByName( sColumnName ) )
+ _rDescriptor[ ::svx::daColumnObject ] <<= m_xColumns->getByName(sColumnName);
+ }
+}
+// =============================================================================
+} // namespace rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
new file mode 100644
index 000000000000..8526c450c2c4
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -0,0 +1,634 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: CondFormat.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "CondFormat.hxx"
+#include "CondFormat.hrc"
+
+#include "uistrings.hrc"
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#include "ModuleHelper.hxx"
+#include "helpids.hrc"
+#include "UITools.hxx"
+#include "uistrings.hrc"
+#include "ReportController.hxx"
+#include "Condition.hxx"
+
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#endif
+/** === end UNO includes === **/
+
+#include <svx/globlmn.hrc>
+#include <svx/svxids.hrc>
+
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include <vcl/msgbox.hxx>
+
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+
+#include <comphelper/property.hxx>
+
+#include <algorithm>
+
+// .............................................................................
+namespace rptui
+{
+// .............................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::beans::PropertyValue;
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+ using namespace ::com::sun::star::report;
+
+ //========================================================================
+ // UpdateLocker
+ //========================================================================
+ class UpdateLocker
+ {
+ Window& m_rWindow;
+
+ public:
+ UpdateLocker( Window& _rWindow )
+ :m_rWindow( _rWindow )
+ {
+ _rWindow.SetUpdateMode( FALSE );
+ }
+ ~UpdateLocker()
+ {
+ m_rWindow.SetUpdateMode( TRUE );
+ }
+ };
+
+ //========================================================================
+ // class ConditionalFormattingDialog
+ //========================================================================
+ ConditionalFormattingDialog::ConditionalFormattingDialog(
+ Window* _pParent, const Reference< XReportControlModel >& _rxFormatConditions, ::rptui::OReportController& _rController )
+ :ModalDialog( _pParent, ModuleRes(RID_CONDFORMAT) )
+ ,m_aConditionPlayground( this, ModuleRes( WND_COND_PLAYGROUND ) )
+ ,m_aSeparator(this, ModuleRes(FL_SEPARATOR1))
+ ,m_aPB_OK(this, ModuleRes(PB_OK))
+ ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL))
+ ,m_aPB_Help(this, ModuleRes(PB_HELP))
+ ,m_aCondScroll( this, ModuleRes( SB_ALL_CONDITIONS ) )
+ ,m_rController( _rController )
+ ,m_xFormatConditions( _rxFormatConditions )
+ ,m_bDeletingCondition( false )
+ {
+ OSL_ENSURE( m_xFormatConditions.is(), "ConditionalFormattingDialog::ConditionalFormattingDialog: ReportControlModel is NULL -> Prepare for GPF!" );
+
+ m_xCopy.set( m_xFormatConditions->createClone(), UNO_QUERY_THROW );
+
+ m_aCondScroll.SetScrollHdl( LINK( this, ConditionalFormattingDialog, OnScroll ) );
+
+ impl_initializeConditions();
+
+ FreeResource();
+ }
+
+ //------------------------------------------------------------------------
+ ConditionalFormattingDialog::~ConditionalFormattingDialog()
+ {
+ m_aConditions.clear();
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_updateConditionIndicies()
+ {
+ sal_Int32 nIndex = 0;
+ for ( Conditions::const_iterator cond = m_aConditions.begin();
+ cond != m_aConditions.end();
+ ++cond, ++nIndex
+ )
+ {
+ (*cond)->setConditionIndex( nIndex, impl_getConditionCount() );
+ }
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_conditionCountChanged()
+ {
+ if ( m_aConditions.empty() )
+ impl_addCondition_nothrow( 0 );
+
+ impl_updateScrollBarRange();
+ impl_updateConditionIndicies();
+ impl_layoutAll();
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::addCondition( size_t _nAddAfterIndex )
+ {
+ OSL_PRECOND( _nAddAfterIndex < impl_getConditionCount(), "ConditionalFormattingDialog::addCondition: illegal condition index!" );
+ impl_addCondition_nothrow( _nAddAfterIndex + 1 );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::deleteCondition( size_t _nCondIndex )
+ {
+ impl_deleteCondition_nothrow( _nCondIndex );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_addCondition_nothrow( size_t _nNewCondIndex )
+ {
+ UpdateLocker aLockUpdates( *this );
+
+ try
+ {
+ if ( _nNewCondIndex > (size_t)m_xCopy->getCount() )
+ throw IllegalArgumentException();
+
+ Reference< XFormatCondition > xCond = m_xCopy->createFormatCondition();
+ ::comphelper::copyProperties(m_xCopy.get(),xCond.get());
+ m_xCopy->insertByIndex( _nNewCondIndex, makeAny( xCond ) );
+
+ ConditionPtr pCon( new Condition( &m_aConditionPlayground, *this, m_rController ) );
+ pCon->setCondition( xCond );
+ m_aConditions.insert( m_aConditions.begin() + _nNewCondIndex, pCon );
+
+ pCon->SetPosSizePixel( 0, 0, impl_getConditionWidth(), 0, WINDOW_POSSIZE_WIDTH );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ impl_conditionCountChanged();
+
+ impl_ensureConditionVisible( _nNewCondIndex );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_focusCondition( size_t _nCondIndex )
+ {
+ OSL_PRECOND( _nCondIndex < impl_getConditionCount(),
+ "ConditionalFormattingDialog::impl_focusCondition: illegal index!" );
+
+ impl_ensureConditionVisible( _nCondIndex );
+ m_aConditions[ _nCondIndex ]->GrabFocus();
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_deleteCondition_nothrow( size_t _nCondIndex )
+ {
+ UpdateLocker aLockUpdates( *this );
+
+ OSL_PRECOND( _nCondIndex < impl_getConditionCount(),
+ "ConditionalFormattingDialog::impl_deleteCondition_nothrow: illegal index!" );
+
+ bool bLastCondition = ( impl_getConditionCount() == 1 );
+
+ bool bSetNewFocus = false;
+ size_t nNewFocusIndex( _nCondIndex );
+ try
+ {
+ if ( !bLastCondition )
+ m_xCopy->removeByIndex( _nCondIndex );
+
+ Conditions::iterator pos = m_aConditions.begin() + _nCondIndex;
+ if ( bLastCondition )
+ {
+ Reference< XFormatCondition > xFormatCondition( m_xCopy->getByIndex( 0 ), UNO_QUERY_THROW );
+ xFormatCondition->setFormula( ::rtl::OUString() );
+ (*pos)->setCondition( xFormatCondition );
+ }
+ else
+ {
+ bSetNewFocus = (*pos)->HasChildPathFocus();
+ m_bDeletingCondition = true;
+ m_aConditions.erase( pos );
+ m_bDeletingCondition = false;
+ }
+
+ if ( bSetNewFocus )
+ {
+ if ( nNewFocusIndex >= impl_getConditionCount() )
+ nNewFocusIndex = impl_getConditionCount() - 1;
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ impl_conditionCountChanged();
+ if ( bSetNewFocus )
+ impl_focusCondition( nNewFocusIndex );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_moveCondition_nothrow( size_t _nCondIndex, bool _bMoveUp )
+ {
+ size_t nOldConditionIndex( _nCondIndex );
+ size_t nNewConditionIndex( _bMoveUp ? _nCondIndex - 1 : _nCondIndex + 1 );
+
+ // do this in two steps, so we don't become inconsistent if any of the UNO actions fails
+ Any aMovedCondition;
+ ConditionPtr pMovedCondition;
+ try
+ {
+ aMovedCondition = m_xCopy->getByIndex( (sal_Int32)nOldConditionIndex );
+ m_xCopy->removeByIndex( (sal_Int32)nOldConditionIndex );
+
+ Conditions::iterator aRemovePos( m_aConditions.begin() + nOldConditionIndex );
+ pMovedCondition = *aRemovePos;
+ m_aConditions.erase( aRemovePos );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ return;
+ }
+
+ try
+ {
+ m_xCopy->insertByIndex( (sal_Int32)nNewConditionIndex, aMovedCondition );
+ m_aConditions.insert( m_aConditions.begin() + nNewConditionIndex, pMovedCondition );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ // at least the two swapped conditions need to know their new index
+ impl_updateConditionIndicies();
+
+ // re-layout all conditions
+ Point aDummy;
+ impl_layoutConditions( aDummy );
+
+ // ensure the moved condition is visible
+ impl_ensureConditionVisible( nNewConditionIndex );
+ }
+
+ // -----------------------------------------------------------------------------
+ long ConditionalFormattingDialog::impl_getConditionWidth() const
+ {
+ const Size aDialogSize( GetOutputSizePixel() );
+ const Size aScrollBarWidth( LogicToPixel( Size( SCROLLBAR_WIDTH + UNRELATED_CONTROLS, 0 ), MAP_APPFONT ) );
+ return aDialogSize.Width() - aScrollBarWidth.Width();
+ }
+
+ // -----------------------------------------------------------------------------
+ IMPL_LINK( ConditionalFormattingDialog, OnScroll, ScrollBar*, /*_pNotInterestedIn*/ )
+ {
+ size_t nFirstCondIndex( impl_getFirstVisibleConditionIndex() );
+ size_t nFocusCondIndex = impl_getFocusedConditionIndex( nFirstCondIndex );
+
+ Point aDummy;
+ impl_layoutConditions( aDummy );
+
+ if ( nFocusCondIndex < nFirstCondIndex )
+ impl_focusCondition( nFirstCondIndex );
+ else if ( nFocusCondIndex >= nFirstCondIndex + MAX_CONDITIONS )
+ impl_focusCondition( nFirstCondIndex + MAX_CONDITIONS - 1 );
+
+ return 0;
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_layoutConditions( Point& _out_rBelowLastVisible )
+ {
+ // position the condition's playground
+ long nConditionWidth = impl_getConditionWidth();
+ long nConditionHeight = LogicToPixel( Size( 0, CONDITION_HEIGHT ), MAP_APPFONT ).Height();
+ size_t nVisibleConditions = ::std::min( impl_getConditionCount(), MAX_CONDITIONS );
+ Size aPlaygroundSize( nConditionWidth, nVisibleConditions * nConditionHeight );
+ m_aConditionPlayground.SetSizePixel( aPlaygroundSize );
+ _out_rBelowLastVisible = Point( 0, aPlaygroundSize.Height() );
+
+ // position the single conditions
+ Point aConditionPos( 0, -1 * nConditionHeight * impl_getFirstVisibleConditionIndex() );
+ for ( Conditions::const_iterator cond = m_aConditions.begin();
+ cond != m_aConditions.end();
+ ++cond
+ )
+ {
+ (*cond)->SetPosSizePixel( aConditionPos.X(), aConditionPos.Y(), nConditionWidth, nConditionHeight );
+ aConditionPos.Move( 0, nConditionHeight );
+ }
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_layoutAll()
+ {
+ // condition's positions
+ Point aPos;
+ impl_layoutConditions( aPos );
+
+ // scrollbar size and visibility
+ m_aCondScroll.SetPosSizePixel( 0, 0, 0, aPos.Y(), WINDOW_POSSIZE_HEIGHT );
+ if ( !impl_needScrollBar() )
+ // normalize the position, so it can, in all situations, be used as top index
+ m_aCondScroll.SetThumbPos( 0 );
+
+ // the separator and the buttons below it
+ aPos += LogicToPixel( Point( 0 , RELATED_CONTROLS ), MAP_APPFONT );
+ m_aSeparator.SetPosSizePixel( 0, aPos.Y(), 0, 0, WINDOW_POSSIZE_Y );
+
+ aPos += LogicToPixel( Point( 0 , UNRELATED_CONTROLS ), MAP_APPFONT );
+ Window* pWindows[] = { &m_aPB_OK, &m_aPB_CANCEL, &m_aPB_Help };
+ for ( size_t i= 0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i )
+ {
+ pWindows[i]->SetPosSizePixel( 0, aPos.Y(), 0, 0, WINDOW_POSSIZE_Y );
+ }
+
+ aPos += LogicToPixel( Point( 0, BUTTON_HEIGHT + RELATED_CONTROLS ), MAP_APPFONT );
+ SetPosSizePixel( 0, 0, 0, aPos.Y(), WINDOW_POSSIZE_HEIGHT );
+ }
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_initializeConditions()
+ {
+ try
+ {
+ sal_Int32 nCount = m_xCopy->getCount();
+ for ( sal_Int32 i = 0; i < nCount ; ++i )
+ {
+ ConditionPtr pCon( new Condition( &m_aConditionPlayground, *this, m_rController ) );
+ Reference< XFormatCondition > xCond( m_xCopy->getByIndex(i), UNO_QUERY );
+ pCon->setCondition( xCond );
+ pCon->updateToolbar( xCond.get() );
+ m_aConditions.push_back( pCon );
+ }
+ }
+ catch(Exception&)
+ {
+ OSL_ENSURE(0,"Can not access format condition!");
+ }
+
+ impl_conditionCountChanged();
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor )
+ {
+ OSL_PRECOND( _nCommandId, "ConditionalFormattingDialog::applyCommand: illegal command id!" );
+ try
+ {
+ Reference< XReportControlFormat > xReportControlFormat( m_xCopy->getByIndex( _nCondIndex ), UNO_QUERY_THROW );
+
+ Sequence< PropertyValue > aArgs(3);
+
+ aArgs[0].Name = REPORTCONTROLFORMAT;
+ aArgs[0].Value <<= xReportControlFormat;
+
+ aArgs[1].Name = CURRENT_WINDOW;
+ aArgs[1].Value <<= VCLUnoHelper::GetInterface(this);
+
+ aArgs[2].Name = PROPERTY_FONTCOLOR;
+ aArgs[2].Value <<= (sal_uInt32)_aColor.GetColor();
+
+ // we use this way to create undo actions
+ m_rController.executeUnChecked(_nCommandId,aArgs);
+ m_aConditions[ _nCondIndex ]->updateToolbar(xReportControlFormat);
+ }
+ catch( Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::moveConditionUp( size_t _nCondIndex )
+ {
+ OSL_PRECOND( _nCondIndex > 0, "ConditionalFormattingDialog::moveConditionUp: cannot move up the first condition!" );
+ if ( _nCondIndex > 0 )
+ impl_moveCondition_nothrow( _nCondIndex, true );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::moveConditionDown( size_t _nCondIndex )
+ {
+ OSL_PRECOND( _nCondIndex < impl_getConditionCount(), "ConditionalFormattingDialog::moveConditionDown: cannot move down the last condition!" );
+ if ( _nCondIndex < impl_getConditionCount() )
+ impl_moveCondition_nothrow( _nCondIndex, false );
+ }
+
+ // -----------------------------------------------------------------------------
+ ::rtl::OUString ConditionalFormattingDialog::getDataField() const
+ {
+ ::rtl::OUString sDataField;
+ try
+ {
+ sDataField = m_xFormatConditions->getDataField();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sDataField;
+ }
+
+ // -----------------------------------------------------------------------------
+ short ConditionalFormattingDialog::Execute()
+ {
+ short nRet = ModalDialog::Execute();
+ if ( nRet == RET_OK )
+ {
+ String sUndoAction( String( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) ) );
+ m_rController.getUndoMgr()->EnterListAction( sUndoAction, String() );
+ try
+ {
+ sal_Int32 j(0), i(0);;
+ for ( Conditions::const_iterator cond = m_aConditions.begin();
+ cond != m_aConditions.end();
+ ++cond, ++i
+ )
+ {
+ Reference< XFormatCondition > xCond( m_xCopy->getByIndex(i), UNO_QUERY_THROW );
+ (*cond)->fillFormatCondition( xCond );
+
+ if ( (*cond)->isEmpty() )
+ continue;
+
+ Reference< XFormatCondition > xNewCond;
+ sal_Bool bAppend = j >= m_xFormatConditions->getCount();
+ if ( bAppend )
+ {
+ xNewCond = m_xFormatConditions->createFormatCondition();
+ m_xFormatConditions->insertByIndex( i, makeAny( xNewCond ) );
+ }
+ else
+ xNewCond.set( m_xFormatConditions->getByIndex(j), UNO_QUERY );
+ ++j;
+
+ ::comphelper::copyProperties(xCond.get(),xNewCond.get());
+ }
+
+ for ( sal_Int32 k = m_xFormatConditions->getCount()-1; k >= j; --k )
+ m_xFormatConditions->removeByIndex(k);
+
+ ::comphelper::copyProperties( m_xCopy.get(), m_xFormatConditions.get() );
+ }
+ catch ( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ nRet = RET_NO;
+ }
+ m_rController.getUndoMgr()->LeaveListAction();
+ }
+ return nRet;
+ }
+
+ // -----------------------------------------------------------------------------
+ long ConditionalFormattingDialog::PreNotify( NotifyEvent& _rNEvt )
+ {
+ switch ( _rNEvt.GetType() )
+ {
+ case EVENT_KEYINPUT:
+ {
+ const KeyEvent* pKeyEvent( _rNEvt.GetKeyEvent() );
+ const KeyCode& rKeyCode = pKeyEvent->GetKeyCode();
+ if ( rKeyCode.IsMod1() && rKeyCode.IsMod2() )
+ {
+ if ( rKeyCode.GetCode() == 0x0508 ) // -
+ {
+ impl_deleteCondition_nothrow( impl_getFocusedConditionIndex( 0 ) );
+ return 1;
+ }
+ if ( rKeyCode.GetCode() == 0x0507 ) // +
+ {
+ impl_addCondition_nothrow( impl_getFocusedConditionIndex( impl_getConditionCount() - 1 ) + 1 );
+ return 1;
+ }
+ }
+ }
+ break;
+ case EVENT_GETFOCUS:
+ {
+ if ( m_bDeletingCondition )
+ break;
+
+ const Window* pGetFocusWindow( _rNEvt.GetWindow() );
+
+ // determine whether the new focus window is part of an (currently invisible) condition
+ const Window* pConditionCandidate = pGetFocusWindow->GetParent();
+ const Window* pPlaygroundCandidate = pConditionCandidate ? pConditionCandidate->GetParent() : NULL;
+ while ( ( pPlaygroundCandidate )
+ && ( pPlaygroundCandidate != this )
+ && ( pPlaygroundCandidate != &m_aConditionPlayground )
+ )
+ {
+ pConditionCandidate = pConditionCandidate->GetParent();
+ pPlaygroundCandidate = pConditionCandidate ? pConditionCandidate->GetParent() : NULL;
+ }
+ if ( pPlaygroundCandidate == &m_aConditionPlayground )
+ {
+ impl_ensureConditionVisible( dynamic_cast< const Condition& >( *pConditionCandidate ).getConditionIndex() );
+ }
+ }
+ break;
+ }
+
+ return ModalDialog::PreNotify( _rNEvt );
+ }
+
+ // -----------------------------------------------------------------------------
+ size_t ConditionalFormattingDialog::impl_getFirstVisibleConditionIndex() const
+ {
+ return (size_t)m_aCondScroll.GetThumbPos();
+ }
+
+ // -----------------------------------------------------------------------------
+ size_t ConditionalFormattingDialog::impl_getLastVisibleConditionIndex() const
+ {
+ return ::std::min( impl_getFirstVisibleConditionIndex() + MAX_CONDITIONS, impl_getConditionCount() ) - 1;
+ }
+
+ // -----------------------------------------------------------------------------
+ size_t ConditionalFormattingDialog::impl_getFocusedConditionIndex( sal_Int32 _nFallBackIfNone ) const
+ {
+ size_t nIndex( 0 );
+ for ( Conditions::const_iterator cond = m_aConditions.begin();
+ cond != m_aConditions.end();
+ ++cond, ++nIndex
+ )
+ {
+ if ( (*cond)->HasChildPathFocus() )
+ return nIndex;
+ }
+ return _nFallBackIfNone;
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_updateScrollBarRange()
+ {
+ long nMax = ( impl_getConditionCount() > MAX_CONDITIONS ) ? impl_getConditionCount() - MAX_CONDITIONS + 1 : 0;
+
+ m_aCondScroll.SetRangeMin( 0 );
+ m_aCondScroll.SetRangeMax( nMax );
+ m_aCondScroll.SetVisibleSize( 1 );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_scrollTo( size_t _nTopCondIndex )
+ {
+ OSL_PRECOND( _nTopCondIndex + MAX_CONDITIONS <= impl_getConditionCount(),
+ "ConditionalFormattingDialog::impl_scrollTo: illegal index!" );
+ m_aCondScroll.SetThumbPos( _nTopCondIndex );
+ OnScroll( &m_aCondScroll );
+ }
+
+ // -----------------------------------------------------------------------------
+ void ConditionalFormattingDialog::impl_ensureConditionVisible( size_t _nCondIndex )
+ {
+ OSL_PRECOND( _nCondIndex < impl_getConditionCount(),
+ "ConditionalFormattingDialog::impl_ensureConditionVisible: illegal index!" );
+
+ if ( _nCondIndex < impl_getFirstVisibleConditionIndex() )
+ impl_scrollTo( _nCondIndex );
+ else if ( _nCondIndex > impl_getLastVisibleConditionIndex() )
+ impl_scrollTo( _nCondIndex - MAX_CONDITIONS + 1 );
+ }
+
+// .............................................................................
+} // rptui
+// .............................................................................
diff --git a/reportdesign/source/ui/dlg/CondFormat.hrc b/reportdesign/source/ui/dlg/CondFormat.hrc
new file mode 100644
index 000000000000..20c811f79646
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.hrc
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: CondFormat.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_CONDFORMAT_HRC
+#define RPTUI_CONDFORMAT_HRC
+
+#define FL_FORMAT 1
+#define FL_CONDITION_HEADER 2
+#define CRTL_FORMAT_PREVIEW 3
+#define TB_FORMAT 4
+#define LB_COND_TYPE 5
+#define LB_OP 6
+#define ED_CONDITION_LHS 7
+#define FT_AND 8
+#define PB_OK 9
+#define PB_CANCEL 10
+#define PB_HELP 11
+#define FL_SEPARATOR1 12
+#define ED_CONDITION_RHS 13
+#define CT_CONDITION 14
+#define CT_DEFAULT 15
+#define CT_CONDITION_1 16
+#define CT_CONDITION_2 17
+#define SB_ALL_CONDITIONS 18
+#define WND_COND_PLAYGROUND 19
+#define BTN_MOVE_UP 20
+#define BTN_MOVE_DOWN 21
+#define BTN_ADD_CONDITION 22
+#define BTN_REMOVE_CONDITION 23
+#define IMG_MOVE_UP_HC 24
+#define IMG_MOVE_DOWN_HC 25
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_HEIGHT 8
+#define EDIT_WIDTH 75
+#define RELATED_CONTROLS 4
+#define UNRELATED_CONTROLS 7
+#define EDIT_HEIGHT 12
+#define BUTTON_HEIGHT 14
+#define BUTTON_WIDTH 50
+#define COND_TYPE_WIDTH 50
+#define COND_OP_WIDTH 75
+#define OPERATOR_SEP_WIDTH 15
+#define SCROLLBAR_WIDTH 8
+#define IMAGE_BUTTON_WIDTH 12
+#define IMAGE_BUTTON_HEIGHT 14
+
+#define ROW_0_POS ( RELATED_CONTROLS )
+#define ROW_0_HEIGTH ( FIXEDTEXT_HEIGHT )
+#define ROW_1_POS ( ROW_0_POS + ROW_0_HEIGTH + UNRELATED_CONTROLS )
+#define ROW_1_HEIGTH ( EDIT_HEIGHT )
+#define ROW_2_POS ( ROW_1_POS + ROW_1_HEIGTH + UNRELATED_CONTROLS )
+#define ROW_2_HEIGHT ( 3 * FIXEDTEXT_HEIGHT )
+#define ROW_3_POS ( ROW_2_POS + ROW_2_HEIGHT + RELATED_CONTROLS )
+#define ROW_3_HEIGHT ( IMAGE_BUTTON_HEIGHT )
+
+#define CONDITION_WIDTH ( 6*UNRELATED_CONTROLS + COND_TYPE_WIDTH + COND_OP_WIDTH + 2*EDIT_WIDTH + OPERATOR_SEP_WIDTH )
+#define COND_DLG_WIDTH ( CONDITION_WIDTH + SCROLLBAR_WIDTH + UNRELATED_CONTROLS )
+#define CONDITION_HEIGHT ( ROW_3_POS + ROW_3_HEIGHT )
+#define COND_DLG_HEIGHT ( CONDITION_HEIGHT + 3*RELATED_CONTROLS + BUTTON_HEIGHT + 1 )
+
+#endif // RPTUI_PAGENUMBER_HRC
diff --git a/reportdesign/source/ui/dlg/CondFormat.src b/reportdesign/source/ui/dlg/CondFormat.src
new file mode 100644
index 000000000000..43dcd58342a2
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.src
@@ -0,0 +1,381 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: CondFormat.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "CondFormat.hrc"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+Control WIN_CONDITION
+{
+ Size = MAP_APPFONT ( CONDITION_WIDTH , CONDITION_HEIGHT ) ;
+ HelpId = HID_COND_DLG;
+ DialogControl = TRUE;
+ Hide = TRUE;
+
+ FixedLine FL_CONDITION_HEADER
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS, ROW_0_POS ) ;
+ Size = MAP_APPFONT ( CONDITION_WIDTH - 2 * RELATED_CONTROLS, ROW_0_HEIGTH ) ;
+ };
+
+ ListBox LB_COND_TYPE
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, ROW_1_POS ) ;
+ Size = MAP_APPFONT( COND_TYPE_WIDTH, 60 );
+ Border = TRUE;
+ DropDown = TRUE;
+ TabStop = TRUE;
+ Sort = FALSE;
+ StringList [ de ] =
+ {
+ < "Field Value Is" ; Default ; > ;
+ < "Expression Is" ; Default ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Field Value Is" ; Default ; > ;
+ < "Expression Is" ; Default ; > ;
+ };
+ };
+
+ ListBox LB_OP
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + COND_TYPE_WIDTH + UNRELATED_CONTROLS, ROW_1_POS ) ;
+ Size = MAP_APPFONT( COND_OP_WIDTH, 60 );
+ Border = TRUE;
+ DropDown = TRUE;
+ TabStop = TRUE;
+ Sort = FALSE;
+ StringList [ de ] =
+ {
+ < "between" ; 0; > ;
+ < "not between" ; 1; > ;
+ < "equal to" ; 2; > ;
+ < "not equal to" ; 3; > ;
+ < "greater than" ; 4; > ;
+ < "less than" ; 5; > ;
+ < "greater than or equal to" ; 6; > ;
+ < "less than or equal to" ; 7; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "between" ; 0; > ;
+ < "not between" ; 1; > ;
+ < "equal to" ; 2; > ;
+ < "not equal to" ; 3; > ;
+ < "greater than" ; 4; > ;
+ < "less than" ; 5; > ;
+ < "greater than or equal to" ; 6; > ;
+ < "less than or equal to" ; 7; > ;
+ };
+ };
+
+ Edit ED_CONDITION_LHS
+ {
+ Pos = MAP_APPFONT ( 3*UNRELATED_CONTROLS + COND_TYPE_WIDTH + COND_OP_WIDTH, ROW_1_POS ) ;
+ Size = MAP_APPFONT( EDIT_WIDTH, EDIT_HEIGHT );
+ Border = TRUE;
+ TabStop = TRUE;
+ };
+
+ FixedText FT_AND
+ {
+ Pos = MAP_APPFONT ( 4*UNRELATED_CONTROLS + COND_TYPE_WIDTH + COND_OP_WIDTH + EDIT_WIDTH,
+ ROW_1_POS + ( FIXEDTEXT_HEIGHT - EDIT_HEIGHT ) / 2 );
+ Size = MAP_APPFONT( OPERATOR_SEP_WIDTH , FIXEDTEXT_HEIGHT );
+ Text [ de ] = "und";
+ Text [ en-US ] = "and";
+ };
+
+ Edit ED_CONDITION_RHS
+ {
+ Pos = MAP_APPFONT ( 5*UNRELATED_CONTROLS + COND_TYPE_WIDTH + COND_OP_WIDTH + EDIT_WIDTH + OPERATOR_SEP_WIDTH,
+ ROW_1_POS );
+ Size = MAP_APPFONT( EDIT_WIDTH, EDIT_HEIGHT );
+ Border = TRUE;
+ TabStop = TRUE;
+ };
+
+ ImageButton BTN_MOVE_UP
+ {
+ Pos = MAP_APPFONT ( CONDITION_WIDTH - UNRELATED_CONTROLS - IMAGE_BUTTON_WIDTH, ROW_1_POS ) ;
+ Size = MAP_APPFONT ( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ Symbol = IMAGEBUTTON_ARROW_UP ;
+ };
+
+ ImageButton BTN_MOVE_DOWN
+ {
+ Pos = MAP_APPFONT ( CONDITION_WIDTH - UNRELATED_CONTROLS - IMAGE_BUTTON_WIDTH, ROW_1_POS + IMAGE_BUTTON_HEIGHT + RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ Symbol = IMAGEBUTTON_ARROW_DOWN ;
+ };
+
+ ToolBox TB_FORMAT
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, ROW_2_POS ) ;
+ ButtonType = BUTTON_SYMBOL;
+ Align = BOXALIGN_TOP;
+ HelpId = HID_CONDFORMAT_TB;
+ Customize = FALSE;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ ITEM_FORMAT_ATTR_CHAR_WEIGHT
+ Checkable = TRUE;
+ };
+ ToolBoxItem
+ {
+ ITEM_FORMAT_ATTR_CHAR_POSTURE
+ Checkable = TRUE;
+ };
+ ToolBoxItem
+ {
+ ITEM_FORMAT_ATTR_CHAR_UNDERLINE
+ Checkable = TRUE;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR;
+ };
+ ToolBoxItem
+ {
+ ITEM_TOOLBAR_BACKGROUND_COLOR
+ DropDown = TRUE;
+ };
+ ToolBoxItem
+ {
+ ITEM_TOOLBAR_ATTR_CHAR_COLOR
+ Identifier = SID_ATTR_CHAR_COLOR2;
+ Command = ".uno:FontColor";
+ };
+ ToolBoxItem
+ {
+ ITEM_FORMAT_CHAR_DLG
+ };
+ };
+ };
+
+ Window CRTL_FORMAT_PREVIEW
+ {
+ Pos = MAP_APPFONT ( 2*UNRELATED_CONTROLS, ROW_2_POS ) ;
+ Size = MAP_APPFONT ( CONDITION_WIDTH - UNRELATED_CONTROLS, ROW_2_HEIGHT ) ;
+ Border = TRUE ;
+ HelpId = HID_CRTL_FORMAT_PREVIEW;
+ Text [ de ] = "Beispiel";
+ Text [ en-US ] = "Example";
+ };
+
+ PushButton BTN_ADD_CONDITION
+ {
+ Pos = MAP_APPFONT( CONDITION_WIDTH - 2*UNRELATED_CONTROLS - 2*IMAGE_BUTTON_WIDTH - RELATED_CONTROLS, ROW_3_POS );
+ Size = MAP_APPFONT( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT );
+ Text = "+";
+ };
+
+ PushButton BTN_REMOVE_CONDITION
+ {
+ Pos = MAP_APPFONT( CONDITION_WIDTH - 2*UNRELATED_CONTROLS - 2*IMAGE_BUTTON_WIDTH - RELATED_CONTROLS, ROW_3_POS );
+ Size = MAP_APPFONT( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT );
+ Text = "-";
+ };
+
+ Image IMG_MOVE_UP_HC
+ {
+ ImageBitmap = Bitmap { File = "arrow_move_up_hc" ; };
+ };
+
+ Image IMG_MOVE_DOWN_HC
+ {
+ ImageBitmap = Bitmap { File = "arrow_move_down_hc" ; };
+ };
+};
+
+ModalDialog RID_CONDFORMAT
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( COND_DLG_WIDTH, COND_DLG_HEIGHT ) ;
+ Text [ de ] = "Bedingungsabhängige Formatierung" ;
+ Text [ en-US ] = "Conditional Formatting" ;
+ HelpId = HID_CONDFORMAT_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ Window WND_COND_PLAYGROUND
+ {
+ Pos = MAP_APPFONT ( 0, 0 ) ;
+ Size = MAP_APPFONT ( CONDITION_WIDTH, CONDITION_HEIGHT ) ;
+ DialogControl = TRUE;
+ Hide = FALSE;
+ };
+
+ FixedLine FL_SEPARATOR1
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS, CONDITION_HEIGHT + RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( CONDITION_WIDTH - 2*RELATED_CONTROLS , 1 ) ;
+ };
+
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( CONDITION_WIDTH - 3*BUTTON_WIDTH - 2*UNRELATED_CONTROLS - RELATED_CONTROLS, CONDITION_HEIGHT + 2*RELATED_CONTROLS + 1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( CONDITION_WIDTH - 2*BUTTON_WIDTH - 2*UNRELATED_CONTROLS , CONDITION_HEIGHT + 2*RELATED_CONTROLS + 1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ };
+
+ HelpButton PB_HELP
+ {
+ TabStop = TRUE ;
+ Pos = MAP_APPFONT ( CONDITION_WIDTH - BUTTON_WIDTH - UNRELATED_CONTROLS, CONDITION_HEIGHT + 2*RELATED_CONTROLS + 1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ Text [ de ] = "~Hilfe" ;
+ Text [ en-US ] = "~Help";
+ };
+
+ ScrollBar SB_ALL_CONDITIONS
+ {
+ Pos = MAP_APPFONT ( CONDITION_WIDTH, RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( SCROLLBAR_WIDTH, CONDITION_HEIGHT + RELATED_CONTROLS ) ;
+ };
+};
+
+String STR_NUMBERED_CONDITION
+{
+ Text [ de ] = "Bedingung $number$";
+ Text [ en-US ] = "Condition $number$";
+};
+
+String STR_COLOR_WHITE
+{
+ Text [ de ] = "Weiß" ;
+ Text [ en-US ] = "White" ;
+ Text [ x-comment ] = " ";
+};
+String STR_CHARCOLOR
+{
+ Text [ de ] = "Zeichenfarbe" ;
+ Text [ en-US ] = "Font color" ;
+};
+String STR_CHARBACKGROUND
+{
+ Text [ de ] = "Hintergrund" ;
+ Text [ en-US ] = "Background";
+};
+String STR_TRANSPARENT
+{
+ Text [ de ] = "Keine Füllung" ;
+ Text [ en-US ] = "No Fill" ;
+ Text [ x-comment ] = " ";
+};
+
+#define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
+
+//-------------------------------------------------------------------------
+ImageList IMG_CONDFORMAT_DLG_SC
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/sc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ;
+ < "res/commandimagelist/sc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ;
+ < "res/commandimagelist/sc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ;
+ < "res/commandimagelist/sc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ;
+ < "res/commandimagelist/sc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ;
+ < "res/commandimagelist/sc_fontdialog.png" ; SID_CHAR_DLG ; > ;
+ };
+};
+
+ImageList IMG_CONDFORMAT_DLG_SCH
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/sch_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ;
+ < "res/commandimagelist/sch_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ;
+ < "res/commandimagelist/sch_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ;
+ < "res/commandimagelist/sch_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ;
+ < "res/commandimagelist/sch_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ;
+ < "res/commandimagelist/sch_fontdialog.png" ; SID_CHAR_DLG ; > ;
+ };
+};
+ImageList IMG_CONDFORMAT_DLG_LC
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/lc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ;
+ < "res/commandimagelist/lc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ;
+ < "res/commandimagelist/lc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ;
+ < "res/commandimagelist/lc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ;
+ < "res/commandimagelist/lc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ;
+ < "res/commandimagelist/lc_fontdialog.png" ; SID_CHAR_DLG ; > ;
+ };
+};
+ImageList IMG_CONDFORMAT_DLG_LCH
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/lch_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ;
+ < "res/commandimagelist/lch_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ;
+ < "res/commandimagelist/lch_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ;
+ < "res/commandimagelist/lch_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ;
+ < "res/commandimagelist/lch_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ;
+ < "res/commandimagelist/lch_fontdialog.png" ; SID_CHAR_DLG ; > ;
+ };
+};
+ImageList 31000
+{
+ MASKCOLOR;
+ prefix = "sc";
+ IdList = {05500;};
+ IdCount = 1;
+
+};
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
new file mode 100644
index 000000000000..841dda7892f2
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -0,0 +1,887 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Condition.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "Condition.hxx"
+#include "UITools.hxx"
+#include "CondFormat.hxx"
+#include "CondFormat.hrc"
+#include "RptResId.hrc"
+#include "ReportController.hxx"
+#include "ModuleHelper.hxx"
+#include "ColorChanger.hxx"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#include "reportformula.hxx"
+
+#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
+#include <com/sun/star/util/URL.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XIMAGEMANAGER_HPP_
+#include <com/sun/star/ui/XImageManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
+#include <com/sun/star/ui/ImageType.hpp>
+#endif
+
+#define ITEMID_COLOR
+#define ITEMID_BRUSH
+#include <svx/tbcontrl.hxx>
+#include <svx/svxids.hrc>
+#include <svx/xtable.hxx>
+#include <svx/tbxcolorupdate.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <svtools/imgdef.hxx>
+#include <svtools/pathoptions.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/bmpacc.hxx>
+#include <tools/diagnose_ex.h>
+#include <rtl/ustrbuf.hxx>
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::beans;
+
+//========================================================================
+// class SvxColorWindow_Impl --------------------------------------------------
+//========================================================================
+#ifndef WB_NO_DIRECTSELECT
+#define WB_NO_DIRECTSELECT ((WinBits)0x04000000)
+#endif
+
+#define PALETTE_X 10
+#define PALETTE_Y 10
+#define PALETTE_SIZE (PALETTE_X * PALETTE_Y)
+class OColorPopup : public FloatingWindow
+{
+ DECL_LINK( SelectHdl, void * );
+ Condition* m_pCondition;
+ USHORT m_nSlotId;
+public:
+ OColorPopup(Window* _pParent,Condition* _pCondition);
+ ValueSet m_aColorSet;
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Resize();
+
+ void StartSelection();
+ void SetSlotId(USHORT _nSlotId);
+};
+// -----------------------------------------------------------------------------
+OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition)
+:FloatingWindow(_pParent, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL ))
+,m_pCondition(_pCondition)
+,m_nSlotId(0)
+,m_aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) )
+{
+ m_aColorSet.SetHelpId( HID_RPT_POPUP_COLOR_CTRL );
+ SetHelpId( HID_RPT_POPUP_COLOR );
+ const Size aSize12( 13, 13 );
+ ::std::auto_ptr<XColorTable> pColorTable(new XColorTable( SvtPathOptions().GetPalettePath() ));
+ short i = 0;
+ long nCount = pColorTable->Count();
+ XColorEntry* pEntry = NULL;
+ Color aColWhite( COL_WHITE );
+ String aStrWhite( ModuleRes(STR_COLOR_WHITE) );
+
+ if ( nCount > PALETTE_SIZE )
+ // Show scrollbar if more than PALLETTE_SIZE colors are available
+ m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_VSCROLL );
+
+ for ( i = 0; i < nCount; i++ )
+ {
+ pEntry = pColorTable->GetColor(i);
+ m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() );
+ }
+
+ while ( i < PALETTE_SIZE )
+ {
+ // fill empty elements if less then PALLETTE_SIZE colors are available
+ m_aColorSet.InsertItem( i+1, aColWhite, aStrWhite );
+ i++;
+ }
+
+ m_aColorSet.SetSelectHdl( LINK( this, OColorPopup, SelectHdl ) );
+ m_aColorSet.SetColCount( PALETTE_X );
+ m_aColorSet.SetLineCount( PALETTE_Y );
+ Size aSize = m_aColorSet.CalcWindowSizePixel( aSize12 );
+ aSize.Width() += 4;
+ aSize.Height() += 4;
+ SetOutputSizePixel( aSize );
+ m_aColorSet.Show();
+}
+// -----------------------------------------------------------------------------
+void OColorPopup::KeyInput( const KeyEvent& rKEvt )
+{
+ m_aColorSet.KeyInput(rKEvt);
+}
+
+// -----------------------------------------------------------------------------
+void OColorPopup::Resize()
+{
+ Size aSize = GetOutputSizePixel();
+ aSize.Width() -= 4;
+ aSize.Height() -= 4;
+ m_aColorSet.SetPosSizePixel( Point(2,2), aSize );
+}
+
+// -----------------------------------------------------------------------------
+void OColorPopup::StartSelection()
+{
+ m_aColorSet.StartSelection();
+}
+// -----------------------------------------------------------------------------
+void OColorPopup::SetSlotId(USHORT _nSlotId)
+{
+ m_nSlotId = _nSlotId;
+ if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId )
+ {
+ m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_NONEFIELD );
+ m_aColorSet.SetText( String(ModuleRes( STR_TRANSPARENT )) );
+ } // if ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR == theSlotId )
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OColorPopup, SelectHdl, void *, EMPTYARG )
+{
+ USHORT nItemId = m_aColorSet.GetSelectItemId();
+ Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet.GetItemColor( nItemId ) );
+
+ /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls.
+ This instance may be deleted in the meantime (i.e. when a dialog is opened
+ while in Dispatch()), accessing members will crash in this case. */
+ m_aColorSet.SetNoSelection();
+
+ if ( IsInPopupMode() )
+ EndPopupMode();
+
+ m_pCondition->ApplyCommand( m_nSlotId, aColor );
+ return 0;
+}
+
+// =============================================================================
+// = IExpressionFactory
+// =============================================================================
+class SAL_NO_VTABLE IExpressionFactory
+{
+public:
+ virtual ::rtl::OUString assembleExpression( const ::rtl::OUString& _rFieldDataSource, const ::rtl::OUString& _rLHS, const ::rtl::OUString& _rRHS ) const = 0;
+ virtual bool matchExpression( const ::rtl::OUString& _rExpression, const ::rtl::OUString& _rFieldDataSource, ::rtl::OUString& _out_rLHS, ::rtl::OUString& _out_rRHS ) const = 0;
+
+ virtual ~IExpressionFactory() { }
+};
+
+// =============================================================================
+// = ExpressionFactory
+// =============================================================================
+class ExpressionFactory : public IExpressionFactory
+{
+private:
+ const ::rtl::OUString m_sPattern;
+
+public:
+ ExpressionFactory( const sal_Char* _pAsciiPattern );
+
+ // IExpressionFactory
+ virtual ::rtl::OUString assembleExpression( const ::rtl::OUString& _rFieldDataSource, const ::rtl::OUString& _rLHS, const ::rtl::OUString& _rRHS ) const;
+ virtual bool matchExpression( const ::rtl::OUString& _rExpression, const ::rtl::OUString& _rFieldDataSource, ::rtl::OUString& _out_rLHS, ::rtl::OUString& _out_rRHS ) const;
+};
+
+// -----------------------------------------------------------------------------
+ExpressionFactory::ExpressionFactory( const sal_Char* _pAsciiPattern )
+ :m_sPattern( ::rtl::OUString::createFromAscii( _pAsciiPattern ) )
+{
+}
+
+// -----------------------------------------------------------------------------
+::rtl::OUString ExpressionFactory::assembleExpression( const ::rtl::OUString& _rFieldDataSource, const ::rtl::OUString& _rLHS, const ::rtl::OUString& _rRHS ) const
+{
+ ::rtl::OUString sExpression( m_sPattern );
+
+ sal_Int32 nPatternIndex = sExpression.indexOf( '$' );
+ while ( nPatternIndex > -1 )
+ {
+ const ::rtl::OUString* pReplace = NULL;
+ switch ( sExpression.getStr()[ nPatternIndex + 1 ] )
+ {
+ case '$': pReplace = &_rFieldDataSource; break;
+ case '1': pReplace = &_rLHS; break;
+ case '2': pReplace = &_rRHS; break;
+ default: break;
+ }
+
+ if ( pReplace == NULL )
+ {
+ OSL_ENSURE( false, "ExpressionFactory::assembleExpression: illegal pattern!" );
+ break;
+ }
+
+ sExpression = sExpression.replaceAt( nPatternIndex, 2, *pReplace );
+ nPatternIndex = sExpression.indexOf( '$', nPatternIndex + pReplace->getLength() + 1 );
+ }
+ return sExpression;
+}
+
+// -----------------------------------------------------------------------------
+bool ExpressionFactory::matchExpression( const ::rtl::OUString& _rExpression, const ::rtl::OUString& _rFieldDataSource, ::rtl::OUString& _out_rLHS, ::rtl::OUString& _out_rRHS ) const
+{
+ (void)_rExpression;
+ (void)_rFieldDataSource;
+ (void)_out_rLHS;
+ (void)_out_rRHS;
+
+ // if we had regular expression, the matching would be pretty easy ...
+ // just replace $1 and $2 in the pattern with (.*), and then get them with \1 resp. \2.
+ // Unfortunately, we don't have such a regexp engine ...
+
+ // Okay, let's start with replacing all $$ in our pattern with the actual field data source
+ ::rtl::OUString sMatchExpression( m_sPattern );
+ const ::rtl::OUString sFieldDataPattern( RTL_CONSTASCII_USTRINGPARAM( "$$" ) );
+ sal_Int32 nIndex( sMatchExpression.indexOf( sFieldDataPattern ) );
+ while ( nIndex != -1 )
+ {
+ sMatchExpression = sMatchExpression.replaceAt( nIndex, sFieldDataPattern.getLength(), _rFieldDataSource );
+ nIndex = sMatchExpression.indexOf( sFieldDataPattern, nIndex + _rFieldDataSource.getLength() );
+ }
+
+ const ::rtl::OUString sLHSPattern( RTL_CONSTASCII_USTRINGPARAM( "$1" ) );
+ const ::rtl::OUString sRHSPattern( RTL_CONSTASCII_USTRINGPARAM( "$2" ) );
+ sal_Int32 nLHSIndex( sMatchExpression.indexOf( sLHSPattern ) );
+ sal_Int32 nRHSIndex( sMatchExpression.indexOf( sRHSPattern ) );
+
+ // now we should have at most one occurance of $1 and $2, resp.
+ OSL_ENSURE( sMatchExpression.indexOf( sLHSPattern, nLHSIndex + 1 ) == -1,
+ "ExpressionFactory::matchExpression: unsupported pattern (more than one LHS occurance)!" );
+ OSL_ENSURE( sMatchExpression.indexOf( sRHSPattern, nRHSIndex + 1 ) == -1,
+ "ExpressionFactory::matchExpression: unsupported pattern (more than one RHS occurance)!" );
+ // Also, an LHS must be present, and precede the RHS (if present)
+ OSL_ENSURE( ( nLHSIndex != -1 ) && ( ( nLHSIndex < nRHSIndex ) || ( nRHSIndex == -1 ) ),
+ "ExpressionFactory::matchExpression: no LHS, or an RHS preceeding the LHS - this is not supported!" );
+
+ // up to the occurance of the LHS (which must exist, see above), the two expressions
+ // must be identical
+ if ( _rExpression.getLength() < nLHSIndex )
+ return false;
+ const ::rtl::OUString sExprPart1( _rExpression.copy( 0, nLHSIndex ) );
+ const ::rtl::OUString sMatchExprPart1( sMatchExpression.copy( 0, nLHSIndex ) );
+ if ( sExprPart1 != sMatchExprPart1 )
+ // the left-most expression parts do not match
+ return false;
+
+ // after the occurance of the RHS (or the LHS, if there is no RHS), the two expressions
+ // must be identical, too
+ bool bHaveRHS( nRHSIndex != -1 );
+ sal_Int32 nRightMostIndex( bHaveRHS ? nRHSIndex : nLHSIndex );
+ const ::rtl::OUString sMatchExprPart3( sMatchExpression.copy( nRightMostIndex + 2 ) );
+ if ( _rExpression.getLength() < sMatchExprPart3.getLength() )
+ // the expression is not even long enough to hold the right-most part of the match expression
+ return false;
+ const ::rtl::OUString sExprPart3( _rExpression.copy( _rExpression.getLength() - sMatchExprPart3.getLength() ) );
+ if ( sExprPart3 != sMatchExprPart3 )
+ // the right-most expression parts do not match
+ return false;
+
+ // if we don't have an RHS, we're done
+ if ( !bHaveRHS )
+ {
+ _out_rLHS = _rExpression.copy( sExprPart1.getLength(), _rExpression.getLength() - sExprPart1.getLength() - sExprPart3.getLength() );
+ return true;
+ }
+
+ // strip the match expression by its right-most and left-most part, and by the placeholders $1 and $2
+ sal_Int32 nMatchExprPart2Start( nLHSIndex + sLHSPattern.getLength() );
+ ::rtl::OUString sMatchExprPart2 = sMatchExpression.copy(
+ nMatchExprPart2Start,
+ sMatchExpression.getLength() - nMatchExprPart2Start - sMatchExprPart3.getLength() - 2
+ );
+ // strip the expression by its left-most and right-most part
+ const ::rtl::OUString sExpression( _rExpression.copy(
+ sExprPart1.getLength(),
+ _rExpression.getLength() - sExprPart1.getLength() - sExprPart3.getLength()
+ ) );
+
+ sal_Int32 nPart2Index = sExpression.indexOf( sMatchExprPart2 );
+ if ( nPart2Index == -1 )
+ // the "middle" part of the match expression does not exist in the expression at all
+ return false;
+
+ OSL_ENSURE( sExpression.indexOf( sMatchExprPart2, nPart2Index + 1 ) == -1,
+ "ExpressionFactory::matchExpression: ambiguous matching!" );
+ // if this fires, then we're lost: The middle part exists two times in the expression,
+ // so we cannot reliably determine what's the LHS and what's the RHS.
+ // Well, the whole mechanism is flawed, anyway:
+ // Encoding the field content in the conditional expression will break as soon
+ // as somebody
+ // - assigns a Data Field to a control
+ // - creates a conditional format expression for the control
+ // - assigns another Data Field to the control
+ // - opens the Conditional Format Dialog, again
+ // Here, at the latest, you can see that we need another mechanism, anyway, which does not
+ // rely on those strange expression building/matching
+
+ _out_rLHS = sExpression.copy( 0, nPart2Index );
+ _out_rRHS = sExpression.copy( nPart2Index + sMatchExprPart2.getLength() );
+
+ return true;
+}
+
+// =============================================================================
+// = Condition
+// =============================================================================
+// -----------------------------------------------------------------------------
+Condition::Condition( Window* _pParent, IConditionalFormatAction& _rAction, ::rptui::OReportController& _rController )
+ :Control(_pParent, ModuleRes(WIN_CONDITION))
+ ,m_rController( _rController )
+ ,m_rAction( _rAction )
+ ,m_aHeader(this, ModuleRes(FL_CONDITION_HEADER))
+ ,m_aConditionType(this, ModuleRes(LB_COND_TYPE))
+ ,m_aOperationList( this, ModuleRes(LB_OP))
+ ,m_aCondLHS(this, ModuleRes(ED_CONDITION_LHS))
+ ,m_aOperandGlue(this, ModuleRes(FT_AND))
+ ,m_aCondRHS(this, ModuleRes(ED_CONDITION_RHS))
+ ,m_aActions(this, ModuleRes(TB_FORMAT))
+ ,m_aPreview(this, ModuleRes(CRTL_FORMAT_PREVIEW))
+ ,m_aMoveUp( this, ModuleRes( BTN_MOVE_UP ) )
+ ,m_aMoveDown( this, ModuleRes( BTN_MOVE_DOWN ) )
+ ,m_aAddCondition( this, ModuleRes( BTN_ADD_CONDITION ) )
+ ,m_aRemoveCondition( this, ModuleRes( BTN_REMOVE_CONDITION ) )
+ ,m_pColorFloat(NULL)
+ ,m_pBtnUpdaterFontColor(NULL)
+ ,m_pBtnUpdaterBackgroundColor(NULL)
+ ,m_nCondIndex( 0 )
+ ,m_nLastKnownWindowWidth( -1 )
+ ,m_bInDestruction( false )
+{
+ m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING);
+ m_aCondLHS.GrabFocus();
+
+ m_aConditionType.SetSelectHdl( LINK( this, Condition, OnTypeSelected ) );
+
+ m_aOperationList.SetDropDownLineCount( 10 );
+ m_aOperationList.SetSelectHdl( LINK( this, Condition, OnOperationSelected ) );
+
+ m_aActions.SetSelectHdl(LINK(this, Condition, OnFormatAction));
+ m_aActions.SetDropdownClickHdl( LINK( this, Condition, DropdownClick ) );
+ setToolBox(&m_aActions);
+
+ m_aMoveUp.SetClickHdl( LINK( this, Condition, OnConditionAction ) );
+ m_aMoveDown.SetClickHdl( LINK( this, Condition, OnConditionAction ) );
+ m_aAddCondition.SetClickHdl( LINK( this, Condition, OnConditionAction ) );
+ m_aRemoveCondition.SetClickHdl( LINK( this, Condition, OnConditionAction ) );
+
+ m_aMoveUp.SetStyle( m_aMoveUp.GetStyle() | WB_NOPOINTERFOCUS );
+ m_aMoveDown.SetStyle( m_aMoveDown.GetStyle() | WB_NOPOINTERFOCUS );
+ m_aAddCondition.SetStyle( m_aMoveUp.GetStyle() | WB_NOPOINTERFOCUS | WB_CENTER | WB_VCENTER );
+ m_aRemoveCondition.SetStyle( m_aMoveDown.GetStyle() | WB_NOPOINTERFOCUS | WB_CENTER | WB_VCENTER );
+
+ Font aFont( m_aAddCondition.GetFont() );
+ aFont.SetWeight( WEIGHT_BOLD );
+ m_aAddCondition.SetFont( aFont );
+ m_aRemoveCondition.SetFont( aFont );
+
+ m_aOperandGlue.SetStyle( m_aOperandGlue.GetStyle() | WB_VCENTER );
+
+ m_aConditionType.SelectEntryPos( 0 );
+ m_aOperationList.SelectEntryPos( 0 );
+
+ // the toolbar got its site automatically, ensure that the preview is positioned
+ // right of it
+ Size aRelatedControls( LogicToPixel( Size( RELATED_CONTROLS, 0 ), MAP_APPFONT ) );
+ Point aToolbarPos( m_aActions.GetPosPixel() );
+ Size aToolbarSize( m_aActions.GetSizePixel() );
+ m_aPreview.SetPosSizePixel( aToolbarPos.X() + aToolbarSize.Width() + 2 * aRelatedControls.Width(),
+ 0, 0, 0, WINDOW_POSSIZE_X );
+
+ // ensure the toolbar is vertically centered, relative to the preview
+ Size aPreviewSize( m_aPreview.GetSizePixel() );
+ m_aActions.SetPosSizePixel( 0, aToolbarPos.Y() + ( aPreviewSize.Height() - aToolbarSize.Height() ) / 2, 0, 0, WINDOW_POSSIZE_Y );
+
+ m_pBtnUpdaterBackgroundColor = new ::svx::ToolboxButtonColorUpdater(
+ SID_BACKGROUND_COLOR, SID_BACKGROUND_COLOR, &m_aActions );
+ m_pBtnUpdaterFontColor = new ::svx::ToolboxButtonColorUpdater(
+ SID_ATTR_CHAR_COLOR2, SID_ATTR_CHAR_COLOR2, &m_aActions, TBX_UPDATER_MODE_CHAR_COLOR_NEW );
+
+
+ m_aMoveUp.SetModeImage( ModuleRes( IMG_MOVE_UP_HC ), BMP_COLOR_HIGHCONTRAST );
+ m_aMoveDown.SetModeImage( ModuleRes( IMG_MOVE_DOWN_HC ), BMP_COLOR_HIGHCONTRAST );
+
+ FreeResource();
+ Show();
+
+ impl_layoutAll();
+
+ m_aFieldExprFactories[ eBetween ] = PExpressionFactory( new ExpressionFactory( "AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )" ) );
+ m_aFieldExprFactories[ eNotBetween ] = PExpressionFactory( new ExpressionFactory( "NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )" ) );
+ m_aFieldExprFactories[ eEqualTo ] = PExpressionFactory( new ExpressionFactory( "( $$ ) = ( $1 )" ) );
+ m_aFieldExprFactories[ eNotEqualTo ] = PExpressionFactory( new ExpressionFactory( "( $$ ) <> ( $1 )" ) );
+ m_aFieldExprFactories[ eGreaterThan ] = PExpressionFactory( new ExpressionFactory( "( $$ ) > ( $1 )" ) );
+ m_aFieldExprFactories[ eLessThan ] = PExpressionFactory( new ExpressionFactory( "( $$ ) < ( $1 )" ) );
+ m_aFieldExprFactories[ eGreaterOrEqual ] = PExpressionFactory( new ExpressionFactory( "( $$ ) >= ( $1 )" ) );
+ m_aFieldExprFactories[ eLessOrEqual ] = PExpressionFactory( new ExpressionFactory( "( $$ ) <= ( $1 )" ) );
+}
+
+// -----------------------------------------------------------------------------
+Condition::~Condition()
+{
+ m_bInDestruction = true;
+
+ delete m_pColorFloat;
+ delete m_pBtnUpdaterFontColor;
+ delete m_pBtnUpdaterBackgroundColor;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ )
+{
+ USHORT nId( m_aActions.GetCurItemId() );
+ if ( !m_pColorFloat )
+ m_pColorFloat = new OColorPopup(&m_aActions,this);
+
+ USHORT nTextId = 0;
+ switch(nId)
+ {
+ case SID_ATTR_CHAR_COLOR2:
+ nTextId = STR_CHARCOLOR;
+ break;
+ case SID_BACKGROUND_COLOR:
+ nTextId = STR_CHARBACKGROUND;
+ break;
+ default:
+ break;
+ } // switch(nId)
+ if ( nTextId )
+ m_pColorFloat->SetText(String(ModuleRes(nTextId)));
+ m_pColorFloat->SetSlotId(nId);
+ m_pColorFloat->SetPosPixel(m_aActions.GetItemPopupPosition(nId,m_pColorFloat->GetSizePixel()));
+ m_pColorFloat->StartPopupMode(&m_aActions);
+ m_pColorFloat->StartSelection();
+
+ return 1;
+}
+//------------------------------------------------------------------
+IMPL_LINK( Condition, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ )
+{
+ Color aCol(COL_AUTO);
+ ApplyCommand(m_aActions.GetCurItemId(),aCol);
+ return 0L;
+}
+
+//------------------------------------------------------------------
+IMPL_LINK( Condition, OnConditionAction, Button*, _pClickedButton )
+{
+ if ( _pClickedButton == &m_aMoveUp )
+ m_rAction.moveConditionUp( getConditionIndex() );
+ else if ( _pClickedButton == &m_aMoveDown )
+ m_rAction.moveConditionDown( getConditionIndex() );
+ else if ( _pClickedButton == &m_aAddCondition )
+ m_rAction.addCondition( getConditionIndex() );
+ else if ( _pClickedButton == &m_aRemoveCondition )
+ m_rAction.deleteCondition( getConditionIndex() );
+ return 0L;
+}
+
+//------------------------------------------------------------------------------
+void Condition::ApplyCommand( USHORT _nCommandId, const ::Color& _rColor)
+{
+ if ( _nCommandId == SID_ATTR_CHAR_COLOR2 )
+ m_pBtnUpdaterFontColor->Update( _rColor );
+ else if ( _nCommandId == SID_BACKGROUND_COLOR )
+ m_pBtnUpdaterBackgroundColor->Update( _rColor );
+
+ m_rAction.applyCommand( m_nCondIndex, _nCommandId, _rColor );
+}
+//------------------------------------------------------------------------------
+ImageList Condition::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const
+{
+ sal_Int16 nN = IMG_CONDFORMAT_DLG_SC;
+ sal_Int16 nH = IMG_CONDFORMAT_DLG_SCH;
+ if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE )
+ {
+ nN = IMG_CONDFORMAT_DLG_LC;
+ nH = IMG_CONDFORMAT_DLG_LCH;
+ }
+ return ImageList(ModuleRes( _bHiContast ? nH : nN ));
+}
+//------------------------------------------------------------------
+void Condition::resizeControls(const Size& _rDiff)
+{
+ // we use large images so we must change them
+ if ( _rDiff.Width() || _rDiff.Height() )
+ {
+ Point aPos = LogicToPixel( Point( 2*RELATED_CONTROLS , 0), MAP_APPFONT );
+ Invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+void Condition::Paint( const Rectangle& rRect )
+{
+ Control::Paint(rRect);
+
+ // draw border
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ ColorChanger aColors( this, rStyleSettings.GetShadowColor(), rStyleSettings.GetDialogColor() );
+ DrawRect( impl_getToolBarBorderRect() );
+}
+// -----------------------------------------------------------------------------
+void Condition::StateChanged( StateChangedType nType )
+{
+ Control::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ // Check if we need to get new images for normal/high contrast mode
+ checkImageList();
+ }
+ else if ( nType == STATE_CHANGE_TEXT )
+ {
+ // The physical toolbar changed its outlook and shows another logical toolbar!
+ // We have to set the correct high contrast mode on the new tbx manager.
+ // pMgr->SetHiContrast( IsHiContrastMode() );
+ checkImageList();
+ }
+}
+// -----------------------------------------------------------------------------
+void Condition::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Control::DataChanged( rDCEvt );
+
+ if ((( rDCEvt.GetType() == DATACHANGED_SETTINGS ) ||
+ ( rDCEvt.GetType() == DATACHANGED_DISPLAY )) &&
+ ( rDCEvt.GetFlags() & SETTINGS_STYLE ))
+ {
+ // Check if we need to get new images for normal/high contrast mode
+ checkImageList();
+ }
+}
+
+// -----------------------------------------------------------------------------
+void Condition::GetFocus()
+{
+ Control::GetFocus();
+ if ( !m_bInDestruction )
+ m_aCondLHS.GrabFocus();
+}
+
+// -----------------------------------------------------------------------------
+void Condition::Resize()
+{
+ Control::Resize();
+ impl_layoutAll();
+}
+
+// -----------------------------------------------------------------------------
+Rectangle Condition::impl_getToolBarBorderRect() const
+{
+ const Point aToolbarPos( m_aActions.GetPosPixel() );
+ const Size aToolbarSize( m_aActions.GetSizePixel() );
+ const Size aRelatedControls = LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT );
+
+ Rectangle aBorderRect( aToolbarPos, aToolbarSize );
+ aBorderRect.Left() -= aRelatedControls.Width();
+ aBorderRect.Top() -= aRelatedControls.Height();
+ aBorderRect.Right() += aRelatedControls.Width();
+ aBorderRect.Bottom() += aRelatedControls.Height();
+
+ return aBorderRect;
+}
+
+// -----------------------------------------------------------------------------
+void Condition::impl_layoutAll()
+{
+ // if our width changed, resize/-position some controls
+ const Size aSize( GetOutputSizePixel() );
+ if ( aSize.Width() == m_nLastKnownWindowWidth )
+ return;
+
+ m_nLastKnownWindowWidth = aSize.Width();
+
+ const Size aRelatedControls( LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT ) );
+ const Size aUnrelatedControls( LogicToPixel( Size( UNRELATED_CONTROLS, 0 ), MAP_APPFONT ) );
+ const Point aRow1( LogicToPixel( Point( 0, ROW_1_POS ), MAP_APPFONT ) );
+ const Point aRow3( LogicToPixel( Point( 0, ROW_3_POS ), MAP_APPFONT ) );
+
+ // resize the header line
+ m_aHeader.SetPosSizePixel( 0, 0, aSize.Width() - 2 * aRelatedControls.Width(), 0, WINDOW_POSSIZE_WIDTH );
+
+ // position the up/down buttons
+ const Size aButtonSize( LogicToPixel( Size( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT ), MAP_APPFONT ) );
+ Point aButtonPos( aSize.Width() - aUnrelatedControls.Width() - aButtonSize.Width(), aRow1.Y() );
+ m_aMoveUp.SetPosSizePixel( aButtonPos.X(), aButtonPos.Y(), aButtonSize.Width(), aButtonSize.Height() );
+ aButtonPos.Move( 0, aButtonSize.Height() + aRelatedControls.Height() );
+ m_aMoveDown.SetPosSizePixel( aButtonPos.X(), aButtonPos.Y(), aButtonSize.Width(), aButtonSize.Height() );
+
+ // resize the preview
+ const long nNewPreviewRight = aButtonPos.X() - aRelatedControls.Width();
+
+ const Point aPreviewPos( m_aPreview.GetPosPixel() );
+ OSL_ENSURE( aPreviewPos.X() < nNewPreviewRight, "Condition::impl_layoutAll: being *that* small should not be allowed!" );
+ m_aPreview.SetPosSizePixel( 0, 0, nNewPreviewRight - aPreviewPos.X(), 0, WINDOW_POSSIZE_WIDTH );
+
+ // position the add/remove buttons
+ aButtonPos = Point( nNewPreviewRight - aButtonSize.Width(), aRow3.Y() );
+ m_aRemoveCondition.SetPosSizePixel( aButtonPos.X(), aButtonPos.Y(), aButtonSize.Width(), aButtonSize.Height() );
+ aButtonPos.Move( -( aButtonSize.Width() + aRelatedControls.Width() ), 0 );
+ m_aAddCondition.SetPosSizePixel( aButtonPos.X(), aButtonPos.Y(), aButtonSize.Width(), aButtonSize.Height() );
+
+ // layout the operands input controls
+ impl_layoutOperands();
+}
+
+// -----------------------------------------------------------------------------
+IMPL_LINK( Condition, OnTypeSelected, ListBox*, /*_pNotInterestedIn*/ )
+{
+ impl_layoutOperands();
+ return 0L;
+}
+
+// -----------------------------------------------------------------------------
+IMPL_LINK( Condition, OnOperationSelected, ListBox*, /*_pNotInterestedIn*/ )
+{
+ impl_layoutOperands();
+ return 0L;
+}
+
+// -----------------------------------------------------------------------------
+void Condition::impl_layoutOperands()
+{
+ const ConditionType eType( impl_getCurrentConditionType() );
+ const ComparisonOperation eOperation( impl_getCurrentComparisonOperation() );
+
+ const bool bIsExpression = ( eType == eExpression );
+ const bool bHaveRHS =
+ ( ( eType == eFieldValueComparison )
+ && ( ( eOperation == eBetween )
+ || ( eOperation == eNotBetween )
+ )
+ );
+
+ const Size aRelatedControls( LogicToPixel( Size( RELATED_CONTROLS, 0 ), MAP_APPFONT ) );
+ const Rectangle aPreviewRect( m_aPreview.GetPosPixel(), m_aPreview.GetSizePixel() );
+
+ // the "condition type" list box
+ Rectangle aCondTypeRect( m_aConditionType.GetPosPixel(), m_aConditionType.GetSizePixel() );
+ Point aOpListPos( aCondTypeRect.Right() + aRelatedControls.Width(), aCondTypeRect.Top() );
+ Size aOpListSize( LogicToPixel( Size( COND_OP_WIDTH, 60 ), MAP_APPFONT ) );
+ m_aOperationList.SetPosSizePixel( aOpListPos.X(), aOpListPos.Y(),
+ aOpListSize.Width(), aOpListSize.Height() );
+ m_aOperationList.Show( !bIsExpression );
+
+ // the LHS input field
+ Point aLHSPos( aOpListPos.X() + aOpListSize.Width() + aRelatedControls.Width(), aOpListPos.Y() );
+ if ( bIsExpression )
+ aLHSPos.X() = aOpListPos.X();
+ Size aLHSSize( LogicToPixel( Size( EDIT_WIDTH, EDIT_HEIGHT ), MAP_APPFONT ) );
+ if ( !bHaveRHS )
+ aLHSSize.Width() = aPreviewRect.Right() - aLHSPos.X();
+ m_aCondLHS.SetPosSizePixel( aLHSPos.X(), aLHSPos.Y(), aLHSSize.Width(), aLHSSize.Height() );
+
+ if ( bHaveRHS )
+ {
+ // the "and" text being the glue between LHS and RHS
+ Point aOpGluePos( aLHSPos.X() + aLHSSize.Width() + aRelatedControls.Width(), aLHSPos.Y() );
+ Size aOpGlueSize( m_aOperandGlue.GetTextWidth( m_aOperandGlue.GetText() ) + aRelatedControls.Width(), aLHSSize.Height() );
+ m_aOperandGlue.SetPosSizePixel( aOpGluePos.X(), aOpGluePos.Y(), aOpGlueSize.Width(), aOpGlueSize.Height() );
+
+ // the RHS input field
+ Point aRHSPos( aOpGluePos.X() + aOpGlueSize.Width() + aRelatedControls.Width(), aOpGluePos.Y() );
+ Size aRHSSize( aPreviewRect.Right() - aRHSPos.X(), aLHSSize.Height() );
+ m_aCondRHS.SetPosSizePixel( aRHSPos.X(), aRHSPos.Y(), aRHSSize.Width(), aRHSSize.Height() );
+ }
+
+ m_aOperandGlue.Show( bHaveRHS );
+ m_aCondRHS.Show( bHaveRHS );
+}
+
+// -----------------------------------------------------------------------------
+void Condition::impl_setCondition( const ::rtl::OUString& _rConditionFormula )
+{
+ // determine the condition's type and comparison operation
+ ConditionType eType( eFieldValueComparison );
+ ComparisonOperation eOperation( eBetween );
+
+ // LHS and RHS, matched below
+ ::rtl::OUString sLHS, sRHS;
+
+ if ( _rConditionFormula.getLength() )
+ {
+ // the unprefixed expression which forms the condition
+ ReportFormula aFormula( _rConditionFormula );
+ OSL_ENSURE( aFormula.getType() == ReportFormula::Expression, "Condition::setCondition: illegal formula!" );
+ ::rtl::OUString sExpression;
+ if ( aFormula.getType() == ReportFormula::Expression )
+ sExpression = aFormula.getExpression();
+ // as fallback, if the below matching does not succeed, assume
+ // the whole expression is the LHS
+ sLHS = sExpression;
+
+ // the data field (or expression) to which our control is bound
+ const ReportFormula aFieldContentFormula( m_rAction.getDataField() );
+ const ::rtl::OUString sUnprefixedFieldContent( aFieldContentFormula.getBracketedFieldOrExpression() );
+
+ // check whether one of the Field Value Expression Factories recognizes the expression
+ for ( ExpressionFactories::const_iterator fac = m_aFieldExprFactories.begin();
+ fac != m_aFieldExprFactories.end();
+ ++fac
+ )
+ {
+ if ( fac->second->matchExpression( sExpression, sUnprefixedFieldContent, sLHS, sRHS ) )
+ {
+ eType = eFieldValueComparison;
+ eOperation = fac->first;
+ break;
+ }
+ }
+ }
+
+ // update UI
+ m_aConditionType.SelectEntryPos( (USHORT)eType );
+ m_aOperationList.SelectEntryPos( (USHORT)eOperation );
+ m_aCondLHS.SetText( sLHS );
+ m_aCondRHS.SetText( sRHS );
+
+ // re-layout
+ impl_layoutOperands();
+}
+
+// -----------------------------------------------------------------------------
+void Condition::setCondition( const uno::Reference< report::XFormatCondition >& _rxCondition )
+{
+ OSL_PRECOND( _rxCondition.is(), "Condition::setCondition: empty condition object!" );
+ if ( !_rxCondition.is() )
+ return;
+
+ ::rtl::OUString sConditionFormula;
+ try
+ {
+ if ( _rxCondition.is() )
+ sConditionFormula = _rxCondition->getFormula();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ impl_setCondition( sConditionFormula );
+ updateToolbar( _rxCondition.get() );
+}
+
+// -----------------------------------------------------------------------------
+void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat >& _xReportControlFormat)
+{
+ OSL_ENSURE(_xReportControlFormat.is(),"XReportControlFormat is NULL!");
+ if ( _xReportControlFormat.is() )
+ {
+ USHORT nItemCount = m_aActions.GetItemCount();
+ for (USHORT j = 0; j< nItemCount; ++j)
+ {
+ USHORT nItemId = m_aActions.GetItemId(j);
+ m_aActions.CheckItem( nItemId, m_rController.isFormatCommandEnabled( nItemId, _xReportControlFormat ) );
+ }
+
+ try
+ {
+ Font aBaseFont( Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont() );
+ SvxFont aFont( VCLUnoHelper::CreateFont( _xReportControlFormat->getFontDescriptor(), aBaseFont ) );
+ aFont.SetHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetHeight() ), MAP_POINT, MAP_TWIP ).Height());
+ aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) );
+ aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) );
+ aFont.SetColor( _xReportControlFormat->getCharColor() );
+ m_aPreview.SetFont( aFont );
+ m_aPreview.SetBackColor( _xReportControlFormat->getControlBackground() );
+ m_aPreview.SetTextLineColor( Color( _xReportControlFormat->getCharUnderlineColor() ) );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void Condition::fillFormatCondition(const uno::Reference< report::XFormatCondition >& _xCondition)
+{
+ const ConditionType eType( impl_getCurrentConditionType() );
+ const ComparisonOperation eOperation( impl_getCurrentComparisonOperation() );
+
+ const ::rtl::OUString sLHS( m_aCondLHS.GetText() );
+ const ::rtl::OUString sRHS( m_aCondRHS.GetText() );
+
+ ::rtl::OUString sUndecoratedFormula( sLHS );
+
+ if ( eType == eFieldValueComparison )
+ {
+ ReportFormula aFieldContentFormula( m_rAction.getDataField() );
+ ::rtl::OUString sUnprefixedFieldContent( aFieldContentFormula.getBracketedFieldOrExpression() );
+
+ PExpressionFactory pFactory( m_aFieldExprFactories[ eOperation ] );
+ sUndecoratedFormula = pFactory->assembleExpression( sUnprefixedFieldContent, sLHS, sRHS );
+ }
+
+ ReportFormula aFormula( ReportFormula::Expression, sUndecoratedFormula );
+ _xCondition->setFormula( aFormula.getCompleteFormula() );
+}
+// -----------------------------------------------------------------------------
+void Condition::setConditionIndex( size_t _nCondIndex, size_t _nCondCount )
+{
+ m_nCondIndex = _nCondIndex;
+ String sHeader( ModuleRes( STR_NUMBERED_CONDITION ) );
+ sHeader.SearchAndReplaceAscii( "$number$", String::CreateFromInt32( _nCondIndex + 1 ) );
+ m_aHeader.SetText( sHeader );
+
+ m_aMoveUp.Enable( _nCondIndex > 0 );
+ OSL_PRECOND( _nCondCount > 0, "Condition::setConditionIndex: having no conditions at all is nonsense!" );
+ m_aMoveDown.Enable( _nCondIndex < _nCondCount - 1 );
+}
+
+// -----------------------------------------------------------------------------
+bool Condition::isEmpty() const
+{
+ return m_aCondLHS.GetText().Len() == 0;
+}
+
+// =============================================================================
+} // rptui
+// =============================================================================
+
diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx
new file mode 100644
index 000000000000..0b7bec3cb343
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Condition.hxx
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Condition.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_CONDITION_HXX
+#define RPTUI_CONDITION_HXX
+
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SV_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _SV_TOOLBOX_HXX
+#include <vcl/toolbox.hxx>
+#endif
+#ifndef DBAUI_TOOLBOXHELPER_HXX
+#include <dbaccess/ToolBoxHelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATCONDITION_HPP_
+#include <com/sun/star/report/XFormatCondition.hpp>
+#endif
+#ifndef _SVX_FNTCTRL_HXX
+#include <svx/fntctrl.hxx>
+#endif
+#ifndef _VALUESET_HXX
+#include <svtools/valueset.hxx>
+#endif
+
+#include <boost/shared_ptr.hpp>
+
+#include <memory>
+#include <map>
+
+namespace svx { class ToolboxButtonColorUpdater; }
+
+namespace rptui
+{
+ class ConditionalFormattingDialog;
+ class OColorPopup;
+ class OReportController;
+ class IConditionalFormatAction;
+
+ //========================================================================
+ //= ConditionType
+ //========================================================================
+ enum ConditionType
+ {
+ eFieldValueComparison = 0,
+ eExpression = 1
+ };
+
+ //========================================================================
+ //= ComparisonOperation
+ //========================================================================
+ enum ComparisonOperation
+ {
+ eBetween = 0,
+ eNotBetween = 1,
+ eEqualTo = 2,
+ eNotEqualTo = 3,
+ eGreaterThan = 4,
+ eLessThan = 5,
+ eGreaterOrEqual = 6,
+ eLessOrEqual = 7
+ };
+
+ class IExpressionFactory;
+ typedef ::boost::shared_ptr< IExpressionFactory > PExpressionFactory;
+ typedef ::std::map< ComparisonOperation, PExpressionFactory > ExpressionFactories;
+ //========================================================================
+ //= Condition
+ //========================================================================
+ class Condition :public Control
+ ,public dbaui::OToolBoxHelper
+ {
+ ::rptui::OReportController& m_rController;
+ IConditionalFormatAction& m_rAction;
+ FixedLine m_aHeader;
+ ListBox m_aConditionType;
+ ListBox m_aOperationList;
+ Edit m_aCondLHS;
+ FixedText m_aOperandGlue;
+ Edit m_aCondRHS;
+ ToolBox m_aActions;
+ SvxFontPrevWindow m_aPreview;
+ ImageButton m_aMoveUp;
+ ImageButton m_aMoveDown;
+ PushButton m_aAddCondition;
+ PushButton m_aRemoveCondition;
+ OColorPopup* m_pColorFloat;
+
+ ::svx::ToolboxButtonColorUpdater* m_pBtnUpdaterFontColor; // updates the color below the toolbar icon
+ ::svx::ToolboxButtonColorUpdater* m_pBtnUpdaterBackgroundColor;
+
+
+ size_t m_nCondIndex;
+ long m_nLastKnownWindowWidth;
+ bool m_bInDestruction;
+
+ ExpressionFactories m_aFieldExprFactories;
+
+ DECL_LINK( OnFormatAction, ToolBox* );
+ DECL_LINK( DropdownClick, ToolBox* );
+ DECL_LINK( OnConditionAction, Button* );
+
+ public:
+ Condition( Window* _pParent, IConditionalFormatAction& _rAction, ::rptui::OReportController& _rController );
+ virtual ~Condition();
+
+ /** will be called when the id of the image list is needed.
+ @param _eBitmapSet
+ <svtools/imgdef.hxx>
+ @param _bHiContast
+ <TRUE/> when in high contrast mode.
+ */
+ virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const;
+
+ /** will be called when the controls need to be resized.
+ */
+ virtual void resizeControls(const Size& _rDiff);
+
+ /** sets the props at the control
+ @param _xCondition the source
+ */
+ void setCondition(const com::sun::star::uno::Reference< com::sun::star::report::XFormatCondition >& _xCondition);
+
+ /** fills from the control
+ _xCondition the destination
+ */
+ void fillFormatCondition(const com::sun::star::uno::Reference< com::sun::star::report::XFormatCondition >& _xCondition);
+
+ /** updates the toolbar
+ _xCondition the destination
+ */
+ void updateToolbar(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat >& _xCondition);
+
+ /// tells the condition its new index within the dialog's condition array
+ void setConditionIndex( size_t _nCondIndex, size_t _nCondCount );
+
+ /// returns the condition's index within the dialog's condition array
+ size_t getConditionIndex() const { return m_nCondIndex; }
+
+ /** determines whether the condition is actually empty
+ */
+ bool isEmpty() const;
+
+ /** forward to the parent class
+ */
+ void ApplyCommand(USHORT _nCommandId, const ::Color& _aColor );
+
+ protected:
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+
+ private:
+ void impl_layoutAll();
+ void impl_layoutOperands();
+
+ /// determines the rectangle to be occupied by the toolbar, including the border drawn around it
+ Rectangle impl_getToolBarBorderRect() const;
+
+ inline ConditionType
+ impl_getCurrentConditionType() const;
+
+ inline ComparisonOperation
+ impl_getCurrentComparisonOperation() const;
+
+ void impl_setCondition( const ::rtl::OUString& _rConditionFormula );
+
+ private:
+ DECL_LINK( OnTypeSelected, ListBox* );
+ DECL_LINK( OnOperationSelected, ListBox* );
+ };
+
+ // -------------------------------------------------------------------------
+ inline ConditionType Condition::impl_getCurrentConditionType() const
+ {
+ return sal::static_int_cast< ConditionType >( m_aConditionType.GetSelectEntryPos() );
+ }
+
+ // -------------------------------------------------------------------------
+ inline ComparisonOperation Condition::impl_getCurrentComparisonOperation() const
+ {
+ return sal::static_int_cast< ComparisonOperation >( m_aOperationList.GetSelectEntryPos() );
+ }
+
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_CONDITION_HXX
+
diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx
new file mode 100644
index 000000000000..fbeb26b88e8d
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.cxx
@@ -0,0 +1,282 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DateTime.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_DATETIME_HXX
+#include "DateTime.hxx"
+#endif
+#ifndef RPTUI_DATETIME_HRC
+#include "DateTime.hrc"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_DBU_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef _DBHELPER_DBCONVERSION_HXX_
+#include <connectivity/dbconversion.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
+#include <svtools/syslocale.hxx>
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_TIME_HPP_
+#include <com/sun/star/util/Time.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_
+#include <com/sun/star/util/NumberFormat.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP_
+#include <com/sun/star/util/XNumberFormatPreviewer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_I18N_NUMBERFORMATINDEX_HPP_
+#include <com/sun/star/i18n/NumberFormatIndex.hpp>
+#endif
+#ifndef _COMPHELPER_NUMBERS_HXX_
+#include <comphelper/numbers.hxx>
+#endif
+#include <algorithm>
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace ::comphelper;
+
+DBG_NAME( rpt_ODateTimeDialog )
+//========================================================================
+// class ODateTimeDialog
+//========================================================================
+ODateTimeDialog::ODateTimeDialog( Window* _pParent
+ ,const uno::Reference< report::XSection >& _xHoldAlive
+ ,OReportController* _pController)
+ : ModalDialog( _pParent, ModuleRes(RID_DATETIME_DLG) )
+ ,m_aFLDate(this, ModuleRes(FL_DATE ) )
+ ,m_aDate(this, ModuleRes(CB_DATE ) )
+ ,m_aDateF1(this, ModuleRes(RB_DATE_F1 ) )
+ ,m_aDateF2(this, ModuleRes(RB_DATE_F2 ) )
+ ,m_aDateF3(this, ModuleRes(RB_DATE_F3 ) )
+ ,m_aFLTime(this, ModuleRes(FL_TIME ) )
+ ,m_aTime(this, ModuleRes(CB_TIME ) )
+ ,m_aTimeF1(this, ModuleRes(RB_TIME_F1 ) )
+ ,m_aTimeF2(this, ModuleRes(RB_TIME_F2 ) )
+ ,m_aTimeF3(this, ModuleRes(RB_TIME_F3 ) )
+ ,m_aFL1(this,ModuleRes(FL_SEPARATOR1) )
+ ,m_aPB_OK(this, ModuleRes(PB_OK))
+ ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL))
+ ,m_aPB_Help(this, ModuleRes(PB_HELP))
+ ,m_pController(_pController)
+ ,m_xHoldAlive(_xHoldAlive)
+{
+ DBG_CTOR( rpt_ODateTimeDialog,NULL);
+
+ try
+ {
+ SvtSysLocale aSysLocale;
+ m_nLocale = aSysLocale.GetLocaleData().getLocale();
+ }
+ catch(uno::Exception&)
+ {
+ }
+ m_aDateF1.SetText(getFormatString(i18n::NumberFormatIndex::DATE_SYSTEM_LONG));
+ m_aDateF2.SetText(getFormatString(i18n::NumberFormatIndex::DATE_SYS_DMMMYYYY));
+ m_aDateF3.SetText(getFormatString(i18n::NumberFormatIndex::DATE_SYSTEM_SHORT));
+
+ m_aTimeF1.SetText(getFormatString(i18n::NumberFormatIndex::TIME_HHMMSS));
+ m_aTimeF2.SetText(getFormatString(i18n::NumberFormatIndex::TIME_HHMMSSAMPM));
+ m_aTimeF3.SetText(getFormatString(i18n::NumberFormatIndex::TIME_HHMM));
+
+ CheckBox* pCheckBoxes[] = { &m_aDate,&m_aTime};
+ for ( size_t i = 0 ; i < sizeof(pCheckBoxes)/sizeof(pCheckBoxes[0]); ++i)
+ pCheckBoxes[i]->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl));
+
+ FreeResource();
+}
+
+//------------------------------------------------------------------------
+ODateTimeDialog::~ODateTimeDialog()
+{
+ DBG_DTOR( rpt_ODateTimeDialog,NULL);
+}
+// -----------------------------------------------------------------------------
+short ODateTimeDialog::Execute()
+{
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+ short nRet = ModalDialog::Execute();
+ if ( nRet == RET_OK && (m_aDate.IsChecked() || m_aTime.IsChecked()) )
+ {
+ try
+ {
+ sal_Int32 nLength = 0;
+ uno::Sequence<beans::PropertyValue> aValues( 4 );
+ aValues[nLength].Name = PROPERTY_SECTION;
+ aValues[nLength++].Value <<= m_xHoldAlive;
+
+ aValues[nLength].Name = PROPERTY_STATE;
+ aValues[nLength++].Value <<= m_aTime.IsChecked();
+
+ aValues[nLength].Name = PROPERTY_FORMATKEYDATE;
+ aValues[nLength++].Value <<= getFormatKey(getFormatIndex(sal_True));
+
+ aValues[nLength].Name = PROPERTY_FORMATKEYTIME;
+ aValues[nLength++].Value <<= getFormatKey(getFormatIndex(sal_False));
+
+ m_pController->executeChecked(SID_DATETIME,aValues);
+ }
+ catch(uno::Exception&)
+ {
+ nRet = RET_NO;
+ }
+ }
+ return nRet;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ODateTimeDialog::getFormatString(::sal_Int16 _nNumberFormatIndex)
+{
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+ uno::Reference< util::XNumberFormatter> xNumberFormatter = m_pController->getNumberFormatter();
+ uno::Reference< util::XNumberFormats> xFormats = xNumberFormatter->getNumberFormatsSupplier()->getNumberFormats();
+ uno::Reference< util::XNumberFormatTypes> xNumType(xFormats,uno::UNO_QUERY);
+ sal_Int32 nFormatKey = xNumType->getFormatIndex(_nNumberFormatIndex,m_nLocale);
+
+ uno::Reference< beans::XPropertySet> xFormSet = xFormats->getByKey(nFormatKey);
+ OSL_ENSURE(xFormSet.is(),"XPropertySet is null!");
+ ::rtl::OUString sFormat;
+ xFormSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormatString"))) >>= sFormat;
+
+ lang::Locale aLocale;
+ ::comphelper::getNumberFormatProperty(xNumberFormatter,nFormatKey,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locale"))) >>= aLocale;
+
+ double nValue = 0;
+ if ( _nNumberFormatIndex >= i18n::NumberFormatIndex::TIME_START )
+ {
+ Time aCurrentTime;
+ nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime()));
+ }
+ else
+ {
+ Date aCurrentDate;
+ static ::com::sun::star::util::Date STANDARD_DB_DATE(31,12,1899);
+ nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE);
+ }
+
+ uno::Reference< util::XNumberFormatPreviewer> xPreViewer(xNumberFormatter,uno::UNO_QUERY);
+ OSL_ENSURE(xPreViewer.is(),"XNumberFormatPreviewer is null!");
+ return xPreViewer->convertNumberToPreviewString(sFormat,nValue,aLocale,sal_True);
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( ODateTimeDialog, CBClickHdl, CheckBox*, _pBox )
+{
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+
+ RadioButton* pRadioButtons[] = { &m_aDateF1,&m_aDateF2,&m_aDateF3, &m_aTimeF1, &m_aTimeF2, &m_aTimeF3};
+ int i = 0;
+ int nCount = 3;
+ sal_Bool bShow = sal_False;
+ if ( _pBox == &m_aDate )
+ {
+ bShow = m_aDate.IsChecked();
+ }
+ else if ( _pBox == &m_aTime )
+ {
+ bShow = m_aTime.IsChecked();
+ i = 3;
+ nCount = sizeof(pRadioButtons)/sizeof(pRadioButtons[0]);
+ }
+
+ for ( ; i < nCount ; ++i)
+ pRadioButtons[i]->Enable(bShow);
+ return 1L;
+}
+// -----------------------------------------------------------------------------
+sal_Int16 ODateTimeDialog::getFormatIndex(sal_Bool _bDate)
+{
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+ sal_Int16 nFormat;
+ if ( _bDate )
+ nFormat = m_aDateF1.IsChecked() ? i18n::NumberFormatIndex::DATE_SYSTEM_LONG : (m_aDateF2.IsChecked() ? i18n::NumberFormatIndex::DATE_SYS_DMMMYYYY : i18n::NumberFormatIndex::DATE_SYSTEM_SHORT);
+ else
+ nFormat = m_aTimeF1.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSS : (m_aTimeF2.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSSAMPM : i18n::NumberFormatIndex::TIME_HHMM);
+ return nFormat;
+}
+// -----------------------------------------------------------------------------
+sal_Int32 ODateTimeDialog::getFormatKey(::sal_Int16 _nNumberFormatIndex)
+{
+ uno::Reference< util::XNumberFormatter> xNumberFormatter = m_pController->getNumberFormatter();
+ uno::Reference< util::XNumberFormats> xFormats = xNumberFormatter->getNumberFormatsSupplier()->getNumberFormats();
+ uno::Reference< util::XNumberFormatTypes> xNumType(xFormats,uno::UNO_QUERY);
+ return xNumType->getFormatIndex(_nNumberFormatIndex,m_nLocale);
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/DateTime.hrc b/reportdesign/source/ui/dlg/DateTime.hrc
new file mode 100644
index 000000000000..9723bff88cda
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.hrc
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DateTime.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_DATETIME_HRC
+#define RPTUI_DATETIME_HRC
+
+#define CB_DATE (1)
+#define RB_DATE_F1 (2)
+#define RB_DATE_F2 (3)
+#define RB_DATE_F3 (4)
+#define CB_TIME (5)
+#define RB_TIME_F1 (6)
+#define RB_TIME_F2 (7)
+#define RB_TIME_F3 (8)
+#define FL_SAMPLE (9)
+#define PB_OK (10)
+#define PB_CANCEL (11)
+#define PB_HELP (12)
+#define FT_DATESAMPLE (13)
+#define FL_SEPARATOR1 (14)
+#define FT_TIMESAMPLE (15)
+#define FL_DATE (16)
+#define FL_TIME (17)
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_HEIGHT 8
+#define RELATED_CONTROLS 4
+#define UNRELATED_CONTROLS 7
+#define EDIT_HEIGHT 12
+#define BUTTON_HEIGHT 14
+#define BUTTON_WIDTH 50
+#define BROWSER_HEIGHT 75
+#define PAGE_WIDTH (RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 3*BUTTON_WIDTH)
+#define PAGE_HEIGHT (10*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 10*FIXEDTEXT_HEIGHT +1 + BUTTON_HEIGHT)
+#define LISTBOX_WIDTH PAGE_WIDTH - 3*UNRELATED_CONTROLS - FIXEDTEXT_WIDTH
+
+#endif // RPTUI_DATETIME_HRC
diff --git a/reportdesign/source/ui/dlg/DateTime.src b/reportdesign/source/ui/dlg/DateTime.src
new file mode 100644
index 000000000000..79e63795be70
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.src
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DateTime.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "DateTime.hrc"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+
+ModalDialog RID_DATETIME_DLG
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( PAGE_WIDTH , PAGE_HEIGHT ) ;
+ Text [ de ] = "Datum und Zeit" ;
+ Text [ en-US ] = "Date and Time" ;
+ HelpId = HID_DATETIME_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ FixedLine FL_DATE
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Datum";
+ Text [ en-US ] = "Date";
+ };
+
+ CheckBox CB_DATE
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , RELATED_CONTROLS + UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ;
+ Check = TRUE;
+ Text [ de ] = "Datum anzeigen";
+ Text [ en-US ] = "Include Date";
+ };
+
+ RadioButton RB_DATE_F1
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 2*RELATED_CONTROLS + UNRELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Group = TRUE;
+ Check = TRUE;
+ };
+ RadioButton RB_DATE_F2
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 3*RELATED_CONTROLS + UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ };
+
+ RadioButton RB_DATE_F3
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 4*RELATED_CONTROLS + UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ };
+ FixedLine FL_TIME
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 4*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Zeit";
+ Text [ en-US ] = "Time";
+ };
+ CheckBox CB_TIME
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 5*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Check = TRUE;
+ Text [ de ] = "Zeit anzeigen";
+ Text [ en-US ] = "Include Time";
+ };
+
+ RadioButton RB_TIME_F1
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Group = TRUE;
+ Check = TRUE;
+ };
+ RadioButton RB_TIME_F2
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 7*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 8*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ };
+
+ RadioButton RB_TIME_F3
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 8*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ };
+
+ FixedLine FL_SEPARATOR1
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 8*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 10*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ;
+ };
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 9*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 10*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + BUTTON_WIDTH , 9*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 10*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton PB_HELP
+ {
+ TabStop = TRUE ;
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 2*BUTTON_WIDTH , 9*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 10*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ Text [ de ] = "~Hilfe" ;
+ Text [ en-US ] = "~Help";
+ };
+};
diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx
new file mode 100644
index 000000000000..f01db2bc18eb
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupExchange.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupExchange.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_GROUP_EXCHANGE_HXX
+#include "GroupExchange.hxx"
+#endif
+
+#ifndef _SOT_FORMATS_HXX
+#include <sot/formats.hxx>
+#endif
+#ifndef _SOT_STORAGE_HXX
+#include <sot/storage.hxx>
+#endif
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star::beans;
+
+ sal_uInt32 OGroupExchange::getReportGroupId()
+ {
+ static sal_uInt32 s_nReportFormat = (sal_uInt32)-1;
+ if ( (sal_uInt32)-1 == s_nReportFormat )
+ {
+ s_nReportFormat = SotExchange::RegisterFormatName(String::CreateFromAscii("application/x-openoffice;windows_formatname=\"reportdesign.GroupFormat\"" ));
+ OSL_ENSURE((sal_uInt32)-1 != s_nReportFormat, "Bad exchange id!");
+ }
+ return s_nReportFormat;
+ }
+ OGroupExchange::OGroupExchange(const uno::Sequence< uno::Any >& _aGroupRow)
+ : m_aGroupRow(_aGroupRow)
+ {
+ }
+ // -----------------------------------------------------------------------------
+ void OGroupExchange::AddSupportedFormats()
+ {
+ if ( m_aGroupRow.getLength() )
+ {
+ AddFormat(OGroupExchange::getReportGroupId());
+ }
+ }
+ // -----------------------------------------------------------------------------
+ sal_Bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
+ {
+ ULONG nFormat = SotExchange::GetFormat(rFlavor);
+ if(nFormat == OGroupExchange::getReportGroupId() )
+ {
+ return SetAny(uno::makeAny(m_aGroupRow),rFlavor);
+ }
+ return sal_False;
+ }
+ // -----------------------------------------------------------------------------
+ void OGroupExchange::ObjectReleased()
+ {
+ m_aGroupRow.realloc(0);
+ }
+ // -----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/ui/dlg/GroupExchange.hxx b/reportdesign/source/ui/dlg/GroupExchange.hxx
new file mode 100644
index 000000000000..e7a02184ea37
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupExchange.hxx
@@ -0,0 +1,69 @@
+#ifndef RPTUI_GROUP_EXCHANGE_HXX
+#define RPTUI_GROUP_EXCHANGE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupExchange.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+#ifndef RPTUI_GROUPS_SORTING_HXX
+#include "GroupsSorting.hxx"
+#endif
+
+namespace rptui
+{
+ /** clipboard class for group rows in the groups and sorting dialog
+ */
+ class OGroupExchange : public TransferableHelper
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aGroupRow;
+ public:
+ OGroupExchange(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& _aGroupRow);
+
+ static sal_uInt32 getReportGroupId();
+ protected:
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+ virtual void ObjectReleased();
+ };
+}
+#endif // RPTUI_GROUP_EXCHANGE_HXX
+
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
new file mode 100644
index 000000000000..87ed95602da6
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -0,0 +1,1441 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupsSorting.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_GROUPS_SORTING_HXX
+#include "GroupsSorting.hxx"
+#endif
+#ifndef RPTUI_GROUPSSORTING_HRC
+#include "GroupsSorting.hrc"
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _SVTOOLS_EDITBROWSEBOX_HXX_
+#include <svtools/editbrowsebox.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
+#include <com/sun/star/sdbc/DataType.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_DBU_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_GROUPON_HPP_
+#include <com/sun/star/report/GroupOn.hpp>
+#endif
+#ifndef RPTUI_GROUP_EXCHANGE_HXX
+#include "GroupExchange.hxx"
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
+#include <com/sun/star/container/XContainerListener.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _SV_MNEMONIC_HXX
+#include <vcl/mnemonic.hxx>
+#endif
+#include <algorithm>
+#include <boost/bind.hpp>
+
+#define HANDLE_ID 0
+#define FIELD_EXPRESSION 1
+#define GROUPS_START_LEN 5
+#define NO_GROUP -1
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace svt;
+using namespace ::comphelper;
+
+typedef ::svt::EditBrowseBox OFieldExpressionControl_Base;
+typedef ::cppu::WeakImplHelper1< container::XContainerListener > TContainerListenerBase;
+class OFieldExpressionControl : public TContainerListenerBase
+ ,public OFieldExpressionControl_Base
+{
+ ::osl::Mutex m_aMutex;
+ ::std::vector<sal_Int32> m_aGroupPositions;
+ ::svt::ComboBoxControl* m_pComboCell;
+ sal_Int32 m_nDataPos;
+ sal_Int32 m_nCurrentPos;
+ ULONG m_nPasteEvent;
+ ULONG m_nDeleteEvent;
+ OGroupsSortingDialog* m_pParent;
+ bool m_bIgnoreEvent;
+
+
+ void fillListBox(const uno::Reference< beans::XPropertySet>& _xDest,long nRow,USHORT nColumnId);
+ BOOL SaveModified(bool _bAppend);
+
+ OFieldExpressionControl(const OFieldExpressionControl&);
+ void operator =(const OFieldExpressionControl&);
+public:
+ OFieldExpressionControl( OGroupsSortingDialog* _pParent,const ResId& _rResId);
+ virtual ~OFieldExpressionControl();
+
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException );
+ // XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException);
+
+ void fillColumns(const uno::Reference< container::XNameAccess>& _xColumns);
+ void lateInit();
+ sal_Bool IsDeleteAllowed( );
+ void DeleteRows();
+ void cut();
+ void copy();
+ void paste();
+
+ inline sal_Int32 getGroupPosition(sal_Int32 _nRow) const { return _nRow != BROWSER_ENDOFSELECTION ? m_aGroupPositions[_nRow] : sal_Int32(NO_GROUP); }
+
+ inline ::svt::ComboBoxControl* getExpressionControl() const { return m_pComboCell; }
+
+
+ /** returns the sequence with the selected groups
+ */
+ uno::Sequence<uno::Any> fillSelectedGroups();
+
+ /** move groups given by _aGroups
+ */
+ void moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,sal_Bool _bSelect = sal_True);
+
+ virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol);
+ using OFieldExpressionControl_Base::GetRowCount;
+protected:
+ virtual BOOL IsTabAllowed(BOOL bForward) const;
+
+
+ virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol );
+ virtual ::svt::CellController* GetController( long nRow, USHORT nCol );
+ virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const;
+ virtual BOOL SeekRow( long nRow );
+ virtual BOOL SaveModified();
+ virtual String GetCellText( long nRow, USHORT nColId ) const;
+ virtual RowStatus GetRowStatus(long nRow) const;
+
+ virtual void KeyInput(const KeyEvent& rEvt);
+ virtual void Command( const CommandEvent& rEvt );
+
+ // D&D
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ virtual sal_Int8 AcceptDrop( const BrowserAcceptDropEvent& rEvt );
+ virtual sal_Int8 ExecuteDrop( const BrowserExecuteDropEvent& rEvt );
+
+ using BrowseBox::AcceptDrop;
+ using BrowseBox::ExecuteDrop;
+
+private:
+
+ DECL_LINK( AsynchActivate, void* );
+ DECL_LINK( AsynchDeactivate, void* );
+ DECL_LINK( DelayedPaste, void* );
+ DECL_LINK( DelayedDelete, void* );
+ DECL_LINK( CBChangeHdl,ComboBox*);
+
+ void InsertRows( long nRow );
+};
+//========================================================================
+// class OFieldExpressionControl
+//========================================================================
+DBG_NAME( rpt_OFieldExpressionControl )
+//------------------------------------------------------------------------
+OFieldExpressionControl::OFieldExpressionControl( OGroupsSortingDialog* _pParent,const ResId& _rResId )
+ :EditBrowseBox( _pParent, _rResId,EBBF_NONE, WB_TABSTOP | BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_AUTOSIZE_LASTCOL |
+ BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL)
+ ,m_aGroupPositions(GROUPS_START_LEN,-1)
+ ,m_pComboCell(NULL)
+ ,m_nDataPos(-1)
+ ,m_nCurrentPos(-1)
+ ,m_nPasteEvent(0)
+ ,m_nDeleteEvent(0)
+ ,m_pParent(_pParent)
+ ,m_bIgnoreEvent(false)
+{
+ DBG_CTOR( rpt_OFieldExpressionControl,NULL);
+ SetBorderStyle(WINDOW_BORDER_MONO);
+}
+
+//------------------------------------------------------------------------
+OFieldExpressionControl::~OFieldExpressionControl()
+{
+ acquire();
+ uno::Reference< report::XGroups > xGroups = m_pParent->getGroups();
+ xGroups->removeContainerListener(this);
+ //////////////////////////////////////////////////////////////////////
+ // delete events from queue
+ if( m_nPasteEvent )
+ Application::RemoveUserEvent( m_nPasteEvent );
+ if( m_nDeleteEvent )
+ Application::RemoveUserEvent( m_nDeleteEvent );
+
+ delete m_pComboCell;
+ DBG_DTOR( rpt_OFieldExpressionControl,NULL);
+}
+//------------------------------------------------------------------------------
+uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups()
+{
+ uno::Sequence<uno::Any> aList;
+ ::std::vector<uno::Any> vClipboardList;
+ vClipboardList.reserve(GetSelectRowCount());
+
+ uno::Reference<report::XGroups> xGroups = m_pParent->getGroups();
+ sal_Int32 nCount = xGroups->getCount();
+ if ( nCount >= 1 )
+ {
+ for( long nIndex=FirstSelectedRow(); nIndex >= 0 ; nIndex=NextSelectedRow() )
+ {
+ try
+ {
+ if ( m_aGroupPositions[nIndex] != NO_GROUP )
+ {
+ uno::Reference< report::XGroup> xOrgGroup(xGroups->getByIndex(m_aGroupPositions[nIndex]),uno::UNO_QUERY);
+ uno::Reference< report::XGroup> xCopy = xGroups->createGroup();
+ ::comphelper::copyProperties(xOrgGroup.get(),xCopy.get());
+ vClipboardList.push_back( uno::makeAny(xCopy) );
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can not access group!");
+ }
+ }
+ if ( !vClipboardList.empty() )
+ aList = uno::Sequence< uno::Any >(&vClipboardList[0], vClipboardList.size());
+ } // if ( nCount > 1 )
+ return aList;
+}
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::StartDrag( sal_Int8 /*_nAction*/ , const Point& /*_rPosPixel*/ )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ if ( m_pParent && !m_pParent->isReadOnly( ) )
+ {
+ uno::Sequence<uno::Any> aClipboardList = fillSelectedGroups();
+
+ if( aClipboardList.getLength() )
+ {
+ OGroupExchange* pData = new OGroupExchange(aClipboardList);
+ uno::Reference< ::com::sun::star::datatransfer::XTransferable> xRef = pData;
+ pData->StartDrag(this, DND_ACTION_MOVE );
+ } // if(!vClipboardList.empty())
+ }
+}
+//------------------------------------------------------------------------------
+sal_Int8 OFieldExpressionControl::AcceptDrop( const BrowserAcceptDropEvent& /*rEvt*/ )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ sal_Int8 nAction = DND_ACTION_NONE;
+ if ( IsDropFormatSupported( OGroupExchange::getReportGroupId() ) && m_pParent->getGroups()->getCount() > 1 )
+ {
+ nAction = DND_ACTION_MOVE;
+ }
+ return nAction;
+}
+//------------------------------------------------------------------------------
+sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ sal_Int8 nAction = DND_ACTION_NONE;
+ if ( IsDropFormatSupported( OGroupExchange::getReportGroupId() ) )
+ {
+ sal_Int32 nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), sal_False);
+ SetNoSelection();
+
+ TransferableDataHelper aDropped( rEvt.maDropEvent.Transferable );
+ uno::Any aDrop = aDropped.GetAny(OGroupExchange::getReportGroupId());
+ uno::Sequence< uno::Any > aGroups;
+ aDrop >>= aGroups;
+ if ( aGroups.getLength() )
+ {
+ moveGroups(aGroups,nRow);
+ nAction = DND_ACTION_MOVE;
+ }
+ }
+ return nAction;
+}
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,sal_Bool _bSelect)
+{
+ if ( _aGroups.getLength() )
+ {
+ m_bIgnoreEvent = true;
+ sal_Int32 nRow = _nRow;
+ String sUndoAction(String(ModuleRes(RID_STR_UNDO_MOVE_GROUP)));
+ m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ uno::Reference< report::XGroups> xGroups = m_pParent->getGroups();
+ const uno::Any* pIter = _aGroups.getConstArray();
+ const uno::Any* pEnd = pIter + _aGroups.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ uno::Reference< report::XGroup> xGroup(*pIter,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ uno::Sequence< beans::PropertyValue > aArgs(1);
+ aArgs[0].Name = PROPERTY_GROUP;
+ aArgs[0].Value <<= xGroup;
+ // we use this way to create undo actions
+ m_pParent->m_pController->executeChecked(SID_GROUP_REMOVE,aArgs);
+ aArgs.realloc(2);
+ if ( nRow > xGroups->getCount() )
+ nRow = xGroups->getCount();
+ if ( _bSelect )
+ SelectRow(nRow);
+ aArgs[1].Name = PROPERTY_POSITIONY;
+ aArgs[1].Value <<= nRow;
+ m_pParent->m_pController->executeChecked(SID_GROUP_APPEND,aArgs);
+ ++nRow;
+ }
+ } // for(;pIter != pEnd;++pIter)
+ m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_bIgnoreEvent = false;
+ Invalidate();
+ } // if ( _aGroups.getLength() )
+}
+// -----------------------------------------------------------------------------
+void OFieldExpressionControl::fillColumns(const uno::Reference< container::XNameAccess>& _xColumns)
+{
+ m_pComboCell->Clear();
+ if ( _xColumns.is() )
+ {
+ uno::Sequence< ::rtl::OUString> aColumnNames = _xColumns->getElementNames();
+ const ::rtl::OUString* pIter = aColumnNames.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aColumnNames.getLength();
+ for(;pIter != pEnd;++pIter)
+ m_pComboCell->InsertEntry(*pIter);
+ } // if ( _xColumns.is() )
+}
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::lateInit()
+{
+ uno::Reference< report::XGroups > xGroups = m_pParent->getGroups();
+ sal_Int32 nGroupsCount = xGroups->getCount();
+ m_aGroupPositions.resize(::std::max<sal_Int32>(nGroupsCount,sal_Int32(GROUPS_START_LEN)),NO_GROUP);
+ ::std::vector<sal_Int32>::iterator aIter = m_aGroupPositions.begin();
+ for (sal_Int32 i = 0; i < nGroupsCount; ++i,++aIter)
+ *aIter = i;
+
+ if ( ColCount() == 0 )
+ {
+ Font aFont( GetDataWindow().GetFont() );
+ aFont.SetWeight( WEIGHT_NORMAL );
+ GetDataWindow().SetFont( aFont );
+
+ // Font fuer die Ueberschriften auf Light setzen
+ aFont = GetFont();
+ aFont.SetWeight( WEIGHT_LIGHT );
+ SetFont(aFont);
+
+ InsertHandleColumn(static_cast<USHORT>(GetTextWidth('0') * 4)/*, TRUE */);
+ InsertDataColumn( FIELD_EXPRESSION, String(ModuleRes(STR_RPT_EXPRESSION)), 100);
+
+ m_pComboCell = new ComboBoxControl( &GetDataWindow() );
+ m_pComboCell->SetSelectHdl(LINK(this,OFieldExpressionControl,CBChangeHdl));
+ m_pComboCell->SetHelpId(HID_FIELDEXPRESSION);
+
+ Control* pControls[] = {m_pComboCell};
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ {
+ pControls[i]->SetGetFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusGot));
+ pControls[i]->SetLoseFocusHdl(LINK(m_pParent, OGroupsSortingDialog, OnControlFocusLost));
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // set browse mode
+ BrowserMode nMode(BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION |
+ BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL | BROWSER_AUTO_VSCROLL | BROWSER_AUTO_HSCROLL);
+ if( m_pParent->isReadOnly() )
+ nMode |= BROWSER_HIDECURSOR;
+ SetMode(nMode);
+ xGroups->addContainerListener(this);
+ }
+ else
+ // not the first call
+ RowRemoved(0, GetRowCount());
+
+ RowInserted(0, m_aGroupPositions.size(), TRUE);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+IMPL_LINK( OFieldExpressionControl, CBChangeHdl, ComboBox*, /*pComboBox*/ )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+
+ SaveModified();
+ return 0L;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK(OFieldExpressionControl, AsynchActivate, void*, EMPTYARG)
+{
+ ActivateCell();
+ return 0L;
+}
+
+//------------------------------------------------------------------------------
+IMPL_LINK(OFieldExpressionControl, AsynchDeactivate, void*, EMPTYARG)
+{
+ DeactivateCell();
+ return 0L;
+}
+
+//------------------------------------------------------------------------------
+BOOL OFieldExpressionControl::IsTabAllowed(BOOL /*bForward*/) const
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ return FALSE;
+}
+
+//------------------------------------------------------------------------------
+BOOL OFieldExpressionControl::SaveModified()
+{
+ return SaveModified(true);
+}
+//------------------------------------------------------------------------------
+BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow)
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ sal_Int32 nRow = GetCurRow();
+ if ( nRow != BROWSER_ENDOFSELECTION )
+ {
+ sal_Bool bAppend = sal_False;
+ try
+ {
+ uno::Reference< report::XGroup> xGroup;
+ if ( m_aGroupPositions[nRow] == NO_GROUP )
+ {
+ bAppend = sal_True;
+ String sUndoAction(String(ModuleRes(RID_STR_UNDO_APPEND_GROUP)));
+ m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ xGroup = m_pParent->getGroups()->createGroup();
+ xGroup->setHeaderOn(sal_True);
+
+ uno::Sequence< beans::PropertyValue > aArgs(2);
+ aArgs[0].Name = PROPERTY_GROUP;
+ aArgs[0].Value <<= xGroup;
+ // find position where to insert the new group
+ sal_Int32 nGroupPos = 0;
+ ::std::vector<sal_Int32>::iterator aIter = m_aGroupPositions.begin();
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.begin() + nRow;
+ for(;aIter != aEnd;++aIter)
+ if ( *aIter != NO_GROUP )
+ nGroupPos = *aIter + 1;
+ aArgs[1].Name = PROPERTY_POSITIONY;
+ aArgs[1].Value <<= nGroupPos;
+ m_bIgnoreEvent = true;
+ m_pParent->m_pController->executeChecked(SID_GROUP_APPEND,aArgs);
+ m_bIgnoreEvent = false;
+ OSL_ENSURE(*aIter == NO_GROUP ,"Illegal iterator!");
+ *aIter++ = nGroupPos;
+
+ aEnd = m_aGroupPositions.end();
+ for(;aIter != aEnd;++aIter)
+ if ( *aIter != NO_GROUP )
+ ++*aIter;
+ }
+ else
+ xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]);
+ if ( xGroup.is() )
+ {
+ USHORT nPos = m_pComboCell->GetSelectEntryPos();
+ if ( COMBOBOX_ENTRY_NOTFOUND == nPos )
+ xGroup->setExpression( m_pComboCell->GetText() );
+ else
+ xGroup->setExpression( m_pComboCell->GetEntry(nPos) );
+ ::rptui::adjustSectionName(xGroup,nPos);
+
+ if ( bAppend )
+ m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ }
+
+ if ( Controller() )
+ Controller()->ClearModified();
+ if ( _bAppendRow && GetRowCount() == m_pParent->getGroups()->getCount() )
+ {
+ RowInserted( GetRowCount()-1);
+ m_aGroupPositions.push_back(NO_GROUP);
+ }
+
+ GoToRow(nRow);
+ m_pParent->DisplayData(nRow);
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"OFieldExpressionControl::SaveModified: Exception caught!");
+ }
+ }
+
+ return TRUE;
+}
+//------------------------------------------------------------------------------
+String OFieldExpressionControl::GetCellText( long nRow, USHORT /*nColId*/ ) const
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ String sText;
+ if ( nRow != BROWSER_ENDOFSELECTION && m_aGroupPositions[nRow] != NO_GROUP )
+ {
+ try
+ {
+ uno::Reference< report::XGroup> xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]);
+ sText = xGroup->getExpression();
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught while getting expression value from the group");
+ }
+ } // if ( nRow != BROWSER_ENDOFSELECTION && nRow < m_pParent->getGroups()->getCount() )
+ return sText;
+}
+
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+
+ m_pComboCell->SetText( GetCellText( nRow, nColumnId ) );
+}
+//------------------------------------------------------------------------------
+sal_Bool OFieldExpressionControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol)
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+
+ if (!EditBrowseBox::CursorMoving(nNewRow, nNewCol))
+ return sal_False;
+ m_nDataPos = nNewRow;
+ long nOldDataPos = GetCurRow();
+ InvalidateStatusCell( m_nDataPos );
+ InvalidateStatusCell( nOldDataPos );
+
+ m_pParent->SaveData( nOldDataPos );
+ m_pParent->DisplayData( m_nDataPos );
+ return sal_True;
+}
+//------------------------------------------------------------------------------
+CellController* OFieldExpressionControl::GetController( long /*nRow*/, USHORT /*nColumnId*/ )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ ComboBoxCellController* pCellController = new ComboBoxCellController( m_pComboCell );
+ pCellController->GetComboBox().SetReadOnly(!m_pParent->m_pController->isEditable());
+ return pCellController;
+}
+
+//------------------------------------------------------------------------------
+BOOL OFieldExpressionControl::SeekRow( long _nRow )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ // die Basisklasse braucht den Aufruf, da sie sich dort merkt, welche Zeile gepainted wird
+ EditBrowseBox::SeekRow(_nRow);
+ m_nCurrentPos = _nRow;
+ return TRUE;
+}
+
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ String aText =const_cast< OFieldExpressionControl*>(this)->GetCellText( m_nCurrentPos, nColumnId );
+
+ Point aPos( rRect.TopLeft() );
+ Size aTextSize( GetDataWindow().GetTextHeight(),GetDataWindow().GetTextWidth( aText ));
+
+ if( aPos.X() < rRect.Right() || aPos.X() + aTextSize.Width() > rRect.Right() ||
+ aPos.Y() < rRect.Top() || aPos.Y() + aTextSize.Height() > rRect.Bottom() )
+ rDev.SetClipRegion( rRect );
+
+ rDev.DrawText( aPos, aText );
+
+ if( rDev.IsClipRegion() )
+ rDev.SetClipRegion();
+}
+//------------------------------------------------------------------------------
+EditBrowseBox::RowStatus OFieldExpressionControl::GetRowStatus(long nRow) const
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ if (nRow >= 0 && nRow == m_nDataPos)
+ return EditBrowseBox::CURRENT;
+ if ( nRow != BROWSER_ENDOFSELECTION && nRow < static_cast<long>(m_aGroupPositions.size()) && m_aGroupPositions[nRow] != NO_GROUP )
+ {
+ try
+ {
+ uno::Reference< report::XGroup> xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]);
+ return (xGroup->getHeaderOn() || xGroup->getFooterOn())? EditBrowseBox::HEADERFOOTER : EditBrowseBox::CLEAN;
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception cathced while try to get a group!");
+ }
+ }
+ return EditBrowseBox::CLEAN;
+}
+// XEventListener
+//------------------------------------------------------------------------------
+void SAL_CALL OFieldExpressionControl::disposing(const lang::EventObject& /*e*/) throw( uno::RuntimeException )
+{
+}
+//------------------------------------------------------------------------------
+// XContainerListener
+//------------------------------------------------------------------------------
+void SAL_CALL OFieldExpressionControl::elementInserted(const container::ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ if ( m_bIgnoreEvent )
+ return;
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+ sal_Int32 nGroupPos = 0;
+ if ( evt.Accessor >>= nGroupPos )
+ {
+ if ( nGroupPos >= GetRowCount() )
+ {
+ sal_Int32 nAddedRows = nGroupPos - GetRowCount();
+ RowInserted(nAddedRows);
+ for (sal_Int32 i = 0; i < nAddedRows; ++i)
+ m_aGroupPositions.push_back(NO_GROUP);
+ m_aGroupPositions[nGroupPos] = nGroupPos;
+ }
+ else
+ {
+ ::std::vector<sal_Int32>::iterator aFind = m_aGroupPositions.begin()+ nGroupPos;
+ if ( aFind == m_aGroupPositions.end() )
+ aFind = ::std::find(m_aGroupPositions.begin(),m_aGroupPositions.end(),NO_GROUP);
+
+ if ( aFind != m_aGroupPositions.end() )
+ {
+ if ( *aFind != NO_GROUP )
+ aFind = m_aGroupPositions.insert(aFind,nGroupPos);
+ else
+ *aFind = nGroupPos;
+
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
+ for(++aFind;aFind != aEnd;++aFind)
+ if ( *aFind != NO_GROUP )
+ ++*aFind;
+
+ //::std::vector<sal_Int32>::reverse_iterator aRIter = m_aGroupPositions.rbegin();
+ //::std::vector<sal_Int32>::reverse_iterator aREnd = m_aGroupPositions.rend();
+ //for (; aRIter != aREnd && *aRIter != NO_GROUP; ++aRIter)
+ // continue;
+ //if ( aRIter != aREnd )
+ // m_aGroupPositions.erase(m_aGroupPositions.begin() + (m_aGroupPositions.size() - 1 - (aRIter - m_aGroupPositions.rbegin())));
+ }
+ }
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+void SAL_CALL OFieldExpressionControl::elementReplaced(const container::ContainerEvent& /*evt*/) throw(uno::RuntimeException)
+{
+}
+//------------------------------------------------------------------------------
+void SAL_CALL OFieldExpressionControl::elementRemoved(const container::ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( m_bIgnoreEvent )
+ return;
+
+ sal_Int32 nGroupPos = 0;
+ if ( evt.Accessor >>= nGroupPos )
+ {
+ ::std::vector<sal_Int32>::iterator aFind = ::std::find(m_aGroupPositions.begin(),m_aGroupPositions.end(),nGroupPos);
+ if ( aFind != m_aGroupPositions.end() )
+ {
+ *aFind = NO_GROUP;
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
+ for(++aFind;aFind != aEnd;++aFind)
+ if ( *aFind != NO_GROUP )
+ --*aFind;
+ //PaintCell(*this,GetFieldRect(FIELD_EXPRESSION),FIELD_EXPRESSION);
+ Invalidate();
+ }
+ }
+}
+//------------------------------------------------------------------------------
+sal_Bool OFieldExpressionControl::IsDeleteAllowed( )
+{
+ return !m_pParent->isReadOnly() && GetSelectRowCount() > 0;
+}
+//------------------------------------------------------------------------
+void OFieldExpressionControl::KeyInput( const KeyEvent& rEvt )
+{
+ if (IsDeleteAllowed())
+ {
+ if (rEvt.GetKeyCode().GetCode() == KEY_DELETE && // Delete rows
+ !rEvt.GetKeyCode().IsShift() &&
+ !rEvt.GetKeyCode().IsMod1())
+ {
+ DeleteRows();
+ return;
+ }
+ }
+ EditBrowseBox::KeyInput(rEvt);
+}
+//------------------------------------------------------------------------
+void OFieldExpressionControl::Command(const CommandEvent& rEvt)
+{
+ switch (rEvt.GetCommand())
+ {
+ case COMMAND_CONTEXTMENU:
+ {
+ if (!rEvt.IsMouseEvent())
+ {
+ EditBrowseBox::Command(rEvt);
+ return;
+ }
+
+ USHORT nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X());
+
+ if ( nColId == HANDLE_ID )
+ {
+ //long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y());
+ PopupMenu aContextMenu(ModuleRes(RID_GROUPSROWPOPUPMENU));
+ sal_Bool bEnable = sal_False;
+ long nIndex = FirstSelectedRow();
+ while( nIndex >= 0 && !bEnable )
+ {
+ if ( m_aGroupPositions[nIndex] != NO_GROUP )
+ bEnable = sal_True;
+ nIndex = NextSelectedRow();
+ }
+ //aContextMenu.EnableItem( SID_CUT, IsDeleteAllowed() && bEnable);
+ //aContextMenu.EnableItem( SID_COPY, bEnable);
+ //TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(GetParent()));
+ //aContextMenu.EnableItem( SID_PASTE, aTransferData.HasFormat(SOT_FORMATSTR_ID_RPT_GRPED) );
+ aContextMenu.EnableItem( SID_DELETE, IsDeleteAllowed() && bEnable );
+ switch (aContextMenu.Execute(this, rEvt.GetMousePosPixel()))
+ {
+ case SID_CUT:
+ cut();
+ break;
+ case SID_COPY:
+ copy();
+ break;
+ case SID_PASTE:
+ paste();
+ break;
+
+ case SID_DELETE:
+ if( m_nDeleteEvent )
+ Application::RemoveUserEvent( m_nDeleteEvent );
+ m_nDeleteEvent = Application::PostUserEvent( LINK(this, OFieldExpressionControl, DelayedDelete) );
+ break;
+ default:
+ break;
+ }
+ } // if ( nColId == HANDLE_ID )
+ // run through
+ }
+ default:
+ EditBrowseBox::Command(rEvt);
+ }
+
+}
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::DeleteRows()
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+
+ long nIndex = FirstSelectedRow();
+ bool bFirstTime = true;
+
+ long nOldDataPos = nIndex;
+ uno::Sequence< beans::PropertyValue > aArgs(1);
+ aArgs[0].Name = PROPERTY_GROUP;
+ m_bIgnoreEvent = true;
+ while( nIndex >= 0 )
+ {
+ if ( m_aGroupPositions[nIndex] != NO_GROUP )
+ {
+ if ( bFirstTime )
+ {
+ bFirstTime = false;
+ String sUndoAction(String(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION)));
+ m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+ }
+
+ sal_Int32 nGroupPos = m_aGroupPositions[nIndex];
+ uno::Reference< report::XGroup> xGroup = m_pParent->getGroup(nGroupPos);
+ aArgs[0].Value <<= xGroup;
+ // we use this way to create undo actions
+ m_pParent->m_pController->executeChecked(SID_GROUP_REMOVE,aArgs);
+
+ ::std::vector<sal_Int32>::iterator aFind = ::std::find(m_aGroupPositions.begin(),m_aGroupPositions.end(),nGroupPos);
+ *aFind = NO_GROUP;
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
+ for(++aFind;aFind != aEnd;++aFind)
+ if ( *aFind != NO_GROUP )
+ --*aFind;
+ }
+ nIndex = NextSelectedRow();
+ } // while( nIndex >= 0 )
+
+ if ( !bFirstTime )
+ m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+
+ m_nDataPos = GetCurRow();
+ InvalidateStatusCell( nOldDataPos );
+ InvalidateStatusCell( m_nDataPos );
+ ActivateCell();
+ m_pParent->DisplayData( m_nDataPos );
+ m_bIgnoreEvent = false;
+ Invalidate();
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::cut()
+{
+ copy();
+ DeleteRows();
+}
+
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::copy()
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+ //////////////////////////////////////////////////////////////////////
+ // set to the right row and save it
+ m_pParent->SaveData( m_nDataPos );
+
+ uno::Sequence<uno::Any> aClipboardList = fillSelectedGroups();
+
+ if( aClipboardList.getLength() )
+ {
+ OGroupExchange* pData = new OGroupExchange(aClipboardList);
+ uno::Reference< ::com::sun::star::datatransfer::XTransferable> xRef = pData;
+ pData->CopyToClipboard(GetParent());
+ }
+}
+
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::paste()
+{
+ TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(GetParent()));
+ if(aTransferData.HasFormat(OGroupExchange::getReportGroupId()))
+ {
+ if( m_nPasteEvent )
+ Application::RemoveUserEvent( m_nPasteEvent );
+ m_nPasteEvent = Application::PostUserEvent( LINK(this, OFieldExpressionControl, DelayedPaste) );
+ }
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OFieldExpressionControl, DelayedPaste, void*, )
+{
+ m_nPasteEvent = 0;
+
+ sal_Int32 nPastePosition = GetSelectRowCount() ? FirstSelectedRow() : GetCurRow();
+
+ InsertRows( nPastePosition );
+ SetNoSelection();
+ GoToRow( nPastePosition );
+
+ return 0;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OFieldExpressionControl, DelayedDelete, void*, )
+{
+ m_nDeleteEvent = 0;
+ DeleteRows();
+ return 0;
+}
+//------------------------------------------------------------------------------
+void OFieldExpressionControl::InsertRows( long nRow )
+{
+ DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL);
+
+ sal_Int32 nSize = 0;
+ //////////////////////////////////////////////////////////////////////
+ // get rows from clipboard
+ TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(GetParent()));
+ if(aTransferData.HasFormat(OGroupExchange::getReportGroupId()))
+ {
+ datatransfer::DataFlavor aFlavor;
+ SotExchange::GetFormatDataFlavor(OGroupExchange::getReportGroupId(), aFlavor);
+ uno::Sequence< uno::Any > aGroups;
+
+ if( (aTransferData.GetAny(aFlavor) >>= aGroups) && aGroups.getLength() )
+ {
+ m_bIgnoreEvent = false;
+ String sUndoAction(String(ModuleRes(RID_STR_UNDO_APPEND_GROUP)));
+ m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ uno::Reference<report::XGroups> xGroups = m_pParent->getGroups();
+ sal_Int32 nGroupPos = 0;
+ ::std::vector<sal_Int32>::iterator aIter = m_aGroupPositions.begin();
+ ::std::vector<sal_Int32>::size_type nRowPos = static_cast< ::std::vector<sal_Int32>::size_type >(nRow);
+ if ( nRowPos < m_aGroupPositions.size() )
+ {
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.begin() + nRowPos;
+ for(;aIter != aEnd;++aIter)
+ {
+ if ( *aIter != NO_GROUP )
+ nGroupPos = *aIter;
+ }
+ }
+ for(sal_Int32 i=0;i < aGroups.getLength();++i,++nSize)
+ {
+ uno::Sequence< beans::PropertyValue > aArgs(2);
+ aArgs[0].Name = PROPERTY_GROUP;
+ aArgs[0].Value = aGroups[i];
+ aArgs[1].Name = PROPERTY_POSITIONY;
+ aArgs[1].Value <<= nGroupPos;
+ m_pParent->m_pController->executeChecked(SID_GROUP_APPEND,aArgs);
+
+ ::std::vector<sal_Int32>::iterator aInsertPos = m_aGroupPositions.insert(aIter,nGroupPos);
+ ++aInsertPos;
+ aIter = aInsertPos;
+ ::std::vector<sal_Int32>::iterator aEnd = m_aGroupPositions.end();
+ for(;aInsertPos != aEnd;++aInsertPos)
+ if ( *aInsertPos != NO_GROUP )
+ ++*aInsertPos;
+ }
+ m_pParent->m_pController->getUndoMgr()->LeaveListAction();
+ m_bIgnoreEvent = true;
+ }
+ }
+
+ RowInserted( nRow,nSize,sal_True );
+}
+//------------------------------------------------------------------------------
+
+DBG_NAME( rpt_OGroupsSortingDialog )
+//========================================================================
+// class OGroupsSortingDialog
+//========================================================================
+OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent
+ ,sal_Bool _bReadOnly
+ ,OReportController* _pController)
+ : FloatingWindow( _pParent, ModuleRes(RID_GROUPS_SORTING) )
+ ,OPropertyChangeListener(m_aMutex)
+ ,m_aFL2(this, ModuleRes(FL_SEPARATOR2) )
+ ,m_aMove(this, ModuleRes(FT_MOVELABEL) )
+ ,m_aUp(this, ModuleRes(PB_UP) )
+ ,m_aDown(this, ModuleRes(PB_DOWN) )
+ ,m_aFL3(this, ModuleRes(FL_SEPARATOR3) )
+ ,m_aOrder(this, ModuleRes(FT_ORDER) )
+ ,m_aOrderLst(this, ModuleRes(LST_ORDER) )
+ ,m_aHeader(this, ModuleRes(FT_HEADER) )
+ ,m_aHeaderLst(this, ModuleRes(LST_HEADERLST) )
+ ,m_aFooter(this, ModuleRes(FT_FOOTER) )
+ ,m_aFooterLst(this, ModuleRes(LST_FOOTERLST) )
+ ,m_aGroupOn(this, ModuleRes(FT_GROUPON) )
+ ,m_aGroupOnLst(this, ModuleRes(LST_GROUPONLST) )
+ ,m_aGroupInterval(this, ModuleRes(FT_GROUPINTERVAL) )
+ ,m_aGroupIntervalEd(this, ModuleRes(ED_GROUPINTERVALLST) )
+ ,m_aKeepTogether(this, ModuleRes(FT_KEEPTOGETHER) )
+ ,m_aKeepTogetherLst(this, ModuleRes(LST_KEEPTOGETHERLST) )
+ ,m_aFL(this, ModuleRes(FL_SEPARATOR1) )
+ ,m_aHelpWindow(this, ModuleRes(HELP_FIELD) )
+ ,m_pFieldExpression( new OFieldExpressionControl(this,ModuleRes(WND_CONTROL)))
+ ,m_pController(_pController)
+ ,m_pCurrentGroupListener(NULL)
+ ,m_xGroups(m_pController->getReportDefinition()->getGroups())
+ ,m_bReadOnly(_bReadOnly)
+{
+ DBG_CTOR( rpt_OGroupsSortingDialog,NULL);
+
+
+ Control* pControlsLst[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aKeepTogetherLst, &m_aOrderLst, &m_aGroupIntervalEd};
+ for (size_t i = 0; i < sizeof(pControlsLst)/sizeof(pControlsLst[0]); ++i)
+ {
+ pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot));
+ pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost));
+ pControlsLst[i]->Show(TRUE);
+ } // for (int i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+
+ for (size_t i = 0; i < (sizeof(pControlsLst)/sizeof(pControlsLst[0]))-1; ++i)
+ static_cast<ListBox*>(pControlsLst[i])->SetSelectHdl(LINK(this,OGroupsSortingDialog,LBChangeHdl));
+
+ Control* pControls[] = { &m_aHeader, &m_aFooter, &m_aGroupOn, &m_aGroupInterval, &m_aKeepTogether, &m_aOrder
+ , &m_aMove,&m_aFL2};
+ sal_Int32 nMaxTextWidth = 0;
+ MnemonicGenerator aMnemonicGenerator;
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ aMnemonicGenerator.RegisterMnemonic( pControls[i]->GetText() );
+
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ {
+ pControls[i]->Show(TRUE);
+ String sText = pControls[i]->GetText();
+ if ( aMnemonicGenerator.CreateMnemonic(sText) )
+ pControls[i]->SetText(sText);
+ sal_Int32 nTextWidth = GetTextWidth(sText);
+ nMaxTextWidth = ::std::max<sal_Int32>(nTextWidth,nMaxTextWidth);
+ }
+
+ Size aSpace = LogicToPixel( Size( UNRELATED_CONTROLS, PAGE_HEIGHT), MAP_APPFONT );
+ Size aOutSize(nMaxTextWidth + m_aHeader.GetSizePixel().Width() + 3*aSpace.Width(),aSpace.Height());
+ SetMinOutputSizePixel(aOutSize);
+ SetOutputSizePixel(aOutSize);
+ Resize();
+
+ m_pReportListener = new OPropertyChangeMultiplexer(this,m_pController->getReportDefinition().get());
+ m_pReportListener->addProperty(PROPERTY_COMMAND);
+ m_pReportListener->addProperty(PROPERTY_COMMANDTYPE);
+
+ m_pFieldExpression->lateInit();
+ fillColumns();
+ m_pFieldExpression->Show();
+
+ //m_aHelpWindow.SetReadOnly();
+ m_aHelpWindow.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
+ m_aUp.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl));
+ m_aDown.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl));
+
+ m_pFieldExpression->SetZOrder(&m_aFL2, WINDOW_ZORDER_BEHIND);
+
+ m_aMove.SetZOrder(m_pFieldExpression, WINDOW_ZORDER_BEHIND);
+ m_aUp.SetZOrder(&m_aMove, WINDOW_ZORDER_BEHIND);
+ m_aDown.SetZOrder(&m_aUp, WINDOW_ZORDER_BEHIND);
+ // set Hi contrast bitmaps
+ m_aUp.SetModeImage( ModuleRes(IMG_UP_H),BMP_COLOR_HIGHCONTRAST);
+ m_aDown.SetModeImage( ModuleRes(IMG_DOWN_H),BMP_COLOR_HIGHCONTRAST);
+
+ checkButtons(0);
+
+ FreeResource();
+}
+
+//------------------------------------------------------------------------
+OGroupsSortingDialog::~OGroupsSortingDialog()
+{
+ DBG_DTOR( rpt_OGroupsSortingDialog,NULL);
+ delete m_pFieldExpression;
+ m_xColumns.clear();
+ m_pReportListener->dispose();
+ if ( m_pCurrentGroupListener.is() )
+ m_pCurrentGroupListener->dispose();
+}
+// -----------------------------------------------------------------------------
+sal_Bool OGroupsSortingDialog::isReadOnly( ) const
+{
+ return m_bReadOnly;
+}
+//------------------------------------------------------------------------------
+void OGroupsSortingDialog::UpdateData( )
+{
+ m_pFieldExpression->Invalidate();
+ long nCurRow = m_pFieldExpression->GetCurRow();
+ m_pFieldExpression->DeactivateCell();
+ m_pFieldExpression->ActivateCell(nCurRow, m_pFieldExpression->GetCurColumnId());
+ DisplayData(nCurRow);
+}
+//------------------------------------------------------------------------------
+void OGroupsSortingDialog::DisplayData( sal_Int32 _nRow )
+{
+ DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL);
+ sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(_nRow);
+ sal_Bool bEmpty = nGroupPos == NO_GROUP;
+ m_aHeaderLst.Enable(!bEmpty);
+ m_aFooterLst.Enable(!bEmpty);
+ m_aGroupOnLst.Enable(!bEmpty);
+ m_aGroupIntervalEd.Enable(!bEmpty);
+ m_aKeepTogetherLst.Enable(!bEmpty);
+ m_aOrderLst.Enable(!bEmpty);
+
+ m_aFL3.Enable(!bEmpty);
+ m_aHeader.Enable(!bEmpty);
+ m_aFooter.Enable(!bEmpty);
+ m_aGroupOn.Enable(!bEmpty);
+ m_aGroupInterval.Enable(!bEmpty);
+ m_aKeepTogether.Enable(!bEmpty);
+ m_aOrder.Enable(!bEmpty);
+
+ checkButtons(_nRow);
+
+ if ( m_pCurrentGroupListener.is() )
+ m_pCurrentGroupListener->dispose();
+ m_pCurrentGroupListener = NULL;
+ if ( !bEmpty && nGroupPos != NO_GROUP )
+ {
+ uno::Reference< report::XGroup> xGroup = getGroup(nGroupPos);
+
+ m_pCurrentGroupListener = new OPropertyChangeMultiplexer(this,xGroup.get());
+ m_pCurrentGroupListener->addProperty(PROPERTY_HEADERON);
+ m_pCurrentGroupListener->addProperty(PROPERTY_FOOTERON);
+
+ displayGroup(xGroup);
+ }
+}
+//------------------------------------------------------------------------------
+void OGroupsSortingDialog::SaveData( sal_Int32 _nRow)
+{
+ DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL);
+ sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(_nRow);
+ if ( nGroupPos == NO_GROUP )
+ return;
+
+ uno::Reference< report::XGroup> xGroup = getGroup(nGroupPos);
+ if ( m_aHeaderLst.GetSavedValue() != m_aHeaderLst.GetSelectEntryPos() )
+ xGroup->setHeaderOn( m_aHeaderLst.GetSelectEntryPos() == 0 );
+ if ( m_aFooterLst.GetSavedValue() != m_aFooterLst.GetSelectEntryPos() )
+ xGroup->setFooterOn( m_aFooterLst.GetSelectEntryPos() == 0 );
+ if ( m_aKeepTogetherLst.GetSavedValue() != m_aKeepTogetherLst.GetSelectEntryPos() )
+ xGroup->setKeepTogether( m_aKeepTogetherLst.GetSelectEntryPos() );
+ if ( m_aGroupOnLst.GetSavedValue() != m_aGroupOnLst.GetSelectEntryPos() )
+ {
+ sal_Int16 nGroupOn = static_cast<sal_Int16>(reinterpret_cast<sal_Int32>(m_aGroupOnLst.GetEntryData(m_aGroupOnLst.GetSelectEntryPos())));
+ xGroup->setGroupOn( nGroupOn );
+ }
+ if ( m_aGroupIntervalEd.GetSavedValue().ToInt32() != m_aGroupIntervalEd.GetValue() )
+ {
+ xGroup->setGroupInterval( static_cast<sal_Int32>(m_aGroupIntervalEd.GetValue()) );
+ m_aGroupIntervalEd.SaveValue();
+ }
+ if ( m_aOrderLst.GetSavedValue() != m_aOrderLst.GetSelectEntryPos() )
+ xGroup->setSortAscending( m_aOrderLst.GetSelectEntryPos() == 0 );
+
+ ListBox* pControls[] = { &m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aKeepTogetherLst,&m_aOrderLst};
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ pControls[i]->SaveValue();
+}
+
+// -----------------------------------------------------------------------------
+sal_Int32 OGroupsSortingDialog::getColumnDataType(const ::rtl::OUString& _sColumnName)
+{
+ sal_Int32 nDataType = sdbc::DataType::VARCHAR;
+ try
+ {
+ if ( m_xColumns.is() && m_xColumns->hasByName(_sColumnName) )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(m_xColumns->getByName(_sColumnName),uno::UNO_QUERY);
+ if ( xColumn.is() )
+ xColumn->getPropertyValue(PROPERTY_TYPE) >>= nDataType;
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Eception caught while getting the type of a column");
+ }
+
+ return nDataType;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl )
+{
+ if ( m_pFieldExpression && m_pFieldExpression->getExpressionControl() )
+ {
+ Control* pControls[] = { m_pFieldExpression->getExpressionControl(),&m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aGroupIntervalEd,&m_aKeepTogetherLst,&m_aOrderLst};
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ {
+ if ( pControl == pControls[i] )
+ {
+ ListBox* pListBox = dynamic_cast< ListBox* >( pControl );
+ if ( pListBox )
+ pListBox->SaveValue();
+ NumericField* pNumericField = dynamic_cast< NumericField* >( pControl );
+ if ( pNumericField )
+ pNumericField->SaveValue();
+ showHelpText(static_cast<USHORT>(i+STR_RPT_HELP_FIELD));
+ break;
+ }
+ }
+ }
+ return 0L;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK(OGroupsSortingDialog, OnControlFocusLost, Control*, pControl )
+{
+ if ( m_pFieldExpression && pControl == &m_aGroupIntervalEd )
+ {
+ if ( m_aGroupIntervalEd.IsModified() )
+ SaveData(m_pFieldExpression->GetCurRow());
+ }
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OGroupsSortingDialog, ClickHdl, ImageButton*, _pButton )
+{
+ DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL);
+ if ( m_pFieldExpression )
+ {
+ long nIndex = m_pFieldExpression->GetCurrRow();
+ sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(nIndex);
+ uno::Sequence<uno::Any> aClipboardList;
+ if ( nIndex >= 0 && nGroupPos != NO_GROUP )
+ {
+ aClipboardList.realloc(1);
+ aClipboardList[0] = m_xGroups->getByIndex(nGroupPos);
+ }
+ if ( _pButton == &m_aUp )
+ --nIndex;
+ else
+ ++nIndex;
+
+ if ( nIndex >= 0 && aClipboardList.getLength() )
+ {
+ m_pFieldExpression->SetNoSelection();
+ m_pFieldExpression->moveGroups(aClipboardList,nIndex,sal_False);
+ m_pFieldExpression->DeactivateCell();
+ m_pFieldExpression->GoToRow(nIndex);
+ //long nCurRow = m_pFieldExpression->GetCurRow();
+ m_pFieldExpression->ActivateCell(nIndex, m_pFieldExpression->GetCurColumnId());
+ DisplayData(nIndex);
+ }
+ }
+ return 1L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OGroupsSortingDialog, LBChangeHdl, ListBox*, pListBox )
+{
+ DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL);
+ if ( pListBox->GetSavedValue() != pListBox->GetSelectEntryPos() )
+ {
+ sal_Int32 nRow = m_pFieldExpression->GetCurRow();
+ sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(nRow);
+ if ( pListBox != &m_aHeaderLst && pListBox != &m_aFooterLst)
+ {
+ if ( pListBox && pListBox->GetSavedValue() != pListBox->GetSelectEntryPos() )
+ SaveData(nRow);
+ }
+ else if ( nGroupPos != NO_GROUP )
+ {
+ uno::Reference< report::XGroup> xGroup = getGroup(nGroupPos);
+ uno::Sequence< beans::PropertyValue > aArgs(2);
+ aArgs[1].Name = PROPERTY_GROUP;
+ aArgs[1].Value <<= xGroup;
+
+ if ( &m_aHeaderLst == pListBox )
+ aArgs[0].Name = PROPERTY_HEADERON;
+ else
+ aArgs[0].Name = PROPERTY_FOOTERON;
+
+ aArgs[0].Value <<= pListBox->GetSelectEntryPos() == 0;
+ m_pController->executeChecked(&m_aHeaderLst == pListBox ? SID_GROUPHEADER : SID_GROUPFOOTER,aArgs);
+ if ( m_pFieldExpression )
+ m_pFieldExpression->InvalidateHandleColumn();
+ }
+ }
+ return 1L;
+}
+// -----------------------------------------------------------------------------
+void OGroupsSortingDialog::showHelpText(USHORT _nResId)
+{
+ m_aHelpWindow.SetText(String(ModuleRes(_nResId)));
+}
+// -----------------------------------------------------------------------------
+void OGroupsSortingDialog::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ displayGroup(xGroup);
+ else
+ fillColumns();
+}
+// -----------------------------------------------------------------------------
+void OGroupsSortingDialog::fillColumns()
+{
+ m_xColumns.clear();
+ uno::Reference< report::XReportDefinition> xReport = m_pController->getReportDefinition();
+ if ( xReport->getCommand().getLength() )
+ m_xColumns = dbtools::getFieldsByCommandDescriptor(m_pController->getConnection(),xReport->getCommandType(),xReport->getCommand(),m_xHoldAlive);
+ m_pFieldExpression->fillColumns(m_xColumns);
+}
+// -----------------------------------------------------------------------------
+void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _xGroup)
+{
+ m_aHeaderLst.SelectEntryPos(_xGroup->getHeaderOn() ? 0 : 1 );
+ m_aFooterLst.SelectEntryPos(_xGroup->getFooterOn() ? 0 : 1 );
+ sal_Int32 nDataType = getColumnDataType(_xGroup->getExpression());
+
+ // first clear whole group on list
+ while(m_aGroupOnLst.GetEntryCount() > 1 )
+ {
+ m_aGroupOnLst.RemoveEntry(1);
+ }
+
+ switch(nDataType)
+ {
+ case sdbc::DataType::LONGVARCHAR:
+ case sdbc::DataType::VARCHAR:
+ case sdbc::DataType::CHAR:
+ m_aGroupOnLst.InsertEntry(String(ModuleRes(STR_RPT_PREFIXCHARS)));
+ m_aGroupOnLst.SetEntryData(1,reinterpret_cast<void*>(report::GroupOn::PREFIX_CHARACTERS));
+ break;
+ case sdbc::DataType::DATE:
+ case sdbc::DataType::TIME:
+ case sdbc::DataType::TIMESTAMP:
+ {
+ USHORT nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE };
+ for (USHORT i = 0; i < sizeof(nIds)/sizeof(nIds[0]); ++i)
+ {
+ m_aGroupOnLst.InsertEntry(String(ModuleRes(nIds[i])));
+ m_aGroupOnLst.SetEntryData(i+1,reinterpret_cast<void*>(i+2));
+ }
+ }
+ break;
+ default:
+ m_aGroupOnLst.InsertEntry(String(ModuleRes(STR_RPT_INTERVAL)));
+ m_aGroupOnLst.SetEntryData(1,reinterpret_cast<void*>(report::GroupOn::INTERVAL));
+ break;
+ } // switch(nDataType)
+ USHORT nPos = 0;
+ switch(_xGroup->getGroupOn())
+ {
+ case report::GroupOn::DEFAULT:
+ nPos = 0;
+ break;
+ case report::GroupOn::PREFIX_CHARACTERS:
+ nPos = 1;
+ break;
+ case report::GroupOn::YEAR:
+ nPos = 1;
+ break;
+ case report::GroupOn::QUARTAL:
+ nPos = 2;
+ break;
+ case report::GroupOn::MONTH:
+ nPos = 3;
+ break;
+ case report::GroupOn::WEEK:
+ nPos = 4;
+ break;
+ case report::GroupOn::DAY:
+ nPos = 5;
+ break;
+ case report::GroupOn::HOUR:
+ nPos = 6;
+ break;
+ case report::GroupOn::MINUTE:
+ nPos = 7;
+ break;
+ case report::GroupOn::INTERVAL:
+ nPos = 1;
+ break;
+ default:
+ nPos = 0;
+ }
+ m_aGroupOnLst.SelectEntryPos(nPos);
+ m_aGroupIntervalEd.SetText(String::CreateFromInt32(_xGroup->getGroupInterval()));
+ m_aGroupIntervalEd.SaveValue();
+ m_aKeepTogetherLst.SelectEntryPos(_xGroup->getKeepTogether());
+ m_aOrderLst.SelectEntryPos(_xGroup->getSortAscending() ? 0 : 1);
+
+ ListBox* pControls[] = { &m_aHeaderLst,&m_aFooterLst,&m_aGroupOnLst,&m_aKeepTogetherLst,&m_aOrderLst};
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ pControls[i]->SaveValue();
+
+ ListBox* pControlsLst2[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aKeepTogetherLst,&m_aOrderLst};
+ sal_Bool bReadOnly = !m_pController->isEditable();
+ for (size_t i = 0; i < sizeof(pControlsLst2)/sizeof(pControlsLst2[0]); ++i)
+ pControlsLst2[i]->SetReadOnly(bReadOnly);
+ m_aGroupIntervalEd.SetReadOnly(bReadOnly);
+}
+//------------------------------------------------------------------------------
+void OGroupsSortingDialog::Resize()
+{
+ Window::Resize();
+ Size aTotalOutputSize = GetOutputSizePixel();
+ Size aSpace = LogicToPixel( Size( UNRELATED_CONTROLS, UNRELATED_CONTROLS ), MAP_APPFONT );
+ m_pFieldExpression->SetSizePixel(Size(aTotalOutputSize.Width() - 2*aSpace.Width(),m_pFieldExpression->GetSizePixel().Height()));
+
+ Control* pControlsLst[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aGroupIntervalEd,&m_aKeepTogetherLst,&m_aOrderLst};
+ Control* pControls[] = { &m_aHeader, &m_aFooter, &m_aGroupOn, &m_aGroupInterval, &m_aKeepTogether, &m_aOrder};
+ sal_Int32 nMaxTextWidth = 0;
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ {
+ nMaxTextWidth = ::std::max<sal_Int32>(static_cast<sal_Int32>(GetTextWidth(pControls[i]->GetText())),nMaxTextWidth);
+ } // for (int i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+
+ // aTotalOutputSize.Width() - m_aHeaderLst.GetSizePixel().Width() - 3*aSpace.Width()
+ for (size_t i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+ {
+ pControls[i]->SetSizePixel(Size(nMaxTextWidth,pControls[i]->GetSizePixel().Height()));
+ Point aPos = pControls[i]->GetPosPixel();
+ aPos.X() += nMaxTextWidth + aSpace.Width();
+ aPos.Y() = pControlsLst[i]->GetPosPixel().Y();
+
+ pControlsLst[i]->SetPosSizePixel(aPos,Size(aTotalOutputSize.Width() - aPos.X() - aSpace.Width(),pControlsLst[i]->GetSizePixel().Height()));
+ } // for (int i = 0; i < sizeof(pControls)/sizeof(pControls[0]); ++i)
+
+ m_aFL.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL.GetSizePixel().Height()));
+ m_aFL2.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL2.GetSizePixel().Height()));
+ m_aFL3.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL3.GetSizePixel().Height()));
+
+ sal_Int32 nPos = aTotalOutputSize.Width() - aSpace.Width() - m_aUp.GetSizePixel().Width();
+ m_aDown.SetPosPixel(Point(nPos,m_aDown.GetPosPixel().Y()));
+ nPos -= (m_aUp.GetSizePixel().Width() + LogicToPixel( Size( RELATED_CONTROLS, 0 ), MAP_APPFONT ).Width());
+ m_aUp.SetPosPixel(Point(nPos,m_aUp.GetPosPixel().Y()));
+ Point aHelpPos = m_aHelpWindow.GetPosPixel();
+ m_aHelpWindow.SetSizePixel(Size(aTotalOutputSize.Width() - aHelpPos.X(),aTotalOutputSize.Height() - aHelpPos.Y()));
+}
+//------------------------------------------------------------------------------
+void OGroupsSortingDialog::checkButtons(sal_Int32 _nRow)
+{
+ sal_Int32 nGroupCount = m_xGroups->getCount();
+ sal_Bool bEnable = nGroupCount > 1;
+ m_aUp.Enable(bEnable && _nRow > 0 );
+ m_aDown.Enable(bEnable && _nRow < (m_pFieldExpression->GetRowCount()-1) );
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.hrc b/reportdesign/source/ui/dlg/GroupsSorting.hrc
new file mode 100644
index 000000000000..0e913764ac46
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.hrc
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupsSorting.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_GROUPSSORTING_HRC
+#define RPTUI_GROUPSSORTING_HRC
+
+#define FT_HEADER (1)
+#define LST_HEADERLST (2)
+#define FT_FOOTER (3)
+#define LST_FOOTERLST (4)
+#define FT_GROUPON (5)
+#define LST_GROUPONLST (6)
+#define FT_GROUPINTERVAL (7)
+#define ED_GROUPINTERVALLST (8)
+#define FT_KEEPTOGETHER (9)
+#define LST_KEEPTOGETHERLST (10)
+#define PB_OK (11)
+#define PB_CANCEL (12)
+#define PB_HELP (13)
+#define WND_CONTROL (14)
+#define HELP_FIELD (15)
+#define FT_ORDER (16)
+#define LST_ORDER (17)
+#define FL_SEPARATOR1 (18)
+#define FT_MOVELABEL (19)
+#define PB_UP (20)
+#define PB_DOWN (21)
+#define FL_SEPARATOR2 (22)
+#define FL_SEPARATOR3 (23)
+#define IMG_UP_H (24)
+#define IMG_DOWN_H (25)
+
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_HEIGHT 8
+#define FIXEDTEXT_WIDTH 60
+#define RELATED_CONTROLS 4
+#define UNRELATED_CONTROLS 7
+#define EDIT_HEIGHT 12
+#define BUTTON_HEIGHT 14
+#define BUTTON_WIDTH 50
+#define BROWSER_HEIGHT 75
+#define PAGE_WIDTH 120
+#define PAGE_HEIGHT ( 13*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 11*FIXEDTEXT_HEIGHT )
+#define LISTBOX_WIDTH PAGE_WIDTH - 4*UNRELATED_CONTROLS - FIXEDTEXT_WIDTH
+
+#endif // RPTUI_GROUPSSORTING_HRC
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.src b/reportdesign/source/ui/dlg/GroupsSorting.src
new file mode 100644
index 000000000000..19517fd30898
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.src
@@ -0,0 +1,402 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupsSorting.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "GroupsSorting.hrc"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+
+FloatingWindow RID_GROUPS_SORTING
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( PAGE_WIDTH , PAGE_HEIGHT ) ;
+ Text [ de ] = "Sortierung und Gruppierung" ;
+ Text [ en-US ] = "Sorting and Grouping" ;
+ HelpId = HID_GROUPSSORTING_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Sizeable = TRUE;
+
+ FixedLine FL_SEPARATOR2
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Gruppen";
+ Text [ en-US ] = "Groups";
+ };
+
+ Control WND_CONTROL
+ {
+ Pos = MAP_APPFONT( UNRELATED_CONTROLS, 2*UNRELATED_CONTROLS );
+ Size = MAP_APPFONT( PAGE_WIDTH - 2*UNRELATED_CONTROLS, BROWSER_HEIGHT );
+ HelpId = HID_GROUPSBRW ;
+ Border = TRUE;
+ TabStop = TRUE;
+ };
+
+ FixedText FT_MOVELABEL
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 3*UNRELATED_CONTROLS + BROWSER_HEIGHT ) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Gruppe bewegen" ;
+ Text [ en-US ] = "Move group" ;
+ };
+
+ ImageButton PB_UP
+ {
+ Pos = MAP_APPFONT ( PAGE_WIDTH - UNRELATED_CONTROLS - 2*14 - RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT -1 ) ;
+ Size = MAP_APPFONT ( 14 , 14 ) ;
+ TabStop = TRUE;
+ Symbol = IMAGEBUTTON_ARROW_UP ;
+ };
+
+ ImageButton PB_DOWN
+ {
+ Pos = MAP_APPFONT ( PAGE_WIDTH - UNRELATED_CONTROLS - 14 - RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ;
+ Size = MAP_APPFONT ( 14 , 14 ) ;
+ TabStop = TRUE;
+ Symbol = IMAGEBUTTON_ARROW_DOWN ;
+ };
+
+ FixedLine FL_SEPARATOR3
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 3*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Eigenschaften";
+ Text [ en-US ] = "Properties";
+ };
+
+ FixedText FT_ORDER
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 4*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + FIXEDTEXT_HEIGHT ) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ de ] = "Sortierung" ;
+ Text [ en-US ] = "Sorting" ;
+
+ };
+ ListBox LST_ORDER
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 4*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + FIXEDTEXT_HEIGHT - 1 );
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ Hide = TRUE;
+ CurPos = 0 ;
+ StringList [ de ] =
+ {
+ < "Aufsteigend" ; 0 ; > ;
+ < "Absteigend" ; 1 ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Ascending" ; 0 ; > ;
+ < "Descending" ; 1 ; > ;
+ };
+
+ };
+ FixedText FT_HEADER
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 5*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 2*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ en-US ] = "Group Header" ;
+
+ };
+ ListBox LST_HEADERLST
+ {
+ Border = TRUE;
+ Hide = TRUE;
+ Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 5*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 2*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ CurPos = 1 ;
+ StringList [ de ] =
+ {
+ < "Vorhanden" ; Default ; > ;
+ < "Nicht vorhanden" ; Default ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Present" ; Default ; > ;
+ < "Not present" ; Default ; > ;
+ };
+ };
+ FixedText FT_FOOTER
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 6*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 3*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ en-US ] = "Group Footer" ;
+
+ };
+ ListBox LST_FOOTERLST
+ {
+ Border = TRUE;
+ Hide = TRUE;
+ Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 6*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 3*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ CurPos = 1 ;
+ StringList [ de ] =
+ {
+ < "Vorhanden" ; Default ; > ;
+ < "Nicht vorhanden" ; Default ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Present" ; Default ; > ;
+ < "Not present" ; Default ; > ;
+ };
+ };
+ FixedText FT_GROUPON
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 7*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 4*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ en-US ] = "Group On" ;
+
+ };
+ ListBox LST_GROUPONLST
+ {
+ Border = TRUE;
+ Hide = TRUE;
+ Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 7*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 4*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ CurPos = 0 ;
+ StringList [ de ] =
+ {
+ < "Jeder Wert" ; Default ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Each Value" ; Default ; > ;
+ };
+ };
+ FixedText FT_GROUPINTERVAL
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 8*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 5*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ de ] = "Group Interval" ;
+ Text [ en-US ] = "Group Interval" ;
+
+ };
+ NumericField ED_GROUPINTERVALLST
+ {
+ Border = TRUE;
+ Hide = TRUE;
+ Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 8*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 5*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, EDIT_HEIGHT );
+ TabStop = TRUE;
+ };
+
+ FixedText FT_KEEPTOGETHER
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 9*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 6*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ;
+ Hide = TRUE;
+ Text [ en-US ] = "Keep Together" ;
+ };
+ ListBox LST_KEEPTOGETHERLST
+ {
+ Border = TRUE;
+ Hide = TRUE;
+ Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 9*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 6*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ CurPos = 0 ;
+ StringList [ de ] =
+ {
+ < "Nein" ; 0 ; > ;
+ < "Ganze Gruppe" ; 1 ; > ;
+ < "Mit erstem Detailbereich" ; 2 ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "No" ; 0 ; > ;
+ < "Whole Group" ; 1 ; > ;
+ < "With First Detail" ; 2 ; > ;
+ };
+ };
+
+ FixedLine FL_SEPARATOR1
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 10*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 7*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Hilfe";
+ Text [ en-US ] = "Help";
+ };
+
+ FixedText HELP_FIELD
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 12*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 7*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT( PAGE_WIDTH - 2*UNRELATED_CONTROLS, 4*FIXEDTEXT_HEIGHT);
+ WordBreak = TRUE;
+ };
+
+ Image IMG_UP_H
+ {
+ ImageBitmap = Bitmap { File = "arrow_move_up_hc" ; };
+ };
+ Image IMG_DOWN_H
+ {
+ ImageBitmap = Bitmap { File = "arrow_move_down_hc" ; };
+ };
+};
+
+String STR_RPT_EXPRESSION
+{
+ Text [ de ] = "Feld/Ausdruck" ;
+ Text [ en-US ] = "Field/Expression" ;
+};
+String STR_RPT_SORTING
+{
+ Text [ de ] = "Reihenfolge" ;
+ Text [ en-US ] = "Sort Order" ;
+};
+String STR_RPT_PREFIXCHARS
+{
+ Text [ en-US ] = "Prefix Characters" ;
+};
+String STR_RPT_YEAR
+{
+ Text [ de ] = "Jahr" ;
+ Text [ en-US ] = "Year" ;
+};
+String STR_RPT_QUARTER
+{
+ Text [ de ] = "Quartal" ;
+ Text [ en-US ] = "Quarter" ;
+};
+String STR_RPT_MONTH
+{
+ Text [ de ] = "Monat" ;
+ Text [ en-US ] = "Month" ;
+};
+String STR_RPT_WEEK
+{
+ Text [ de ] = "Woche" ;
+ Text [ en-US ] = "Week" ;
+};
+String STR_RPT_DAY
+{
+ Text [ de ] = "Tag" ;
+ Text [ en-US ] = "Day" ;
+};
+String STR_RPT_HOUR
+{
+ Text [ de ] = "Stunde" ;
+ Text [ en-US ] = "Hour" ;
+};
+String STR_RPT_MINUTE
+{
+ Text [ de ] = "Minute" ;
+ Text [ en-US ] = "Minute" ;
+};
+String STR_RPT_INTERVAL
+{
+ Text [ de ] = "Interval" ;
+ Text [ en-US ] = "Interval" ;
+};
+
+String STR_RPT_HELP_FIELD
+{
+ Text [ en-US ] = "Select a field or type an expression to sort or group on." ;
+};
+
+String STR_RPT_HELP_HEADER
+{
+ Text [ en-US ] = "Display a header for this group?" ;
+};
+
+String STR_RPT_HELP_FOOTER
+{
+ Text [ en-US ] = "Display a footer for this group?" ;
+};
+String STR_RPT_HELP_GROUPON
+{
+ Text [ en-US ] = "Select the value or range of values that starts a new group." ;
+};
+String STR_RPT_HELP_INTERVAL
+{
+ Text [ en-US ] = "Interval or number of characters to group on." ;
+};
+String STR_RPT_HELP_KEEP
+{
+ Text [ en-US ] = "Keep group together on one page?" ;
+};
+String STR_RPT_HELP_SORT
+{
+ Text [ en-US ] = "Select ascending or descending sort order. Ascending means from A to Z or 0 to 9" ;
+};
+
+
+Menu RID_GROUPSROWPOPUPMENU
+{
+ ItemList =
+ {
+/*
+ MenuItem
+ {
+ ITEM_EDIT_CUT
+ };
+ MenuItem
+ {
+ ITEM_EDIT_COPY
+ };
+ MenuItem
+ {
+ ITEM_EDIT_PASTE
+ };
+*/
+ MenuItem
+ {
+ ITEM_EDIT_DELETE
+ };
+ };
+};
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
new file mode 100644
index 000000000000..c0d39c33158b
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -0,0 +1,1004 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Navigator.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "Navigator.hxx"
+
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef RPTUI_UNDO_HXX
+#include "Undo.hxx"
+#endif
+#include "reportformula.hxx"
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
+#include <com/sun/star/container/XContainerListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#include <com/sun/star/report/XFixedText.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/report/XImageControl.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef _COMPHELPER_CONTAINERMULTIPLEXER_HXX_
+#include <comphelper/containermultiplexer.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef INCLUDED_COMPHELPER_SELECTION_MULTIPLEX_HXX
+#include "comphelper/SelectionMultiplex.hxx"
+#endif
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtreebx.hxx>
+#endif
+#include <svtools/solar.hrc>
+#ifndef INCLUDED_REPORT_VISTITOR_HXX
+#include "ReportVisitor.hxx"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+
+#include <boost/bind.hpp>
+#include <memory>
+#include <algorithm>
+
+#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2)
+#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3)
+#define DROP_ACTION_TIMER_INITIAL_TICKS 10
+#define DROP_ACTION_TIMER_SCROLL_TICKS 3
+#define DROP_ACTION_TIMER_TICK_BASE 10
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace svt;
+using namespace ::comphelper;
+
+USHORT lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement)
+{
+ USHORT nId = 0;
+ uno::Reference< report::XFixedLine> xFixedLine(_xElement,uno::UNO_QUERY);
+ if ( uno::Reference< report::XFixedText>(_xElement,uno::UNO_QUERY).is() )
+ nId = SID_FM_FIXEDTEXT;
+ else if ( xFixedLine.is() )
+ nId = xFixedLine->getOrientation() ? SID_INSERT_VFIXEDLINE : SID_INSERT_HFIXEDLINE;
+ else if ( uno::Reference< report::XFormattedField>(_xElement,uno::UNO_QUERY).is() )
+ nId = SID_FM_EDIT;
+ else if ( uno::Reference< report::XImageControl>(_xElement,uno::UNO_QUERY).is() )
+ nId = SID_FM_IMAGECONTROL;
+ else if ( uno::Reference< report::XShape>(_xElement,uno::UNO_QUERY).is() )
+ nId = SID_DRAWTBX_CS_BASIC;
+ return nId;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString lcl_getName(const uno::Reference< report::XReportComponent>& _xElement)
+{
+ OSL_ENSURE(_xElement.is(),"Found report element which is NULL!");
+ ::rtl::OUStringBuffer sName = _xElement->getName();
+ uno::Reference< report::XFixedText> xFixedText(_xElement,uno::UNO_QUERY);
+ uno::Reference< report::XReportControlModel> xReportModel(_xElement,uno::UNO_QUERY);
+ if ( xFixedText.is() )
+ {
+ sName.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : ")));
+ sName.append(xFixedText->getLabel());
+ }
+ else if ( xReportModel->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) )
+ {
+ ReportFormula aFormula( xReportModel->getDataField() );
+ if ( aFormula.isValid() )
+ {
+ sName.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : ")));
+ sName.append( aFormula.getUndecoratedContent() );
+ }
+ }
+ return sName.makeStringAndClear();
+}
+// -----------------------------------------------------------------------------
+
+class NavigatorTree : public ::cppu::BaseMutex
+ , public SvTreeListBox
+ , public reportdesign::ITraverseReport
+ , public comphelper::OSelectionChangeListener
+ , public ::comphelper::OPropertyChangeListener
+{
+ class UserData;
+ friend class UserData;
+ class UserData : public ::cppu::BaseMutex
+ ,public ::comphelper::OPropertyChangeListener
+ ,public ::comphelper::OContainerListener
+ {
+ uno::Reference< uno::XInterface > m_xContent;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pListener;
+ ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
+ NavigatorTree* m_pTree;
+ public:
+ UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent);
+ ~UserData();
+
+ inline uno::Reference< uno::XInterface > getContent() const { return m_xContent; }
+ inline void setContent(const uno::Reference< uno::XInterface >& _xContent) { m_xContent = _xContent; }
+ protected:
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException);
+
+ // OContainerListener
+ virtual void _elementInserted( const container::ContainerEvent& _rEvent ) throw(uno::RuntimeException);
+ virtual void _elementRemoved( const container::ContainerEvent& _Event ) throw(uno::RuntimeException);
+ virtual void _elementReplaced( const container::ContainerEvent& _rEvent ) throw(uno::RuntimeException);
+ virtual void _disposing(const lang::EventObject& _rSource) throw( uno::RuntimeException);
+ };
+
+ enum DROP_ACTION { DA_SCROLLUP, DA_SCROLLDOWN, DA_EXPANDNODE };
+ AutoTimer m_aDropActionTimer;
+ Timer m_aSynchronizeTimer;
+ ImageList m_aNavigatorImages;
+ ImageList m_aNavigatorImagesHC;
+ Point m_aTimerTriggered; // die Position, an der der DropTimer angeschaltet wurde
+ DROP_ACTION m_aDropActionType;
+ OReportController* m_pController;
+ SvLBoxEntry* m_pMasterReport;
+ SvLBoxEntry* m_pDragedEntry;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
+ ::rtl::Reference< comphelper::OSelectionChangeMultiplexer> m_pSelectionListener;
+ unsigned short m_nTimerCounter;
+
+ SvLBoxEntry* insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData);
+ void traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition = LIST_APPEND);
+ void traverseFunctions(const uno::Reference< report::XFunctions>& _xFunctions,SvLBoxEntry* _pParent);
+
+ NavigatorTree(const NavigatorTree&);
+ void operator =(const NavigatorTree&);
+protected:
+ virtual void Command( const CommandEvent& rEvt );
+ // DragSourceHelper overridables
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+ // DropTargetHelper overridables
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt );
+
+ // OSelectionChangeListener
+ virtual void _selectionChanged( const lang::EventObject& aEvent ) throw (uno::RuntimeException);
+ virtual void _disposing(const lang::EventObject& _rSource) throw( uno::RuntimeException);
+
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException);
+
+ // OContainerListener Helper
+ void _elementInserted( const container::ContainerEvent& _rEvent );
+ void _elementRemoved( const container::ContainerEvent& _Event );
+ void _elementReplaced( const container::ContainerEvent& _rEvent );
+
+public:
+ NavigatorTree(Window* pParent,OReportController* _pController );
+ virtual ~NavigatorTree();
+
+ DECL_LINK(OnEntrySelDesel, NavigatorTree*);
+ DECL_LINK( OnDropActionTimer, void* );
+
+ // ITraverseReport
+ virtual void traverseReport(const uno::Reference< report::XReportDefinition>& _xReport);
+ virtual void traverseReportFunctions(const uno::Reference< report::XFunctions>& _xFunctions);
+ virtual void traverseReportHeader(const uno::Reference< report::XSection>& _xSection);
+ virtual void traverseReportFooter(const uno::Reference< report::XSection>& _xSection);
+ virtual void traversePageHeader(const uno::Reference< report::XSection>& _xSection);
+ virtual void traversePageFooter(const uno::Reference< report::XSection>& _xSection);
+
+ virtual void traverseGroups(const uno::Reference< report::XGroups>& _xGroups);
+ virtual void traverseGroup(const uno::Reference< report::XGroup>& _xGroup);
+ virtual void traverseGroupFunctions(const uno::Reference< report::XFunctions>& _xFunctions);
+ virtual void traverseGroupHeader(const uno::Reference< report::XSection>& _xSection);
+ virtual void traverseGroupFooter(const uno::Reference< report::XSection>& _xSection);
+
+ virtual void traverseDetail(const uno::Reference< report::XSection>& _xSection);
+
+ SvLBoxEntry* find(const uno::Reference< uno::XInterface >& _xContent);
+ void removeEntry(SvLBoxEntry* _pEntry,bool _bRemove = true);
+private:
+ using SvTreeListBox::ExecuteDrop;
+};
+
+// -----------------------------------------------------------------------------
+NavigatorTree::NavigatorTree( Window* pParent,OReportController* _pController )
+ :SvTreeListBox( pParent, WB_HASBUTTONS|WB_HASLINES|WB_BORDER|WB_HSCROLL|WB_HASBUTTONSATROOT )
+ ,comphelper::OSelectionChangeListener(m_aMutex)
+ ,OPropertyChangeListener(m_aMutex)
+ ,m_aTimerTriggered(-1,-1)
+ ,m_aDropActionType( DA_SCROLLUP )
+ ,m_pController(_pController)
+ ,m_pMasterReport(NULL)
+ ,m_pDragedEntry(NULL)
+ ,m_nTimerCounter( DROP_ACTION_TIMER_INITIAL_TICKS )
+{
+ m_pReportListener = new OPropertyChangeMultiplexer(this,m_pController->getReportDefinition().get());
+ m_pReportListener->addProperty(PROPERTY_PAGEHEADERON);
+ m_pReportListener->addProperty(PROPERTY_PAGEFOOTERON);
+ m_pReportListener->addProperty(PROPERTY_REPORTHEADERON);
+ m_pReportListener->addProperty(PROPERTY_REPORTFOOTERON);
+
+ m_pSelectionListener = new OSelectionChangeMultiplexer(this,m_pController);
+
+ SetHelpId( HID_REPORT_NAVIGATOR_TREE );
+
+ m_aNavigatorImages = ImageList( ModuleRes( RID_SVXIMGLIST_RPTEXPL ) );
+ m_aNavigatorImagesHC = ImageList( ModuleRes( RID_SVXIMGLIST_RPTEXPL_HC ) );
+
+ SetNodeBitmaps(
+ m_aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ),
+ m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ),
+ BMP_COLOR_NORMAL
+ );
+ SetNodeBitmaps(
+ m_aNavigatorImagesHC.GetImage( RID_SVXIMG_COLLAPSEDNODE ),
+ m_aNavigatorImagesHC.GetImage( RID_SVXIMG_EXPANDEDNODE ),
+ BMP_COLOR_HIGHCONTRAST
+ );
+
+ SetDragDropMode(0xFFFF);
+ EnableInplaceEditing( sal_False );
+ SetSelectionMode(MULTIPLE_SELECTION);
+ Clear();
+
+ m_aDropActionTimer.SetTimeoutHdl(LINK(this, NavigatorTree, OnDropActionTimer));
+ SetSelectHdl(LINK(this, NavigatorTree, OnEntrySelDesel));
+ SetDeselectHdl(LINK(this, NavigatorTree, OnEntrySelDesel));
+}
+// -----------------------------------------------------------------------------
+NavigatorTree::~NavigatorTree()
+{
+ SvLBoxEntry* pCurrent = First();
+ while ( pCurrent )
+ {
+ delete static_cast<UserData*>(pCurrent->GetUserData());
+ pCurrent = Next(pCurrent);
+ }
+ m_pReportListener->dispose();
+ m_pSelectionListener->dispose();
+}
+//------------------------------------------------------------------------------
+void NavigatorTree::Command( const CommandEvent& rEvt )
+{
+ sal_Bool bHandled = sal_False;
+ switch( rEvt.GetCommand() )
+ {
+ case COMMAND_CONTEXTMENU:
+ {
+ // die Stelle, an der geklickt wurde
+ SvLBoxEntry* ptClickedOn = NULL;
+ ::Point aWhere;
+ if (rEvt.IsMouseEvent())
+ {
+ aWhere = rEvt.GetMousePosPixel();
+ ptClickedOn = GetEntry(aWhere);
+ if (ptClickedOn == NULL)
+ break;
+ if ( !IsSelected(ptClickedOn) )
+ {
+ SelectAll(sal_False);
+ Select(ptClickedOn, sal_True);
+ SetCurEntry(ptClickedOn);
+ }
+ }
+ else
+ {
+ ptClickedOn = GetCurEntry();
+ if ( !ptClickedOn )
+ break;
+ aWhere = GetEntryPosition(ptClickedOn);
+ }
+ UserData* pData = static_cast<UserData*>(ptClickedOn->GetUserData());
+ uno::Reference< report::XFunctionsSupplier> xSupplier(pData->getContent(),uno::UNO_QUERY);
+ uno::Reference< report::XFunctions> xFunctions(pData->getContent(),uno::UNO_QUERY);
+ uno::Reference< report::XGroup> xGroup(pData->getContent(),uno::UNO_QUERY);
+ sal_Bool bDeleteAllowed = m_pController->isEditable() && (xGroup.is() ||
+ uno::Reference< report::XFunction>(pData->getContent(),uno::UNO_QUERY).is());
+ PopupMenu aContextMenu( ModuleRes( RID_MENU_NAVIGATOR ) );
+
+ USHORT nCount = aContextMenu.GetItemCount();
+ for (USHORT i = 0; i < nCount; ++i)
+ {
+ if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i))
+ {
+ USHORT nId = aContextMenu.GetItemId(i);
+
+ aContextMenu.CheckItem(nId,m_pController->isCommandChecked(nId));
+ sal_Bool bEnabled = m_pController->isCommandEnabled(nId);
+ if ( nId == SID_RPT_NEW_FUNCTION )
+ aContextMenu.EnableItem(nId,m_pController->isEditable() && (xSupplier.is() || xFunctions.is()) );
+ // special condition, check for function and group
+ else if ( nId == SID_DELETE )
+ aContextMenu.EnableItem(SID_DELETE,bDeleteAllowed);
+ else
+ aContextMenu.EnableItem(nId,bEnabled);
+ }
+ } // for (USHORT i = 0; i < nCount; ++i)
+ USHORT nId = aContextMenu.Execute(this, aWhere);
+ if ( nId )
+ {
+ uno::Sequence< beans::PropertyValue> aArgs;
+ if ( nId == SID_RPT_NEW_FUNCTION )
+ {
+ aArgs.realloc(1);
+ aArgs[0].Value <<= (xFunctions.is() ? xFunctions : xSupplier->getFunctions());
+ }
+ else if ( nId == SID_DELETE )
+ {
+ if ( xGroup.is() )
+ nId = SID_GROUP_REMOVE;
+ aArgs.realloc(1);
+ aArgs[0].Name = PROPERTY_GROUP;
+ aArgs[0].Value <<= pData->getContent();
+ }
+ m_pController->executeUnChecked(nId,aArgs);
+ }
+
+ bHandled = sal_True;
+ } break;
+ }
+
+ if (!bHandled)
+ SvTreeListBox::Command( rEvt );
+}
+// -----------------------------------------------------------------------------
+sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt )
+{
+ sal_Int8 nDropOption = DND_ACTION_NONE;
+ ::Point aDropPos = _rEvt.maPosPixel;
+ if (_rEvt.mbLeaving)
+ {
+ if (m_aDropActionTimer.IsActive())
+ m_aDropActionTimer.Stop();
+ }
+ else
+ {
+ bool bNeedTrigger = false;
+ // auf dem ersten Eintrag ?
+ if ((aDropPos.Y() >= 0) && (aDropPos.Y() < GetEntryHeight()))
+ {
+ m_aDropActionType = DA_SCROLLUP;
+ bNeedTrigger = true;
+ }
+ else if ((aDropPos.Y() < GetSizePixel().Height()) && (aDropPos.Y() >= GetSizePixel().Height() - GetEntryHeight()))
+ {
+ m_aDropActionType = DA_SCROLLDOWN;
+ bNeedTrigger = true;
+ }
+ else
+ {
+ SvLBoxEntry* pDropppedOn = GetEntry(aDropPos);
+ if (pDropppedOn && (GetChildCount(pDropppedOn) > 0) && !IsExpanded(pDropppedOn))
+ {
+ m_aDropActionType = DA_EXPANDNODE;
+ bNeedTrigger = true;
+ }
+ }
+
+ if (bNeedTrigger && (m_aTimerTriggered != aDropPos))
+ {
+ // neu anfangen zu zaehlen
+ m_nTimerCounter = DROP_ACTION_TIMER_INITIAL_TICKS;
+ // die Pos merken, da ich auch AcceptDrops bekomme, wenn sich die Maus gar nicht bewegt hat
+ m_aTimerTriggered = aDropPos;
+ // und den Timer los
+ if (!m_aDropActionTimer.IsActive()) // gibt es den Timer schon ?
+ {
+ m_aDropActionTimer.SetTimeout(DROP_ACTION_TIMER_TICK_BASE);
+ m_aDropActionTimer.Start();
+ }
+ }
+ else if (!bNeedTrigger)
+ m_aDropActionTimer.Stop();
+ }
+
+ return nDropOption;
+}
+// -------------------------------------------------------------------------
+sal_Int8 NavigatorTree::ExecuteDrop( const ExecuteDropEvent& /*_rEvt*/ )
+{
+ // _rEvt.mnAction;
+ return DND_ACTION_NONE;
+}
+// -------------------------------------------------------------------------
+void NavigatorTree::StartDrag( sal_Int8 /*_nAction*/, const Point& _rPosPixel )
+{
+ m_pDragedEntry = GetEntry(_rPosPixel);
+ if ( m_pDragedEntry )
+ {
+ EndSelection();
+ }
+}
+//------------------------------------------------------------------------
+IMPL_LINK( NavigatorTree, OnDropActionTimer, void*, EMPTYARG )
+{
+ if (--m_nTimerCounter > 0)
+ return 0L;
+
+ switch ( m_aDropActionType )
+ {
+ case DA_EXPANDNODE:
+ {
+ SvLBoxEntry* pToExpand = GetEntry(m_aTimerTriggered);
+ if (pToExpand && (GetChildCount(pToExpand) > 0) && !IsExpanded(pToExpand))
+ // tja, eigentlich muesste ich noch testen, ob die Node nicht schon expandiert ist, aber ich
+ // habe dazu weder in den Basisklassen noch im Model eine Methode gefunden ...
+ // aber ich denke, die BK sollte es auch so vertragen
+ Expand(pToExpand);
+
+ // nach dem Expand habe ich im Gegensatz zum Scrollen natuerlich nix mehr zu tun
+ m_aDropActionTimer.Stop();
+ }
+ break;
+
+ case DA_SCROLLUP :
+ ScrollOutputArea( 1 );
+ m_nTimerCounter = DROP_ACTION_TIMER_SCROLL_TICKS;
+ break;
+
+ case DA_SCROLLDOWN :
+ ScrollOutputArea( -1 );
+ m_nTimerCounter = DROP_ACTION_TIMER_SCROLL_TICKS;
+ break;
+
+ }
+
+ return 0L;
+}
+
+// -----------------------------------------------------------------------------
+IMPL_LINK(NavigatorTree, OnEntrySelDesel, NavigatorTree*, /*pThis*/)
+{
+ if ( !m_pSelectionListener->locked() )
+ {
+ m_pSelectionListener->lock();
+ SvLBoxEntry* pEntry = GetCurEntry();
+ uno::Any aSelection;
+ if ( IsSelected(pEntry) )
+ aSelection <<= static_cast<UserData*>(pEntry->GetUserData())->getContent();
+ m_pController->select(aSelection);
+ m_pSelectionListener->unlock();
+ }
+
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) throw (uno::RuntimeException)
+{
+ m_pSelectionListener->lock();
+ uno::Reference< view::XSelectionSupplier> xSelectionSupplier(aEvent.Source,uno::UNO_QUERY);
+ uno::Any aSec = xSelectionSupplier->getSelection();
+ uno::Sequence< uno::Reference< report::XReportComponent > > aSelection;
+ aSec >>= aSelection;
+ if ( !aSelection.getLength() )
+ {
+ uno::Reference< uno::XInterface> xSelection(aSec,uno::UNO_QUERY);
+ SvLBoxEntry* pEntry = find(xSelection);
+ if ( pEntry && !IsSelected(pEntry) )
+ {
+ Select(pEntry, sal_True);
+ SetCurEntry(pEntry);
+ }
+ else if ( !pEntry )
+ SelectAll(FALSE,FALSE);
+ }
+ else
+ {
+ const uno::Reference< report::XReportComponent >* pIter = aSelection.getConstArray();
+ const uno::Reference< report::XReportComponent >* pEnd = pIter + aSelection.getLength();
+ for (; pIter != pEnd; ++pIter)
+ {
+ SvLBoxEntry* pEntry = find(*pIter);
+ if ( pEntry && !IsSelected(pEntry) )
+ {
+ Select(pEntry, sal_True);
+ SetCurEntry(pEntry);
+ }
+ }
+ }
+ m_pSelectionListener->unlock();
+}
+// -----------------------------------------------------------------------------
+SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData)
+{
+ SvLBoxEntry* pEntry = NULL;
+ if ( _nImageId )
+ {
+ const Image aImage( m_aNavigatorImages.GetImage( _nImageId ) );
+ pEntry = InsertEntry(_sName,aImage,aImage,_pParent,FALSE,_nPosition,_pData);
+ if ( pEntry )
+ {
+ const Image aImageHC( m_aNavigatorImagesHC.GetImage( _nImageId ) );
+ SetExpandedEntryBmp( pEntry, aImageHC, BMP_COLOR_HIGHCONTRAST );
+ SetCollapsedEntryBmp( pEntry, aImageHC, BMP_COLOR_HIGHCONTRAST );
+ }
+ }
+ else
+ pEntry = InsertEntry(_sName,_pParent,FALSE,_nPosition,_pData);
+ return pEntry;
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition)
+{
+ SvLBoxEntry* pSection = insertEntry(_xSection->getName(),_pParent,_nImageId,_nPosition,new UserData(this,_xSection));
+ const sal_Int32 nCount = _xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference< report::XReportComponent> xElement(_xSection->getByIndex(i),uno::UNO_QUERY);
+ OSL_ENSURE(xElement.is(),"Found report element which is NULL!");
+ insertEntry(lcl_getName(xElement),pSection,lcl_getImageId(xElement),LIST_APPEND,new UserData(this,xElement));
+ uno::Reference< report::XReportDefinition> xSubReport(xElement,uno::UNO_QUERY);
+ if ( xSubReport.is() )
+ {
+ m_pMasterReport = find(_xSection->getReportDefinition());
+ reportdesign::OReportVisitor aSubVisitor(this);
+ aSubVisitor.start(xSubReport);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseFunctions(const uno::Reference< report::XFunctions>& _xFunctions,SvLBoxEntry* _pParent)
+{
+ SvLBoxEntry* pFunctions = insertEntry(String(ModuleRes(RID_STR_FUNCTIONS)),_pParent,SID_RPT_NEW_FUNCTION,LIST_APPEND,new UserData(this,_xFunctions));
+ const sal_Int32 nCount = _xFunctions->getCount();
+ for (sal_Int32 i = 0; i< nCount; ++i)
+ {
+ uno::Reference< report::XFunction> xElement(_xFunctions->getByIndex(i),uno::UNO_QUERY);
+ insertEntry(xElement->getName(),pFunctions,SID_RPT_NEW_FUNCTION,LIST_APPEND,new UserData(this,xElement));
+ }
+}
+// -----------------------------------------------------------------------------
+SvLBoxEntry* NavigatorTree::find(const uno::Reference< uno::XInterface >& _xContent)
+{
+ SvLBoxEntry* pRet = NULL;
+ if ( _xContent.is() )
+ {
+ SvLBoxEntry* pCurrent = First();
+ while ( pCurrent )
+ {
+ UserData* pData = static_cast<UserData*>(pCurrent->GetUserData());
+ OSL_ENSURE(pData,"No UserData set an entry!");
+ if ( pData->getContent() == _xContent )
+ {
+ pRet = pCurrent;
+ break;
+ }
+ pCurrent = Next(pCurrent);
+ }
+ }
+ return pRet;
+}
+// -----------------------------------------------------------------------------
+// ITraverseReport
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseReport(const uno::Reference< report::XReportDefinition>& _xReport)
+{
+ insertEntry(_xReport->getName(),m_pMasterReport,SID_SELECT_REPORT,LIST_APPEND,new UserData(this,_xReport));
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseReportFunctions(const uno::Reference< report::XFunctions>& _xFunctions)
+{
+ SvLBoxEntry* pReport = find(_xFunctions->getParent());
+ traverseFunctions(_xFunctions,pReport);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseReportHeader(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pReport = find(_xSection->getReportDefinition());
+ traverseSection(_xSection,pReport,SID_REPORTHEADERFOOTER);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseReportFooter(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pReport = find(_xSection->getReportDefinition());
+ traverseSection(_xSection,pReport,SID_REPORTHEADERFOOTER);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traversePageHeader(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pReport = find(_xSection->getReportDefinition());
+ traverseSection(_xSection,pReport,SID_PAGEHEADERFOOTER);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traversePageFooter(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pReport = find(_xSection->getReportDefinition());
+ traverseSection(_xSection,pReport,SID_PAGEHEADERFOOTER);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseGroups(const uno::Reference< report::XGroups>& _xGroups)
+{
+ SvLBoxEntry* pReport = find(_xGroups->getReportDefinition());
+ insertEntry(String(ModuleRes(RID_STR_GROUPS)),pReport,SID_SORTINGANDGROUPING,LIST_APPEND,new UserData(this,_xGroups));
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseGroup(const uno::Reference< report::XGroup>& _xGroup)
+{
+ uno::Reference< report::XGroups> xGroups(_xGroup->getParent(),uno::UNO_QUERY);
+ SvLBoxEntry* pGroups = find(xGroups);
+ OSL_ENSURE(pGroups,"No Groups inserted so far. Why!");
+ insertEntry(_xGroup->getExpression(),pGroups,SID_GROUP,rptui::getPositionInIndexAccess(xGroups.get(),_xGroup),new UserData(this,_xGroup));
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseGroupFunctions(const uno::Reference< report::XFunctions>& _xFunctions)
+{
+ SvLBoxEntry* pGroup = find(_xFunctions->getParent());
+ traverseFunctions(_xFunctions,pGroup);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseGroupHeader(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pGroup = find(_xSection->getGroup());
+ OSL_ENSURE(pGroup,"No group found");
+ traverseSection(_xSection,pGroup,SID_GROUPHEADER,1);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseGroupFooter(const uno::Reference< report::XSection>& _xSection)
+{
+ SvLBoxEntry* pGroup = find(_xSection->getGroup());
+ OSL_ENSURE(pGroup,"No group found");
+ traverseSection(_xSection,pGroup,SID_GROUPFOOTER);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::traverseDetail(const uno::Reference< report::XSection>& _xSection)
+{
+ uno::Reference< report::XReportDefinition> xReport = _xSection->getReportDefinition();
+ SvLBoxEntry* pParent = find(xReport);
+ traverseSection(_xSection,pParent,SID_ICON_DETAIL);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ uno::Reference< report::XReportDefinition> xReport(_rEvent.Source,uno::UNO_QUERY);
+ if ( xReport.is() )
+ {
+ sal_Bool bEnabled = sal_False;
+ _rEvent.NewValue >>= bEnabled;
+ if ( bEnabled )
+ {
+ SvLBoxEntry* pParent = find(xReport);
+ if ( _rEvent.PropertyName == PROPERTY_REPORTHEADERON )
+ {
+ ULONG nPos = xReport->getReportHeaderOn() ? 2 : 1;
+ traverseSection(xReport->getReportHeader(),pParent,SID_REPORTHEADERFOOTER,nPos);
+ }
+ else if ( _rEvent.PropertyName == PROPERTY_PAGEHEADERON )
+ {
+ traverseSection(xReport->getPageHeader(),pParent, SID_PAGEHEADERFOOTER,1);
+ }
+ else if ( _rEvent.PropertyName == PROPERTY_PAGEFOOTERON )
+ traverseSection(xReport->getPageFooter(),pParent, SID_PAGEHEADERFOOTER);
+ else if ( _rEvent.PropertyName == PROPERTY_REPORTFOOTERON )
+ {
+ ULONG nPos = xReport->getPageFooterOn() ? (GetLevelChildCount(pParent) - 1) : LIST_APPEND;
+ traverseSection(xReport->getReportFooter(),pParent,SID_REPORTHEADERFOOTER,nPos);
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_elementInserted( const container::ContainerEvent& _rEvent )
+{
+ SvLBoxEntry* pEntry = find(_rEvent.Source);
+ uno::Reference<beans::XPropertySet> xProp(_rEvent.Element,uno::UNO_QUERY_THROW);
+ ::rtl::OUString sName;
+ uno::Reference< beans::XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
+ if ( xInfo.is() )
+ {
+ if ( xInfo->hasPropertyByName(PROPERTY_NAME) )
+ xProp->getPropertyValue(PROPERTY_NAME) >>= sName;
+ else if ( xInfo->hasPropertyByName(PROPERTY_EXPRESSION) )
+ xProp->getPropertyValue(PROPERTY_EXPRESSION) >>= sName;
+ }
+ uno::Reference< report::XGroup> xGroup(xProp,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ reportdesign::OReportVisitor aSubVisitor(this);
+ aSubVisitor.start(xGroup);
+ }
+ else
+ {
+ uno::Reference< report::XReportComponent> xElement(xProp,uno::UNO_QUERY);
+ if ( xElement.is() )
+ sName = lcl_getName(xElement);
+ insertEntry(sName,pEntry,lcl_getImageId(xElement),LIST_APPEND,new UserData(this,xProp));
+ }
+ if ( !IsExpanded(pEntry) )
+ Expand(pEntry);
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_elementRemoved( const container::ContainerEvent& _rEvent )
+{
+ uno::Reference<beans::XPropertySet> xProp(_rEvent.Element,uno::UNO_QUERY);
+ SvLBoxEntry* pEntry = find(xProp);
+ OSL_ENSURE(pEntry,"NavigatorTree::_elementRemoved: No Entry found!");
+
+ if ( pEntry )
+ {
+ SvLBoxEntry* pParent = GetParent(pEntry);
+ removeEntry(pEntry);
+ PaintEntry(pParent);
+ }
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_elementReplaced( const container::ContainerEvent& _rEvent )
+{
+ uno::Reference<beans::XPropertySet> xProp(_rEvent.ReplacedElement,uno::UNO_QUERY);
+ SvLBoxEntry* pEntry = find(xProp);
+ if ( pEntry )
+ {
+ UserData* pData = static_cast<UserData*>(pEntry->GetUserData());
+ xProp.set(_rEvent.Element,uno::UNO_QUERY);
+ pData->setContent(xProp);
+ ::rtl::OUString sName;
+ xProp->getPropertyValue(PROPERTY_NAME) >>= sName;
+ SetEntryText(pEntry,sName);
+ }
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::_disposing(const lang::EventObject& _rSource)throw( uno::RuntimeException)
+{
+ removeEntry(find(_rSource.Source));
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::removeEntry(SvLBoxEntry* _pEntry,bool _bRemove)
+{
+ if ( _pEntry )
+ {
+ SvLBoxEntry* pChild = FirstChild(_pEntry);
+ while( pChild )
+ {
+ removeEntry(pChild,false);
+ pChild = NextSibling(pChild);
+ }
+ delete static_cast<UserData*>(_pEntry->GetUserData());
+ if ( _bRemove )
+ GetModel()->Remove(_pEntry);
+ }
+}
+// -----------------------------------------------------------------------------
+NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent)
+ : OPropertyChangeListener(m_aMutex)
+ , OContainerListener(m_aMutex)
+ , m_xContent(_xContent)
+ , m_pTree(_pTree)
+{
+ uno::Reference<beans::XPropertySet> xProp(m_xContent,uno::UNO_QUERY);
+ if ( xProp.is() )
+ {
+ uno::Reference< beans::XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
+ if ( xInfo.is() )
+ {
+ m_pListener = new ::comphelper::OPropertyChangeMultiplexer(this,xProp);
+ if ( xInfo->hasPropertyByName(PROPERTY_NAME) )
+ m_pListener->addProperty(PROPERTY_NAME);
+ else if ( xInfo->hasPropertyByName(PROPERTY_EXPRESSION) )
+ m_pListener->addProperty(PROPERTY_EXPRESSION);
+ if ( xInfo->hasPropertyByName(PROPERTY_HEADERON) )
+ m_pListener->addProperty(PROPERTY_HEADERON);
+ if ( xInfo->hasPropertyByName(PROPERTY_FOOTERON) )
+ m_pListener->addProperty(PROPERTY_FOOTERON);
+ }
+ }
+ uno::Reference< container::XContainer> xContainer(m_xContent,uno::UNO_QUERY);
+ if ( xContainer.is() )
+ {
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
+}
+// -----------------------------------------------------------------------------
+NavigatorTree::UserData::~UserData()
+{
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+ if ( m_pListener.is() )
+ m_pListener->dispose();
+}
+// -----------------------------------------------------------------------------
+// OPropertyChangeListener
+void NavigatorTree::UserData::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ SvLBoxEntry* pEntry = m_pTree->find(_rEvent.Source);
+ OSL_ENSURE(pEntry,"No entry could be found! Why not!");
+ const bool bFooterOn = (PROPERTY_FOOTERON == _rEvent.PropertyName);
+ if ( bFooterOn || PROPERTY_HEADERON == _rEvent.PropertyName )
+ {
+ sal_Int32 nPos = 1;
+ uno::Reference< report::XGroup> xGroup(_rEvent.Source,uno::UNO_QUERY);
+ ::std::mem_fun_t< sal_Bool,OGroupHelper> pIsOn = ::std::mem_fun(&OGroupHelper::getHeaderOn);
+ ::std::mem_fun_t< uno::Reference<report::XSection> ,OGroupHelper> pMemFunSection = ::std::mem_fun(&OGroupHelper::getHeader);
+ if ( bFooterOn )
+ {
+ pIsOn = ::std::mem_fun(&OGroupHelper::getFooterOn);
+ pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter);
+ nPos = m_pTree->GetChildCount(pEntry) - 1;
+ }
+
+ OGroupHelper aGroupHelper(xGroup);
+ if ( pIsOn(&aGroupHelper) )
+ {
+ if ( bFooterOn )
+ ++nPos;
+ m_pTree->traverseSection(pMemFunSection(&aGroupHelper),pEntry,bFooterOn ? SID_GROUPFOOTER : SID_GROUPHEADER,nPos);
+ }
+ //else
+ // m_pTree->removeEntry(m_pTree->GetEntry(pEntry,nPos));
+ }
+ else if ( PROPERTY_NAME == _rEvent.PropertyName || PROPERTY_EXPRESSION == _rEvent.PropertyName)
+ {
+ ::rtl::OUString sNewName;
+ _rEvent.NewValue >>= sNewName;
+ m_pTree->SetEntryText(pEntry,sNewName);
+ }
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::UserData::_elementInserted( const container::ContainerEvent& _rEvent ) throw(uno::RuntimeException)
+{
+ m_pTree->_elementInserted( _rEvent );
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::UserData::_elementRemoved( const container::ContainerEvent& _rEvent ) throw(uno::RuntimeException)
+{
+ m_pTree->_elementRemoved( _rEvent );
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::UserData::_elementReplaced( const container::ContainerEvent& _rEvent ) throw(uno::RuntimeException)
+{
+ m_pTree->_elementReplaced( _rEvent );
+}
+// -----------------------------------------------------------------------------
+void NavigatorTree::UserData::_disposing(const lang::EventObject& _rSource) throw( uno::RuntimeException)
+{
+ m_pTree->_disposing( _rSource );
+}
+// -----------------------------------------------------------------------------
+// class ONavigatorImpl
+// -----------------------------------------------------------------------------
+class ONavigatorImpl
+{
+ ONavigatorImpl(const ONavigatorImpl&);
+ void operator =(const ONavigatorImpl&);
+public:
+ ONavigatorImpl(OReportController* _pController,ONavigator* _pParent);
+ virtual ~ONavigatorImpl();
+
+ uno::Reference< report::XReportDefinition> m_xReport;
+ ::rptui::OReportController* m_pController;
+ ::std::auto_ptr<NavigatorTree> m_pNavigatorTree;
+};
+
+ONavigatorImpl::ONavigatorImpl(OReportController* _pController,ONavigator* _pParent)
+ :m_xReport(_pController->getReportDefinition())
+ ,m_pController(_pController)
+ ,m_pNavigatorTree(new NavigatorTree(_pParent,_pController))
+{
+ reportdesign::OReportVisitor aVisitor(m_pNavigatorTree.get());
+ aVisitor.start(m_xReport);
+ m_pNavigatorTree->Expand(m_pNavigatorTree->find(m_xReport));
+}
+//------------------------------------------------------------------------
+ONavigatorImpl::~ONavigatorImpl()
+{
+}
+// -----------------------------------------------------------------------------
+DBG_NAME( rpt_ONavigator )
+const long STD_WIN_SIZE_X = 210;
+const long STD_WIN_SIZE_Y = 280;
+const long LISTBOX_BORDER = 2;
+//========================================================================
+// class ONavigator
+//========================================================================
+ONavigator::ONavigator( Window* _pParent
+ ,OReportController* _pController)
+ : FloatingWindow( _pParent, ModuleRes(RID_NAVIGATOR) )
+{
+ DBG_CTOR( rpt_ONavigator,NULL);
+
+ m_pImpl.reset(new ONavigatorImpl(_pController,this));
+
+ //Size aSpace = LogicToPixel( Size( 7, 120), MAP_APPFONT );
+ //Size aOutSize(nMaxTextWidth + m_aHeader.GetSizePixel().Width() + 3*aSpace.Width(),aSpace.Height());
+ //SetMinOutputSizePixel(aOutSize);
+ //SetOutputSizePixel(aOutSize);
+ FreeResource();
+ m_pImpl->m_pNavigatorTree->Show();
+ SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
+ Show();
+
+}
+// -----------------------------------------------------------------------------
+
+//------------------------------------------------------------------------
+ONavigator::~ONavigator()
+{
+ DBG_DTOR( rpt_ONavigator,NULL);
+}
+//------------------------------------------------------------------------------
+void ONavigator::Resize()
+{
+ FloatingWindow::Resize();
+
+ Point aPos(GetPosPixel());
+ Size aSize( GetOutputSizePixel() );
+
+ //////////////////////////////////////////////////////////////////////
+
+ // Groesse der form::ListBox anpassen
+ Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER );
+ Size aLBSize( aSize );
+ aLBSize.Width() -= (2*LISTBOX_BORDER);
+ aLBSize.Height() -= (2*LISTBOX_BORDER);
+
+ m_pImpl->m_pNavigatorTree->SetPosSizePixel( aLBPos, aLBSize );
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // rptui
+// =============================================================================
+
diff --git a/reportdesign/source/ui/dlg/Navigator.src b/reportdesign/source/ui/dlg/Navigator.src
new file mode 100644
index 000000000000..f2184c717049
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Navigator.src
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Navigator.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#include "rptui_slotid.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#include <svtools/solar.hrc>
+
+#define RID_SVXIMG_COLLAPSEDNODE (RID_FORMS_START + 2)
+#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3)
+#define RID_SVXIMG_FORMS (RID_FORMS_START +13)
+
+FloatingWindow RID_NAVIGATOR
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 200 , 250 ) ;
+ Text [ de ] = "Berichtsnavigator" ;
+ Text [ en-US ] = "Report navigator" ;
+ HelpId = HID_NAVIGATOR_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Sizeable = TRUE;
+
+ Control 1
+ {
+ Pos = MAP_APPFONT( 0, 0 );
+ Size = MAP_APPFONT( 200, 250 );
+ Border = TRUE;
+ TabStop = TRUE;
+ };
+};
+#define NAVIGATOR_IMAGEIDS \
+ IdList = \
+ { \
+ SID_SELECT_REPORT;\
+ SID_FM_FIXEDTEXT ; \
+ SID_INSERT_HFIXEDLINE ; \
+ SID_INSERT_VFIXEDLINE;\
+ SID_FM_IMAGECONTROL ; \
+ SID_FM_EDIT ; \
+ SID_RPT_NEW_FUNCTION;\
+ SID_REPORTHEADERFOOTER;\
+ SID_PAGEHEADERFOOTER;\
+ SID_GROUPHEADER;\
+ SID_GROUPFOOTER;\
+ RID_SVXIMG_COLLAPSEDNODE ; \
+ RID_SVXIMG_EXPANDEDNODE ; \
+ SID_SORTINGANDGROUPING;\
+ SID_DRAWTBX_CS_BASIC;\
+ SID_GROUP;\
+ SID_ICON_DETAIL;\
+ }; \
+ IdCount = 17
+
+ImageList RID_SVXIMGLIST_RPTEXPL
+{
+ Prefix = "sx";
+ MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; };
+ NAVIGATOR_IMAGEIDS;
+};
+
+ImageList RID_SVXIMGLIST_RPTEXPL_HC
+{
+ Prefix = "sxh";
+ MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; };
+ NAVIGATOR_IMAGEIDS;
+};
+
+String RID_STR_FUNCTIONS
+{
+ Text [ de ] = "Funktionen" ;
+ Text [ en-US ] = "Functions" ;
+};
+String RID_STR_GROUPS
+{
+ Text [ de ] = "Gruppen" ;
+ Text [ en-US ] = "Groups" ;
+};
+Menu RID_MENU_NAVIGATOR
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_SORTINGANDGROUPING;
+ HelpId = SID_SORTINGANDGROUPING ;
+ Command = ".uno:DbSortingAndGrouping";
+ Text [ de ] = "Sortierung und Gruppierung..." ;
+ Text [ en-US ] = "Sorting and Grouping...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_PAGEHEADERFOOTER;
+ HelpId = SID_PAGEHEADERFOOTER ;
+ Command = ".uno:PageHeaderFooter";
+ Checkable = TRUE;
+ Text [ de ] = "Seitenkopf, -fuß..." ;
+ Text [ en-US ] = "Page Header/Footer...";
+ };
+ MenuItem
+ {
+ Identifier = SID_REPORTHEADERFOOTER;
+ HelpId = SID_REPORTHEADERFOOTER ;
+ Command = ".uno:ReportHeaderFooter";
+ Checkable = TRUE;
+ Text [ de ] = "Berichtskopf, -fuß..." ;
+ Text [ en-US ] = "Report Header/Footer...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_RPT_NEW_FUNCTION;
+ HelpId = SID_RPT_NEW_FUNCTION;
+ Command = ".uno:NewFunction";
+ Text [ de ] = "Neue Funktion" ;
+ Text [ en-US ] = "New Function";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_SHOW_PROPERTYBROWSER;
+ HelpId = SID_SHOW_PROPERTYBROWSER ;
+ Command = ".uno:FormProperties";
+ Text [ de ] = "Eigenschaften..." ;
+ Text [ en-US ] = "Properties...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_EDIT_DELETE
+ };
+/*
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_EDIT_CUT
+ };
+ MenuItem
+ {
+ ITEM_EDIT_COPY
+ };
+ MenuItem
+ {
+ ITEM_EDIT_PASTE
+ };
+*/
+ };
+};
+
diff --git a/reportdesign/source/ui/dlg/PageNumber.cxx b/reportdesign/source/ui/dlg/PageNumber.cxx
new file mode 100644
index 000000000000..d7df1adda39e
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.cxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageNumber.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_PAGENUMBER_HXX
+#include "PageNumber.hxx"
+#endif
+#ifndef RPTUI_PAGENUMBER_HRC
+#include "PageNumber.hrc"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_DBU_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFIXEDTEXT_HPP_
+#include <com/sun/star/report/XFixedText.hpp>
+#endif
+#include <algorithm>
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace ::comphelper;
+
+DBG_NAME( rpt_OPageNumberDialog )
+//========================================================================
+// class OPageNumberDialog
+//========================================================================
+OPageNumberDialog::OPageNumberDialog( Window* _pParent
+ ,const uno::Reference< report::XReportDefinition >& _xHoldAlive
+ ,OReportController* _pController)
+ : ModalDialog( _pParent, ModuleRes(RID_PAGENUMBERS) )
+ ,m_aFormat(this, ModuleRes(FL_FORMAT) )
+ ,m_aPageN(this, ModuleRes(RB_PAGE_N) )
+ ,m_aPageNofM(this, ModuleRes(RB_PAGE_N_OF_M) )
+ ,m_aPosition(this, ModuleRes(FL_POSITION) )
+ ,m_aTopPage(this, ModuleRes(RB_PAGE_TOPPAGE) )
+ ,m_aBottomPage(this, ModuleRes(RB_PAGE_BOTTOMPAGE) )
+ ,m_aMisc(this, ModuleRes(FL_MISC) )
+ ,m_aAlignment(this, ModuleRes(FL_ALIGNMENT) )
+ ,m_aAlignmentLst(this, ModuleRes(LST_ALIGNMENT) )
+ ,m_aShowNumberOnFirstPage(this, ModuleRes(CB_SHOWNUMBERONFIRSTPAGE) )
+ ,m_aFl1(this, ModuleRes(FL_SEPARATOR1))
+ ,m_aPB_OK(this, ModuleRes(PB_OK))
+ ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL))
+ ,m_aPB_Help(this, ModuleRes(PB_HELP))
+ ,m_pController(_pController)
+ ,m_xHoldAlive(_xHoldAlive)
+{
+ DBG_CTOR( rpt_OPageNumberDialog,NULL);
+
+ m_aShowNumberOnFirstPage.Hide();
+
+ FreeResource();
+}
+
+//------------------------------------------------------------------------
+OPageNumberDialog::~OPageNumberDialog()
+{
+ DBG_DTOR( rpt_OPageNumberDialog,NULL);
+}
+// -----------------------------------------------------------------------------
+short OPageNumberDialog::Execute()
+{
+ short nRet = ModalDialog::Execute();
+ if ( nRet == RET_OK )
+ {
+ try
+ {
+ sal_Int32 nControlMaxSize = 3000;
+ sal_Int32 nPosX = 0;
+ sal_Int32 nPos2X = 0;
+ awt::Size aRptSize = getStyleProperty<awt::Size>(m_xHoldAlive,PROPERTY_PAPERSIZE);
+ switch ( m_aAlignmentLst.GetSelectEntryPos() )
+ {
+ case 0: // left
+ nPosX = getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_LEFTMARGIN);
+ break;
+ case 1: // middle
+ nPosX = getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_LEFTMARGIN) + (aRptSize.Width - getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_LEFTMARGIN) - getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_RIGHTMARGIN) - nControlMaxSize) / 2;
+ break;
+ case 2: // right
+ nPosX = (aRptSize.Width - getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_RIGHTMARGIN) - nControlMaxSize);
+ break;
+ case 3: // inner
+ case 4: // outer
+ nPosX = getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_LEFTMARGIN);
+ nPos2X = (aRptSize.Width - getStyleProperty<sal_Int32>(m_xHoldAlive,PROPERTY_RIGHTMARGIN) - nControlMaxSize);
+ break;
+ default:
+ break;
+ }
+ if ( m_aAlignmentLst.GetSelectEntryPos() > 2 )
+ nPosX = nPos2X;
+
+ sal_Int32 nLength = 0;
+ uno::Sequence<beans::PropertyValue> aValues( 3 );
+ aValues[nLength].Name = PROPERTY_POSITION;
+ aValues[nLength++].Value <<= awt::Point(nPosX,0);
+
+ aValues[nLength].Name = PROPERTY_PAGEHEADERON;
+ aValues[nLength++].Value <<= m_aTopPage.IsChecked();
+
+ aValues[nLength].Name = PROPERTY_STATE;
+ aValues[nLength++].Value <<= m_aPageNofM.IsChecked();
+
+ m_pController->executeChecked(SID_INSERT_FLD_PGNUMBER,aValues);
+ }
+ catch(uno::Exception&)
+ {
+ nRet = RET_NO;
+ }
+ }
+ return nRet;
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/PageNumber.hrc b/reportdesign/source/ui/dlg/PageNumber.hrc
new file mode 100644
index 000000000000..f9ecddd14dcb
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.hrc
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageNumber.hrc,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef RPTUI_PAGENUMBER_HRC
+#define RPTUI_PAGENUMBER_HRC
+
+#define FL_FORMAT (1)
+#define RB_PAGE_N (2)
+#define RB_PAGE_N_OF_M (3)
+#define FL_POSITION (4)
+#define RB_PAGE_TOPPAGE (5)
+#define RB_PAGE_BOTTOMPAGE (6)
+#define FL_ALIGNMENT (7)
+#define LST_ALIGNMENT (8)
+#define CB_SHOWNUMBERONFIRSTPAGE (9)
+#define PB_OK (10)
+#define PB_CANCEL (11)
+#define PB_HELP (12)
+#define FL_SEPARATOR1 (13)
+#define FL_MISC (14)
+
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_HEIGHT 8
+#define FIXEDTEXT_WIDTH 60
+#define RELATED_CONTROLS 4
+#define UNRELATED_CONTROLS 7
+#define EDIT_HEIGHT 12
+#define BUTTON_HEIGHT 14
+#define BUTTON_WIDTH 50
+#define BROWSER_HEIGHT 75
+#define PAGE_WIDTH (RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 3*BUTTON_WIDTH)
+#define PAGE_HEIGHT ( 8*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT + BUTTON_HEIGHT +1 )
+#define LISTBOX_WIDTH PAGE_WIDTH - 3*UNRELATED_CONTROLS - FIXEDTEXT_WIDTH
+
+#endif // RPTUI_PAGENUMBER_HRC
diff --git a/reportdesign/source/ui/dlg/PageNumber.src b/reportdesign/source/ui/dlg/PageNumber.src
new file mode 100644
index 000000000000..137da629e24b
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.src
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageNumber.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "PageNumber.hrc"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+
+ModalDialog RID_PAGENUMBERS
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( PAGE_WIDTH , PAGE_HEIGHT ) ;
+ Text [ de ] = "Page Numbers" ;
+ Text [ en-US ] = "Page Numbers" ;
+ HelpId = HID_PAGENUMBERS_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ FixedLine FL_FORMAT
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Format";
+ Text [ en-US ] = "Format";
+ };
+
+ RadioButton RB_PAGE_N
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 2*RELATED_CONTROLS + FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Group = TRUE;
+ Check = TRUE;
+ Text [ de ] = "Seite N";
+ Text [ en-US ] = "Page N";
+ };
+ RadioButton RB_PAGE_N_OF_M
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 3*RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Seite N von M";
+ Text [ en-US ] = "Page N of M";
+ };
+
+ FixedLine FL_POSITION
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 3*RELATED_CONTROLS + UNRELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Position";
+ Text [ en-US ] = "Position";
+ };
+
+ RadioButton RB_PAGE_TOPPAGE
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 4*RELATED_CONTROLS + UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Group = TRUE;
+ Check = TRUE;
+ Text [ de ] = "Top of Page (Header)";
+ Text [ en-US ] = "Top of Page (Header)";
+ };
+ RadioButton RB_PAGE_BOTTOMPAGE
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 5*RELATED_CONTROLS + UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Bottom of Page (Footer)";
+ Text [ en-US ] = "Bottom of Page (Footer)";
+ };
+
+ FixedLine FL_MISC
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 5*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Allgemein";
+ Text [ en-US ] = "General";
+ };
+
+ FixedText FL_ALIGNMENT
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ) ;
+ Text [ de ] = "Alignment:";
+ Text [ en-US ] = "Alignment:";
+ };
+ ListBox LST_ALIGNMENT
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT -1);
+ Size = MAP_APPFONT( LISTBOX_WIDTH, 60 );
+ DropDown = TRUE;
+ TabStop = TRUE;
+ CurPos = 1 ;
+ StringList [ de ] =
+ {
+ < "Links" ; Default ; > ;
+ < "Mitte" ; Default ; > ;
+ < "Rechts" ; Default ; > ;
+ //< "Innerhalb" ; Default ; > ;
+ //< "Asserhalb" ; Default ; > ;
+ };
+ StringList [ en-US ] =
+ {
+ < "Left" ; Default ; > ;
+ < "Center" ; Default ; > ;
+ < "Right" ; Default ; > ;
+ //< "Inside" ; Default ; > ;
+ //< "Outside" ; Default ; > ;
+ };
+ };
+ CheckBox CB_SHOWNUMBERONFIRSTPAGE
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 6*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 8*FIXEDTEXT_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ;
+ Check = TRUE;
+ Text [ de ] = "Show Number on First Page";
+ Text [ en-US ] = "Show Number on First Page";
+ };
+ FixedLine FL_SEPARATOR1
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , 6*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT ) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ;
+ };
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + BUTTON_WIDTH , 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton PB_HELP
+ {
+ TabStop = TRUE ;
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 2*BUTTON_WIDTH , 7*RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 9*FIXEDTEXT_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ Text [ de ] = "~Hilfe" ;
+ Text [ en-US ] = "~Help";
+ };
+};
+String STR_RPT_PN_PAGE
+{
+ Text [ de ] = "\"Seite \" & #PAGENUMBER#" ;
+ Text [ en-US ] = "\"Page \" & #PAGENUMBER#" ;
+ Text [ x-comment ] = "The space after the word is no error. #PAGENUMBER# is a replacement and & must not be translated as well as \"";
+};
+String STR_RPT_PN_PAGE_OF
+{
+ Text [ de ] = " & \" von \" & #PAGECOUNT#" ;
+ Text [ en-US ] = " & \" of \" & #PAGECOUNT#" ;
+ Text [ x-comment ] = "The space before and after the word is no error. #PAGECOUNT# is a replacement and & must not be translated as well as \"";
+};
diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx
new file mode 100644
index 000000000000..79de12e3305b
--- /dev/null
+++ b/reportdesign/source/ui/dlg/dlgpage.cxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgpage.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include <svtools/intitem.hxx> //add CHINA001
+#ifndef _SVX_DIALOGS_HRC
+#include <svx/dialogs.hrc>
+#endif
+#ifndef _SVX_TAB_AREA_HXX
+#include <svx/tabarea.hxx>
+#endif
+
+#ifndef RPTUI_DLGPAGE_HXX
+#include "dlgpage.hxx"
+#endif
+#include "ModuleHelper.hxx"
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _SVTOOLS_CJKOPTIONS_HXX
+#include <svtools/cjkoptions.hxx>
+#endif
+#ifndef _AEITEM_HXX
+#include <svtools/aeitem.hxx>
+#endif
+#include <svx/flagsdef.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/svxenum.hxx>
+
+namespace rptui
+{
+/*************************************************************************
+|*
+|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
+|*
+\************************************************************************/
+
+ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId) :
+SfxTabDialog ( pParent, ModuleRes( _nPageId ), pAttr ),
+ rOutAttrs ( *pAttr )
+{
+ SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
+ DBG_ASSERT(pFact, "Dialogdiet fail!");
+ switch( _nPageId )
+ {
+ case RID_PAGEDIALOG_BACKGROUND:
+ AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1)));
+ break;
+ case RID_PAGEDIALOG_PAGE:
+ //AddTabPage( RID_SVXPAGE_PAGE,String(ModuleRes(1)));
+ // AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1)));
+ AddTabPage(RID_SVXPAGE_PAGE, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 );
+ AddTabPage(RID_SVXPAGE_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+ break;
+ case RID_PAGEDIALOG_CHAR:
+ AddTabPage(RID_PAGE_CHAR, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
+ AddTabPage(RID_PAGE_EFFECTS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
+ AddTabPage(RID_PAGE_POSITION, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 );
+ AddTabPage(RID_PAGE_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), 0 );
+ AddTabPage(RID_PAGE_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+ AddTabPage(RID_PAGE_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
+
+ break;
+ case RID_PAGEDIALOG_LINE:
+ AddTabPage( RID_SVXPAGE_LINE,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), 0 );
+ //AddTabPage( RID_SVXPAGE_LINE_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE_DEF ), 0 );
+ //AddTabPage( RID_SVXPAGE_LINEEND_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINEEND_DEF ), 0 );
+ break;
+ default:
+ OSL_ENSURE(0,"Unknown page id");
+ }
+
+ SvtCJKOptions aCJKOptions;
+ if ( !aCJKOptions.IsDoubleLinesEnabled() )
+ RemoveTabPage(RID_PAGE_TWOLN);
+
+ FreeResource();
+}
+// =============================================================================
+} // namespace rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/dlgpage.src b/reportdesign/source/ui/dlg/dlgpage.src
new file mode 100644
index 000000000000..6e5370473c52
--- /dev/null
+++ b/reportdesign/source/ui/dlg/dlgpage.src
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgpage.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:29 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#include <svx/dialogs.hrc>
+#include "RptResId.hrc"
+
+TabDialog RID_PAGEDIALOG_PAGE
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ de ] = "Seite einrichten" ;
+ Text [ en-US ] = "Page Setup" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PAGE ;
+ Text [ de ]= "Seite" ;
+ Text [ en-US ] = "Page" ;
+ PageResID = RID_SVXPAGE_PAGE ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_BACKGROUND ;
+ Text [ de ] = "Hintergrund" ;
+ Text [ en-US ] = "Background" ;
+ PageResID = RID_SVXPAGE_BACKGROUND ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ OKButton 1
+ {
+ Pos = MAP_APPFONT ( 6 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ CancelButton 1
+ {
+ Pos = MAP_APPFONT ( 60 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 114 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton 1
+ {
+ Pos = MAP_APPFONT ( 169 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */
+ Text [ de ] = "Zurück" ;
+ Text [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ de ] = "Seite" ;
+ Text [ en-US ] = "Page" ;
+ };
+ String 2
+ {
+ Text [ de ] = "Hintergrund" ;
+ Text [ en-US ] = "Background" ;
+ };
+};
+
+TabDialog RID_PAGEDIALOG_BACKGROUND
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ de ] = "Bereich einrichten" ;
+ Text [ en-US ] = "Section Setup" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ };
+ OKButton 1
+ {
+ Pos = MAP_APPFONT ( 6 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ CancelButton 1
+ {
+ Pos = MAP_APPFONT ( 60 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 114 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton 1
+ {
+ Pos = MAP_APPFONT ( 169 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */
+ Text [ de ] = "Zurück" ;
+ Text [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ de ] = "Hintergrund" ;
+ Text [ en-US ] = "Background" ;
+ };
+};
+TabDialog RID_PAGEDIALOG_CHAR
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ de ] = "Zeicheneinstellungen" ;
+ Text [ en-US ] = "Character Settings" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_PAGE_CHAR ;
+ Text [ de ] = "Schrift" ;
+ Text [ en-US ] = "Font" ;
+ PageResID = RID_PAGE_CHAR ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_EFFECTS ;
+ Text [ de ] = "Schrifteffekt" ;
+ Text [ en-US ] = "Font Effects" ;
+ PageResID = RID_PAGE_EFFECTS ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_POSITION ;
+ PageResID = RID_PAGE_POSITION ;
+ Text [ de ] = "Position" ;
+ Text [ en-US ] = "Position";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_TWOLN ;
+ PageResID = RID_PAGE_TWOLN;
+ Text [ de ] = "Asiatisches Layout" ;
+ Text [ en-US ] = "Asian Layout";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_BACKGROUND ;
+ Text [ de ] = "Hintergrund" ;
+ Text [ en-US ] = "Background" ;
+ PageResID = RID_PAGE_BACKGROUND ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_ALIGNMENT ;
+ Text [ de ] = "Ausrichtung" ;
+ Text [ en-US ] = "Alignment" ;
+ PageResID = RID_PAGE_ALIGNMENT ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ OKButton 1
+ {
+ Pos = MAP_APPFONT ( 6 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ CancelButton 1
+ {
+ Pos = MAP_APPFONT ( 60 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 114 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton 1
+ {
+ Pos = MAP_APPFONT ( 169 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */
+ Text [ de ] = "Zurück" ;
+ Text [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ de ] = "Zeichen" ;
+ Text [ en-US ] = "Character" ;
+ };
+};
+TabDialog RID_PAGEDIALOG_LINE
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ de ] = "Linie" ;
+ Text [ en-US ] = "Line" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 3 ) ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_LINE ;
+ Text [ de ] = "Linie" ;
+ Text [ en-US ] = "Line" ;
+ PageResID = RID_SVXPAGE_LINE ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_LINE_DEF ;
+ Text [ de ] = "Linienstile" ;
+ Text [ en-US ] = "Line Styles" ;
+ PageResID = RID_SVXPAGE_LINE_DEF ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_LINEEND_DEF ;
+ Text [ de ] = "Linienenden" ;
+ Text [ en-US ] = "Arrow Styles" ;
+ PageResID = RID_SVXPAGE_LINEEND_DEF ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ OKButton 1
+ {
+ Pos = MAP_APPFONT ( 6 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ CancelButton 1
+ {
+ Pos = MAP_APPFONT ( 60 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton 1
+ {
+ Pos = MAP_APPFONT ( 114 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton 1
+ {
+ Pos = MAP_APPFONT ( 169 , 151 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */
+ Text [ de ] = "Zurück" ;
+ Text [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ de ] = "Linie" ;
+ Text [ en-US ] = "Line" ;
+ };
+}; \ No newline at end of file
diff --git a/reportdesign/source/ui/dlg/makefile.mk b/reportdesign/source/ui/dlg/makefile.mk
new file mode 100644
index 000000000000..bbe36c3b61ff
--- /dev/null
+++ b/reportdesign/source/ui/dlg/makefile.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=uidlg
+IMGLST_SRS=$(SRS)$/$(TARGET).srs
+BMP_IN=$(PRJ)$/res
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files -------------------------------------
+
+# ... resource files ............................
+
+SRS1NAME=$(TARGET)
+SRC1FILES = \
+ dlgpage.src \
+ PageNumber.src \
+ DateTime.src \
+ CondFormat.src \
+ Navigator.src \
+ GroupsSorting.src
+
+# ... object files ............................
+
+EXCEPTIONSFILES= \
+ $(SLO)$/dlgpage.obj \
+ $(SLO)$/Condition.obj \
+ $(SLO)$/CondFormat.obj \
+ $(SLO)$/GroupExchange.obj \
+ $(SLO)$/PageNumber.obj \
+ $(SLO)$/DateTime.obj \
+ $(SLO)$/AddField.obj \
+ $(SLO)$/Navigator.obj \
+ $(SLO)$/GroupsSorting.obj
+
+SLOFILES= \
+ $(EXCEPTIONSFILES) \
+
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx
new file mode 100644
index 000000000000..892277d43251
--- /dev/null
+++ b/reportdesign/source/ui/inc/AddField.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AddField.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_ADDFIELDWINDOW_HXX
+#define RPTUI_ADDFIELDWINDOW_HXX
+
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtreebx.hxx>
+#endif
+#ifndef _SV_FLOATWIN_HXX //autogen
+#include <vcl/floatwin.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
+#include <svx/dataaccessdescriptor.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+
+namespace rptui
+{
+//==================================================================
+class OAddFieldWindow;
+class OAddFieldWindowListBox;
+//========================================================================
+class OAddFieldWindow :public FloatingWindow
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xHoldAlive;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
+ ::std::auto_ptr<OAddFieldWindowListBox> m_pListBox;
+ ::rptui::OReportController& m_rController;
+ ::rtl::OUString m_aCommandName;
+ ::rtl::OUString m_sFilter;
+ sal_Int32 m_nCommandType;
+ sal_Bool m_bEscapeProcessing;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener;
+
+ OAddFieldWindow(const OAddFieldWindow&);
+ void operator =(const OAddFieldWindow&);
+public:
+ OAddFieldWindow(::rptui::OReportController& _rController,Window* pParent);
+
+ virtual ~OAddFieldWindow();
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual long PreNotify( NotifyEvent& _rNEvt );
+
+ inline const ::rtl::OUString& GetCommand() const { return m_aCommandName; }
+ inline sal_Int32 GetCommandType() const { return m_nCommandType; }
+ inline sal_Bool GetEscapeProcessing() const { return m_bEscapeProcessing; }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getColumns() const { return m_xColumns; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const;
+
+ sal_Bool createSelectionControls( );
+
+ /// Updates the current field list
+ void Update();
+
+ /** fills the descriptor with the column name, column object, command and command type
+ *
+ * \param _pSelected the currently selected
+ * \param _rDescriptor the descriptor will be filled
+ */
+ void fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor);
+
+protected:
+ // FmXChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException );
+};
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // RPTUI_ADDFIELDWINDOW_HXX
+
diff --git a/reportdesign/source/ui/inc/ColorChanger.hxx b/reportdesign/source/ui/inc/ColorChanger.hxx
new file mode 100644
index 000000000000..7fcfc1fb29da
--- /dev/null
+++ b/reportdesign/source/ui/inc/ColorChanger.hxx
@@ -0,0 +1,78 @@
+#ifndef RPTUI_COLORCHANGER_HXX
+#define RPTUI_COLORCHANGER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ColorChanger.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+namespace rptui
+{
+ //=====================================================================
+ //= ColorChanger
+ //=====================================================================
+ class ColorChanger
+ {
+ protected:
+ OutputDevice* m_pDev;
+
+ public:
+ ColorChanger( OutputDevice* _pDev, const Color& _rNewLineColor)
+ :m_pDev( _pDev )
+ {
+ m_pDev->Push( PUSH_LINECOLOR );
+ m_pDev->SetLineColor( _rNewLineColor );
+ }
+ ColorChanger( OutputDevice* _pDev, const Color& _rNewLineColor, const Color& _rNewFillColor )
+ :m_pDev( _pDev )
+ {
+ m_pDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ m_pDev->SetLineColor( _rNewLineColor );
+ m_pDev->SetFillColor( _rNewFillColor );
+ }
+ ColorChanger( OutputDevice* _pDev, const Color& _rNewLineColor, const Color& _rNewFillColor, const Color& _rNewTextColor )
+ :m_pDev( _pDev )
+ {
+ m_pDev->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR | PUSH_TEXTCOLOR);
+ m_pDev->SetLineColor( _rNewLineColor );
+ m_pDev->SetFillColor( _rNewFillColor );
+ m_pDev->SetTextColor( _rNewTextColor );
+ }
+
+ ~ColorChanger()
+ {
+ m_pDev->Pop();
+ }
+ };
+}
+#endif //RPTUI_COLORCHANGER_HXX
+
diff --git a/reportdesign/source/ui/inc/ColorListener.hxx b/reportdesign/source/ui/inc/ColorListener.hxx
new file mode 100644
index 000000000000..9963e1ff996f
--- /dev/null
+++ b/reportdesign/source/ui/inc/ColorListener.hxx
@@ -0,0 +1,102 @@
+#ifndef RPTUI_COLORLISTENER_HXX
+#define RPTUI_COLORLISTENER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ColorListener.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_EXTCOLORCFG_HXX
+#include <svtools/extcolorcfg.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+
+namespace rptui
+{
+ class OColorListener : public Window, public SfxListener
+ {
+ OColorListener(const OColorListener&);
+ void operator =(const OColorListener&);
+ protected:
+ OModuleClient m_aModuleClient;
+ Link m_aCollapsedLink;
+ svtools::ColorConfig m_aColorConfig;
+ svtools::ExtendedColorConfig m_aExtendedColorConfig;
+ ::rtl::OUString m_sColorEntry;
+ sal_Int32 m_nColor;
+ sal_Int32 m_nTextBoundaries;
+ sal_Bool m_bCollapsed;
+ sal_Bool m_bMarked;
+
+ virtual void ImplInitSettings() = 0;
+ protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ public:
+ OColorListener(Window* _pParent,const ::rtl::OUString& _sColorEntry);
+ virtual ~OColorListener();
+
+ using Window::Notify;
+ // SfxListener
+ virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+
+ /** set the marker as marked or not marked
+ @param _bMark set the new state of the marker
+ */
+ void setMarked(sal_Bool _bMark);
+
+ /** returns if the section is marked
+ */
+ inline sal_Bool isMarked() const { return m_bMarked; }
+
+ inline void setCollapsedHdl(const Link& _aLink ){ m_aCollapsedLink = _aLink; }
+ inline sal_Bool isCollapsed() const { return m_bCollapsed; }
+
+ /** collapse or expand
+ *
+ * \param _bCollapsed
+ */
+ virtual void setCollapsed(sal_Bool _bCollapsed);
+ };
+}
+#endif // RPTUI_COLORLISTENER_HXX
+
diff --git a/reportdesign/source/ui/inc/CondFormat.hxx b/reportdesign/source/ui/inc/CondFormat.hxx
new file mode 100644
index 000000000000..b9f87de5868b
--- /dev/null
+++ b/reportdesign/source/ui/inc/CondFormat.hxx
@@ -0,0 +1,194 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: CondFormat.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_CONDFORMAT_HXX
+#define RPTUI_CONDFORMAT_HXX
+
+#include "ModuleHelper.hxx"
+
+#include <com/sun/star/report/XReportControlModel.hpp>
+
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/scrbar.hxx>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/noncopyable.hpp>
+
+#include <vector>
+
+// .............................................................................
+namespace rptui
+{
+// .............................................................................
+
+ #define MAX_CONDITIONS (size_t)3
+
+ class OReportController;
+ class Condition;
+
+ //=========================================================================
+ //= IConditionalFormatAction
+ //=========================================================================
+ class SAL_NO_VTABLE IConditionalFormatAction
+ {
+ public:
+ virtual void addCondition( size_t _nAddAfterIndex ) = 0;
+ virtual void deleteCondition( size_t _nCondIndex ) = 0;
+ virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ) = 0;
+ virtual void moveConditionUp( size_t _nCondIndex ) = 0;
+ virtual void moveConditionDown( size_t _nCondIndex ) = 0;
+ virtual ::rtl::OUString getDataField() const = 0;
+ };
+
+ /*************************************************************************
+ |*
+ |* Conditional formatting dialog
+ |*
+ \************************************************************************/
+ class ConditionalFormattingDialog :public ModalDialog
+ ,public IConditionalFormatAction
+ ,private ::boost::noncopyable
+ {
+ typedef ::boost::shared_ptr< Condition > ConditionPtr;
+ typedef ::std::vector< ConditionPtr > Conditions;
+
+ OModuleClient m_aModuleClient;
+ Window m_aConditionPlayground;
+ Conditions m_aConditions;
+ FixedLine m_aSeparator;
+ OKButton m_aPB_OK;
+ CancelButton m_aPB_CANCEL;
+ HelpButton m_aPB_Help;
+ ScrollBar m_aCondScroll;
+
+ ::rptui::OReportController& m_rController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel >
+ m_xFormatConditions;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel >
+ m_xCopy;
+
+ bool m_bDeletingCondition;
+
+ public:
+ ConditionalFormattingDialog(
+ Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel>& _xHoldAlive,
+ ::rptui::OReportController& _rController
+ );
+ virtual ~ConditionalFormattingDialog();
+
+ // Dialog overridables
+ virtual short Execute();
+
+ // IConditionalFormatAction overridables
+ virtual void addCondition( size_t _nAddAfterIndex );
+ virtual void deleteCondition( size_t _nCondIndex );
+ virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor );
+ virtual void moveConditionUp( size_t _nCondIndex );
+ virtual void moveConditionDown( size_t _nCondIndex );
+ virtual ::rtl::OUString getDataField() const;
+
+ protected:
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+ private:
+ DECL_LINK( OnScroll, ScrollBar* );
+
+ private:
+ /// returns the current number of conditions
+ size_t impl_getConditionCount() const { return m_aConditions.size(); }
+
+ /** adds a condition
+ @param _nNewCondIndex
+ the index of the to-be-inserted condition
+ */
+ void impl_addCondition_nothrow( size_t _nNewCondIndex );
+
+ /// deletes the condition with the given index
+ void impl_deleteCondition_nothrow( size_t _nCondIndex );
+
+ /// moves the condition with the given index one position
+ void impl_moveCondition_nothrow( size_t _nCondIndex, bool _bMoveUp );
+
+ /// does the dialog layouting
+ void impl_layoutAll();
+
+ /// does the layout for the condition windows
+ void impl_layoutConditions( Point& _out_rBelowLastVisible );
+
+ /// called when the number of conditions has changed in any way
+ void impl_conditionCountChanged();
+
+ /// initializes the conditions from m_xCopy
+ void impl_initializeConditions();
+
+ /// tells all our Condition instances their new index
+ void impl_updateConditionIndicies();
+
+ /// returns the number of the condition which has the (child path) focus
+ size_t impl_getFocusedConditionIndex( sal_Int32 _nFallBackIfNone ) const;
+
+ /// returns the index of the first visible condition
+ size_t impl_getFirstVisibleConditionIndex() const;
+
+ /// returns the index of the last visible condition
+ size_t impl_getLastVisibleConditionIndex() const;
+
+ /// determines the width of a Condition
+ long impl_getConditionWidth() const;
+
+ /// focuses the condition with the given index, making it visible if necessary
+ void impl_focusCondition( size_t _nCondIndex );
+
+ /// updates the scrollbar range. (does not update the scrollbar visibility)
+ void impl_updateScrollBarRange();
+
+ /// determines whether we need a scrollbar for the conditions
+ bool impl_needScrollBar() const { return m_aConditions.size() > MAX_CONDITIONS; }
+
+ /// scrolls the condition with the given index to the top position
+ void impl_scrollTo( size_t _nTopCondIndex );
+
+ /// ensures the condition with the given index is visible
+ void impl_ensureConditionVisible( size_t _nCondIndex );
+ };
+
+// .............................................................................
+} // namespace rptui
+// .............................................................................
+
+#endif // RPTUI_CONDFORMAT_HXX
diff --git a/reportdesign/source/ui/inc/DateTime.hxx b/reportdesign/source/ui/inc/DateTime.hxx
new file mode 100644
index 000000000000..0781840d0275
--- /dev/null
+++ b/reportdesign/source/ui/inc/DateTime.hxx
@@ -0,0 +1,118 @@
+#ifndef RPTUI_DATETIME_HXX
+#define RPTUI_DATETIME_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DateTime.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SV_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+
+namespace rptui
+{
+class OReportController;
+/*************************************************************************
+|*
+|* Groups and Sorting dialog
+|*
+\************************************************************************/
+class ODateTimeDialog : public ModalDialog
+{
+ FixedLine m_aFLDate;
+ CheckBox m_aDate;
+ RadioButton m_aDateF1;
+ RadioButton m_aDateF2;
+ RadioButton m_aDateF3;
+ FixedLine m_aFLTime;
+ CheckBox m_aTime;
+ RadioButton m_aTimeF1;
+ RadioButton m_aTimeF2;
+ RadioButton m_aTimeF3;
+ FixedLine m_aFL1;
+ OKButton m_aPB_OK;
+ CancelButton m_aPB_CANCEL;
+ HelpButton m_aPB_Help;
+
+
+ ::rptui::OReportController* m_pController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>
+ m_xHoldAlive;
+ ::com::sun::star::lang::Locale m_nLocale;
+
+ /** returns the format string.
+ */
+ ::rtl::OUString getFormatString(::sal_Int16 _nNumberFormatIndex);
+
+ /** returns the format
+ @param _bDate <TRUE/> when the date format should be returned otherwise the time format will be returned.
+ */
+ sal_Int16 getFormatIndex(sal_Bool _bDate);
+
+ /** returns the number format key
+ @param _nNumberFormatIndex the number format index @see com::sun::star::i18n::NumberFormatIndex
+ */
+ sal_Int32 getFormatKey(::sal_Int16 _nNumberFormatIndex);
+
+ DECL_LINK( CBClickHdl, CheckBox* );
+ ODateTimeDialog(const ODateTimeDialog&);
+ void operator =(const ODateTimeDialog&);
+public:
+ ODateTimeDialog( Window* pParent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xHoldAlive
+ ,::rptui::OReportController* _pController);
+ virtual ~ODateTimeDialog();
+ virtual short Execute();
+};
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_DATETIME_HXX
diff --git a/reportdesign/source/ui/inc/DefaultInspection.hxx b/reportdesign/source/ui/inc/DefaultInspection.hxx
new file mode 100644
index 000000000000..ee258878e7b9
--- /dev/null
+++ b/reportdesign/source/ui/inc/DefaultInspection.hxx
@@ -0,0 +1,130 @@
+#ifndef RPT_DEFAULTINSPECTION_HXX
+#define RPT_DEFAULTINSPECTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultInspection.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_INSPECTION_XOBJECTINSPECTORMODEL_HPP_
+#include <com/sun/star/inspection/XObjectInspectorModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+/** === end UNO includes === **/
+
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
+
+#include <memory>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+ class OPropertyInfoService;
+ //====================================================================
+ //= DefaultComponentInspectorModel
+ //====================================================================
+ typedef ::cppu::WeakAggImplHelper3 < ::com::sun::star::inspection::XObjectInspectorModel
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XInitialization
+ > DefaultComponentInspectorModel_Base;
+ class DefaultComponentInspectorModel : public DefaultComponentInspectorModel_Base
+ {
+ private:
+ ::osl::Mutex m_aMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > m_xComponent; /// delegatee
+ bool m_bConstructed;
+ bool m_bHasHelpSection;
+ sal_Bool m_bIsReadOnly;
+ sal_Int32 m_nMinHelpTextLines;
+ sal_Int32 m_nMaxHelpTextLines;
+ /// access to property meta data
+ ::std::auto_ptr< OPropertyInfoService > m_pInfoService;
+
+ DefaultComponentInspectorModel(const DefaultComponentInspectorModel&);
+ DefaultComponentInspectorModel& operator=(const DefaultComponentInspectorModel&);
+ protected:
+ virtual ~DefaultComponentInspectorModel();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XObjectInspectorModel
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getHandlerFactories() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getHasHelpSection() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMinHelpTextLines() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMaxHelpTextLines() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getIsReadOnly() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setIsReadOnly( ::sal_Bool _isreadonly ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::inspection::PropertyCategoryDescriptor > SAL_CALL describeCategories( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getPropertyOrderIndex( const ::rtl::OUString& PropertyName ) throw (::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);
+
+ public:
+ // XServiceInfo - static versions
+ static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
+
+ public:
+ DefaultComponentInspectorModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext);
+
+ protected:
+ // Service constructors
+ void createDefault();
+ void createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines );
+ };
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // RPT_DEFAULTINSPECTION_HXX
+
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
new file mode 100644
index 000000000000..8626b106ef68
--- /dev/null
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -0,0 +1,327 @@
+#ifndef RPTUI_DESIGNVIEW_HXX
+#define RPTUI_DESIGNVIEW_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DesignView.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef DBAUI_DATAVIEW_HXX
+#include <dbaccess/dataview.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCOMPONENT_HPP_
+#include <com/sun/star/report/XReportComponent.hpp>
+#endif
+#ifndef _SV_SPLIT_HXX
+#include <vcl/split.hxx>
+#endif
+#ifndef _SV_SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DATATRANSFER_DATAFLAVOR_HPP_
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#endif
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+#ifndef _SV_GEN_HXX
+#include <tools/gen.hxx>
+#endif
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+#ifndef _SFXHINT_HXX
+#include <svtools/hint.hxx>
+#endif
+#ifndef _SFXBRDCST_HXX
+#include <svtools/brdcst.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#include "ReportDefines.hxx"
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#include <boost/shared_ptr.hpp>
+#ifndef _SVDEDTV_HXX
+#include <svx/svdedtv.hxx>
+#endif
+#ifndef _SV_TABPAGE_HXX //autogen
+#include <vcl/tabpage.hxx>
+#endif
+#include <MarkedSection.hxx>
+
+class KeyEvent;
+class MouseEvent;
+class Timer;
+class Window;
+
+namespace rptui
+{
+ class OScrollWindowHelper;
+ class OReportSection;
+ class OUnoObject;
+ class OSectionView;
+ class OReportController;
+ class PropBrw;
+ class OAddFieldWindow;
+ class OReportModel;
+ class ONavigator;
+ //==================================================================
+ //==================================================================
+ class ODesignView : public dbaui::ODataView, public SfxBroadcaster, public IMarkedSection
+ {
+ private:
+ Splitter m_aSplitter;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xReportComponent;
+ OReportController* m_pReportController;
+ OScrollWindowHelper* m_pScrollWindow;
+ Window* m_pTaskPane;
+ PropBrw* m_pPropWin;
+ OAddFieldWindow* m_pAddField;
+ OSectionView* m_pCurrentView;
+ ONavigator* m_pReportExplorer;
+ Timer m_aMarkTimer;
+ Point m_aScrollOffset;
+ DlgEdMode m_eMode;
+ USHORT m_nCurrentPosition;
+ USHORT m_eActObj;
+ BOOL m_bFirstDraw;
+ Size m_aGridSize;
+ BOOL m_bGridVisible;
+ BOOL m_bGridSnap;
+ BOOL m_bInSplitHandler;
+
+
+ DECL_LINK( MarkTimeout, Timer * );
+ DECL_LINK( SplitHdl, void* );
+
+ void ImplInitSettings();
+
+ ODesignView(ODesignView&);
+ void operator =(ODesignView&);
+ protected:
+ // return the Rectangle where I can paint myself
+ virtual void resizeDocumentView(Rectangle& rRect);
+ // return the Rectangle where I can paint myself
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ public:
+ ODesignView(Window* pParent,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&,
+ OReportController* _pController);
+ virtual ~ODesignView();
+
+ // window overloads
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void GetFocus();
+
+ // set the view readonly or not
+ virtual void setReadOnly(sal_Bool _bReadOnly);
+
+ virtual void initialize();
+
+ inline OReportController* getController() const { return m_pReportController; }
+
+ void SetMode( DlgEdMode m_eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ USHORT GetInsertObj() const;
+ DlgEdMode GetMode() const { return m_eMode; }
+
+ /** cuts the current selection in this section
+ */
+ void Cut();
+
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed();
+
+ /** paste a new control in this section
+ */
+ void Paste();
+
+ /** Deletes the current selection in this section
+ *
+ */
+ void Delete();
+
+ /** align all marked objects in all sections
+ */
+ void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection, bool bBoundRects = false);
+
+ /** checks if alignment is possible in the current section
+ */
+ sal_Bool isAlignPossible() const;
+
+ /** All objects will be marked.
+ */
+ void SelectAll();
+
+ /// checks if a selection exists
+ BOOL HasSelection();
+
+ void UpdatePropertyBrowserDelayed(OSectionView* _pView);
+
+ USHORT getSectionCount() const;
+
+ /** removes the section at the given position.
+ *
+ * \param _nPosition Zero based.
+ */
+ void removeSection(USHORT _nPosition);
+
+ /** adds a new section at position _nPosition.
+ If the section is <NULL/> nothing happens.
+ If the position is grater than the current elements, the section will be appended.
+ */
+ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition = USHRT_MAX);
+
+ inline Size getGridSize() const { return m_aGridSize; }
+ inline BOOL isGridSnap() const { return m_bGridSnap; }
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ BOOL isDragStripes() const;
+ /** turns the grid on or off
+ *
+ * \param _bGridVisible
+ */
+ void toggleGrid(sal_Bool _bGridVisible);
+
+ void togglePropertyBrowser(sal_Bool _bToogleOn);
+
+ BOOL isAddFieldVisible() const;
+ void toggleAddField();
+
+ BOOL isReportExplorerVisible() const;
+ void toggleReportExplorer();
+
+ /** shows or hides the ruler.
+ */
+ void showRuler(sal_Bool _bShow);
+
+ /** unmark all objects on the views without the given one.
+ *
+ * @param _pSectionView The view where the objects should not be unmarked.
+ */
+ void unmarkAllObjects(OSectionView* _pSectionView);
+
+ /** triggers the property browser with the section
+ @param _xReportComponent the report component
+ */
+ void showProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
+ ::com::sun::star::uno::Any getCurrentlyShownProperty() const;
+
+ /** returns the current section or the detail section if no section was selected previously
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getCurrentSection() const;
+
+ /** returns the current control report model or <NULL/>
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > getCurrentControlModel() const;
+
+ // IMarkedSection
+ ::boost::shared_ptr<OReportSection> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ virtual void markSection(const sal_uInt16 _nPos);
+
+ /** fills the positions of all collapsed sections.
+ *
+ * \param _rCollapsedPositions Out parameter which holds afterwards all positions of the collapsed sections.
+ */
+ void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
+
+ /** collpase all sections given by their position
+ *
+ * \param _aCollpasedSections The position of the sections which should be collapsed.
+ */
+ void collapseSections(const com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections);
+
+ ::rtl::OUString getCurrentPage() const;
+ void setCurrentPage(const ::rtl::OUString& _sLastActivePage);
+
+ /** calculate the max width of the markers
+ *
+ * @param _bWithEnd if <TRUE/> the end marker will be used for calculation as well otherwise not.
+ * \return the max width
+ */
+ sal_Int32 getMaxMarkerWidth(sal_Bool _bWithEnd) const;
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** set the section as marked or not marked
+ @param _pSectionView the section where to set the marked flag
+ @param _bMark the marked flag
+ */
+ void setMarked(OSectionView* _pSectionView,sal_Bool _bMark);
+
+ void setMarked(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape,sal_Bool _bMark);
+
+ /** returns if the view handles the event by itself
+ *
+ * \param _nId the command id
+ * \return <FALSE/> is the event is not handled by the view otherwise <TRUE/>
+ */
+ sal_Bool isHandleEvent(sal_uInt16 _nId) const;
+
+ sal_uInt32 getMarkedObjectCount() const;
+ };
+//==================================================================
+} //rptui
+//==================================================================
+#endif // RPTUI_DESIGNVIEW_HXX
+
diff --git a/reportdesign/source/ui/inc/EndMarker.hxx b/reportdesign/source/ui/inc/EndMarker.hxx
new file mode 100644
index 000000000000..58e27dc66e78
--- /dev/null
+++ b/reportdesign/source/ui/inc/EndMarker.hxx
@@ -0,0 +1,63 @@
+#ifndef RPTUI_ENDMARKER_HXX
+#define RPTUI_ENDMARKER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: EndMarker.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_COLORLISTENER_HXX
+#include "ColorListener.hxx"
+#endif
+
+namespace rptui
+{
+ /** \class OEndMarker
+ * \brief Defines the right side of a graphical section.
+ */
+ class OEndMarker : public OColorListener
+ {
+ OEndMarker(OEndMarker&);
+ void operator =(OEndMarker&);
+ protected:
+ virtual void ImplInitSettings();
+ public:
+ OEndMarker(Window* _pParent,const ::rtl::OUString& _sColorEntry);
+ virtual ~OEndMarker();
+
+ // windows
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ };
+}
+#endif // RPTUI_ENDMARKER_HXX
+
diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx
new file mode 100644
index 000000000000..0d67487d9c6c
--- /dev/null
+++ b/reportdesign/source/ui/inc/GeometryHandler.hxx
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GeometryHandler.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_GEOMETRYHANDLER_HXX
+#define RPT_GEOMETRYHANDLER_HXX
+
+#ifndef _SAL_CONFIG_H_
+#include "sal/config.h"
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include "com/sun/star/uno/XComponentContext.hpp"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include "cppuhelper/compbase2.hxx"
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XPROPERTYHANDLER_HPP_
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
+#include "com/sun/star/script/XTypeConverter.hpp"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include "com/sun/star/beans/XPropertySet.hpp"
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#endif
+#include "com/sun/star/report/XReportComponent.hpp"
+#ifndef _COM_SUN_STAR_SDBC_XROWSET_HPP_
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#endif
+#include <memory>
+#ifndef RPTUI_METADATA_HXX_
+#include "metadata.hxx"
+#endif
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ class OPropertyInfoService;
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::inspection::XPropertyHandler
+ , ::com::sun::star::lang::XServiceInfo> GeometryHandler_Base;
+
+ class GeometryHandler:
+ private ::cppu::BaseMutex,
+ public GeometryHandler_Base
+ {
+ /** executes a dialog for chosing a filter criterion for a database report
+ @param _out_rSelectedClause
+ the filter or order clause as chosen by the user
+ @precond
+ we're really inspecting a database form (well, a RowSet at least)
+ @return
+ <TRUE/> if and only if the user successfully chose a clause
+ */
+ bool impl_dialogFilter_nothrow( ::rtl::OUString& _out_rSelectedClause, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
+
+ ::com::sun::star::uno::Any getConstantValue(sal_Bool bToControlValue,sal_uInt16 nResId,const ::com::sun::star::uno::Any& _aValue,const ::rtl::OUString& _sConstantName,const ::rtl::OUString & PropertyName );
+ ::com::sun::star::beans::Property getProperty(const ::rtl::OUString & PropertyName);
+ void implCreateListLikeControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory
+ ,::com::sun::star::inspection::LineDescriptor & out_Descriptor
+ ,sal_uInt16 _nResId
+ ,sal_Bool _bReadOnlyControl
+ ,sal_Bool _bTrueIfListBoxFalseIfComboBox
+ );
+ void implCreateListLikeControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory
+ ,::com::sun::star::inspection::LineDescriptor & out_Descriptor
+ ,const ::rtl::OUString& _sEntries
+ ,sal_Bool _bReadOnlyControl
+ ,sal_Bool _bTrueIfListBoxFalseIfComboBox
+ );
+ void checkPosAndSize( const ::com::sun::star::awt::Point& _aNewPos,
+ const ::com::sun::star::awt::Size& _aSize);
+
+ ::rtl::OUString
+ impl_convertToFormula( const ::com::sun::star::uno::Any& _rControlValue );
+
+ public:
+ // XServiceInfo - static versions
+ static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
+
+ public:
+ explicit GeometryHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent:
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::inspection::XPropertyHandler:
+ virtual void SAL_CALL inspect(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Component) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL setPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & Value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine(const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& ControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & ControlValue) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & PropertyValue, const ::com::sun::star::uno::Type & ControlValueType) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL addPropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & Listener) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isComposable(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, ::com::sun::star::uno::Any & out_Data, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException);
+ virtual void SAL_CALL actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const ::com::sun::star::uno::Any & NewValue, const ::com::sun::star::uno::Any & OldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI, ::sal_Bool FirstTimeInit) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual ::sal_Bool SAL_CALL suspend(::sal_Bool Suspend) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~GeometryHandler() {}
+ private:
+ GeometryHandler(GeometryHandler &); // not defined
+ void operator =(GeometryHandler &); // not defined
+
+
+
+ // overload WeakComponentImplHelperBase::disposing()
+ // This function is called upon disposing the component,
+ // if your component needs special work when it becomes
+ // disposed, do it here.
+ virtual void SAL_CALL disposing();
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aFieldNames;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aParamNames;
+ ::std::vector< ::rtl::OUString > m_aFunctionNames;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler > m_xFormComponentHandler; /// delegatee
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xReportComponent; /// inspectee
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet;
+ /// type converter, needed on various occasions
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter > m_xTypeConverter;
+ /// access to property meta data
+ ::std::auto_ptr< OPropertyInfoService > m_pInfoService;
+ };
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // RPT_GeometryHandler_HXX
diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx
new file mode 100644
index 000000000000..9601c17265e3
--- /dev/null
+++ b/reportdesign/source/ui/inc/GroupsSorting.hxx
@@ -0,0 +1,209 @@
+#ifndef RPTUI_GROUPS_SORTING_HXX
+#define RPTUI_GROUPS_SORTING_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GroupsSorting.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_FLOATWIN_HXX
+#include <vcl/floatwin.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SV_EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#ifndef _SV_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/imagebtn.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XGROUPS_HPP_
+#include <com/sun/star/report/XGroups.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XGROUP_HPP_
+#include <com/sun/star/report/XGroup.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include <com/sun/star/container/XNameAccess.hpp>
+#endif
+#ifndef RPT_SHARED_GROUPS_PROPERTIES_HXX
+#include "GroupProperties.hxx"
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _SVEDIT_HXX
+#include <svtools/svmedit.hxx>
+#endif
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+
+#include <vector>
+
+namespace comphelper
+{
+ class OPropertyChangeMultiplexer;
+}
+namespace rptui
+{
+class OFieldExpressionControl;
+class OReportController;
+/*************************************************************************
+|*
+|* Groups and Sorting dialog
+|*
+\************************************************************************/
+class OGroupsSortingDialog : public FloatingWindow
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+{
+ friend class OFieldExpressionControl;
+
+ FixedLine m_aFL2;
+ FixedText m_aMove;
+ ImageButton m_aUp;
+ ImageButton m_aDown;
+ FixedLine m_aFL3;
+ FixedText m_aOrder;
+ ListBox m_aOrderLst;
+ FixedText m_aHeader;
+ ListBox m_aHeaderLst;
+ FixedText m_aFooter;
+ ListBox m_aFooterLst;
+ FixedText m_aGroupOn;
+ ListBox m_aGroupOnLst;
+ FixedText m_aGroupInterval;
+ NumericField m_aGroupIntervalEd;
+ FixedText m_aKeepTogether;
+ ListBox m_aKeepTogetherLst;
+ FixedLine m_aFL;
+ FixedText m_aHelpWindow;
+
+ OFieldExpressionControl* m_pFieldExpression;
+ ::rptui::OReportController* m_pController;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pCurrentGroupListener;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups> m_xGroups;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xHoldAlive;
+ sal_Bool m_bReadOnly;
+private:
+ DECL_LINK( OnControlFocusLost, Control* );
+ DECL_LINK( OnControlFocusGot, Control* );
+ DECL_LINK( LBChangeHdl, ListBox* );
+ DECL_LINK( ClickHdl, ImageButton* );
+
+ /** returns the groups
+ @return the groups which now have to check which one changes
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroups>& getGroups() { return m_xGroups; }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> getGroup(sal_Int32 _nPos)
+ {
+ OSL_ENSURE(_nPos >= 0 && _nPos < m_xGroups->getCount(),"Invalid count!");
+ return ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>(m_xGroups->getByIndex(_nPos),::com::sun::star::uno::UNO_QUERY);
+ }
+
+ /** updates the listboxes with the new group properties
+ @param _nRow the new group pos
+ */
+ void DisplayData( sal_Int32 _nRow );
+
+ /** saves the values from the listboxes into the group at position _nRow
+ @param _nRow the group pos to store in
+ */
+ void SaveData( sal_Int32 _nRow );
+
+ /** returns <TRUE/> when the dialog should be read only
+ */
+ sal_Bool isReadOnly( ) const;
+
+ /** returns the data type for the given column name
+ @param _sColumnName
+ */
+ sal_Int32 getColumnDataType(const ::rtl::OUString& _sColumnName);
+
+ /** shows the text given by the id in the multiline edit
+ @param _nResId the string id
+ */
+ void showHelpText(USHORT _nResId);
+ /** display the group props
+ @param _xGroup the group to display
+ */
+ void displayGroup(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup);
+
+ /** enables or diables the up and down button
+ @param _nRow the row which will be active
+ */
+ void checkButtons(sal_Int32 _nRow);
+
+ /** clears the m_xColumns member and reset the fields
+ *
+ */
+ void fillColumns();
+ OGroupsSortingDialog(OGroupsSortingDialog&);
+ void operator =(OGroupsSortingDialog&);
+protected:
+ // window
+ virtual void Resize();
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+public:
+ OGroupsSortingDialog( Window* pParent
+ ,sal_Bool _bReadOnly
+ ,::rptui::OReportController* _pController);
+ virtual ~OGroupsSortingDialog();
+
+ /** sets the newe columns at the groups dialog.
+ @param _xColumns the new columns
+ */
+ void setColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xColumns);
+
+ /* updates the current view
+ */
+ void UpdateData( );
+};
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_GROUPS_SORTING_HXX
diff --git a/reportdesign/source/ui/inc/MarkedSection.hxx b/reportdesign/source/ui/inc/MarkedSection.hxx
new file mode 100644
index 000000000000..c55ea46353be
--- /dev/null
+++ b/reportdesign/source/ui/inc/MarkedSection.hxx
@@ -0,0 +1,68 @@
+#ifndef RPTUI_MARKEDSECTION_HXX
+#define RPTUI_MARKEDSECTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: MarkedSection.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#include <boost/shared_ptr.hpp>
+
+namespace rptui
+{
+ class OReportSection; // forward declaration
+
+ enum NearSectionAccess
+ {
+ CURRENT = 0,
+ PREVIOUS = -1,
+ POST = 1
+ };
+
+ class IMarkedSection
+ {
+ public:
+ /** returns the section which is currently marked.
+ */
+ virtual ::boost::shared_ptr<OReportSection> getMarkedSection(NearSectionAccess nsa) const =0;
+
+ /** mark the section on the given position .
+ *
+ * \param _nPos the position is zero based.
+ */
+ virtual void markSection(const sal_uInt16 _nPos) = 0;
+ };
+
+} // rptui
+
+#endif /* RPTUI_MARKEDSECTION_HXX */
diff --git a/reportdesign/source/ui/inc/Navigator.hxx b/reportdesign/source/ui/inc/Navigator.hxx
new file mode 100644
index 000000000000..345dc108108c
--- /dev/null
+++ b/reportdesign/source/ui/inc/Navigator.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Navigator.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef INCLUDED_RPTUI_NAVIGATOR_HXX
+#define INCLUDED_RPTUI_NAVIGATOR_HXX
+
+#ifndef _SV_FLOATWIN_HXX
+#include <vcl/floatwin.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#include <memory>
+namespace rptui
+{
+ class OReportController;
+ class ONavigatorImpl;
+ class ONavigator : public FloatingWindow
+ {
+ OModuleClient m_aModuleClient;
+ ::std::auto_ptr<ONavigatorImpl> m_pImpl;
+ ONavigator(const ONavigator&);
+ void operator =(const ONavigator&);
+ public:
+ ONavigator( Window* pParent
+ ,::rptui::OReportController* _pController);
+ virtual ~ONavigator();
+
+ // window
+ virtual void Resize();
+ };
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // INCLUDED_RPTUI_NAVIGATOR_HXX
diff --git a/reportdesign/source/ui/inc/PageNumber.hxx b/reportdesign/source/ui/inc/PageNumber.hxx
new file mode 100644
index 000000000000..7f79ec0e879c
--- /dev/null
+++ b/reportdesign/source/ui/inc/PageNumber.hxx
@@ -0,0 +1,102 @@
+#ifndef RPTUI_PAGENUMBER_HXX
+#define RPTUI_PAGENUMBER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: PageNumber.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SV_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+
+
+namespace rptui
+{
+class OReportController;
+/*************************************************************************
+|*
+|* Groups and Sorting dialog
+|*
+\************************************************************************/
+class OPageNumberDialog : public ModalDialog
+{
+ FixedLine m_aFormat;
+ RadioButton m_aPageN;
+ RadioButton m_aPageNofM;
+
+ FixedLine m_aPosition;
+ RadioButton m_aTopPage;
+ RadioButton m_aBottomPage;
+ FixedLine m_aMisc;
+ FixedText m_aAlignment;
+ ListBox m_aAlignmentLst;
+
+ CheckBox m_aShowNumberOnFirstPage;
+ FixedLine m_aFl1;
+ OKButton m_aPB_OK;
+ CancelButton m_aPB_CANCEL;
+ HelpButton m_aPB_Help;
+
+
+ ::rptui::OReportController* m_pController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>
+ m_xHoldAlive;
+
+ OPageNumberDialog(const OPageNumberDialog&);
+ void operator =(const OPageNumberDialog&);
+public:
+ OPageNumberDialog( Window* pParent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xHoldAlive
+ ,::rptui::OReportController* _pController);
+ virtual ~OPageNumberDialog();
+ virtual short Execute();
+};
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_PAGENUMBER_HXX
diff --git a/reportdesign/source/ui/inc/ReportComponentHandler.hxx b/reportdesign/source/ui/inc/ReportComponentHandler.hxx
new file mode 100644
index 000000000000..11bf34fbfefd
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportComponentHandler.hxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportComponentHandler.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCOMPONENTHANDLER_HXX
+#define RPT_REPORTCOMPONENTHANDLER_HXX
+
+#ifndef _SAL_CONFIG_H_
+#include "sal/config.h"
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include "com/sun/star/uno/XComponentContext.hpp"
+#endif
+#ifndef _CPPUHELPER_COMPBASE2_HXX_
+#include "cppuhelper/compbase2.hxx"
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XPROPERTYHANDLER_HPP_
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#endif
+
+#include <memory>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ class OPropertyInfoService;
+
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::inspection::XPropertyHandler
+ , ::com::sun::star::lang::XServiceInfo> ReportComponentHandler_Base;
+
+ class ReportComponentHandler:
+ private ::cppu::BaseMutex,
+ public ReportComponentHandler_Base
+ {
+ public:
+ // XServiceInfo - static versions
+ static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
+
+ public:
+ explicit ReportComponentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::lang::XComponent:
+ virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::inspection::XPropertyHandler:
+ virtual void SAL_CALL inspect(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Component) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL setPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & Value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine(const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& ControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & ControlValue) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & PropertyValue, const ::com::sun::star::uno::Type & ControlValueType) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL addPropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & Listener) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isComposable(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
+ virtual ::com::sun::star::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, ::com::sun::star::uno::Any & out_Data, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException);
+ virtual void SAL_CALL actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const ::com::sun::star::uno::Any & NewValue, const ::com::sun::star::uno::Any & OldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI, ::sal_Bool FirstTimeInit) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
+ virtual ::sal_Bool SAL_CALL suspend(::sal_Bool Suspend) throw (::com::sun::star::uno::RuntimeException);
+
+ protected:
+ virtual ~ReportComponentHandler() {}
+ private:
+ ReportComponentHandler(ReportComponentHandler &); // not defined
+ void operator =(ReportComponentHandler &); // not defined
+
+
+
+ // overload WeakComponentImplHelperBase::disposing()
+ // This function is called upon disposing the component,
+ // if your component needs special work when it becomes
+ // disposed, do it here.
+ virtual void SAL_CALL disposing();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler > m_xFormComponentHandler; /// delegatee
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xReportComponent; /// inspectee
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xFormComponent; /// inspectee
+ ::std::auto_ptr< OPropertyInfoService > m_pInfoService;
+ };
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // RPT_REPORTCOMPONENTHANDLER_HXX
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
new file mode 100644
index 000000000000..cc3dfe26c054
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -0,0 +1,423 @@
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#define RPTUI_REPORTCONTROLLER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportController.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef rptui_SINGLEDOCCONTROLLER_HXX
+#include <dbaccess/singledoccontroller.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
+#include <com/sun/star/sdbc/XConnection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOBJECTOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XObjectOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOBJECTINPUTSTREAM_HPP_
+#include <com/sun/star/io/XObjectInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTCONTROLMODEL_HPP_
+#include <com/sun/star/report/XReportControlModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTENGINE_HPP_
+#include <com/sun/star/report/XReportEngine.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_XROWSET_HPP_
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#endif
+#ifndef _COMPHELPER_UNO3_HXX_
+#include <comphelper/uno3.hxx>
+#endif
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+#ifndef _SFXLSTNER_HXX
+#include <svtools/lstner.hxx>
+#endif
+#ifndef _SVDEDTV_HXX
+#include <svx/svdedtv.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#include <comphelper/implementationreference.hxx>
+#endif
+#include "RptDef.hxx"
+#include <functional>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+
+class TransferableHelper;
+class TransferableClipboardListener;
+class VclWindowEvent;
+namespace rptui
+{
+ class ODesignView;
+ class OGroupsSortingDialog;
+ class OPropertyMediator;
+ class OReportModel;
+ class OSectionView;
+
+ typedef ::dbaui::OSingleDocumentController OReportController_BASE;
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::container::XContainerListener,
+ ::com::sun::star::beans::XPropertyChangeListener
+ > OReportController_Listener;
+
+ class OReportController : public OReportController_BASE
+ ,public OReportController_Listener
+ ,public SfxListener
+ {
+ private:
+ OModuleClient m_aModuleClient;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
+ m_aCollapsedSections;
+ ODesignView* m_pMyOwnView; // we want to avoid casts
+ TransferableDataHelper m_aSystemClipboard; // content of the clipboard
+ TransferableClipboardListener*
+ m_pClipbordNotifier; /// notifier for changes in the clipboard
+ OGroupsSortingDialog* m_pGroupsFloater;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> m_xReportDefinition;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine> m_xReportEngine;
+ ::com::sun::star::uno::Reference < ::com::sun::star::frame::XComponentLoader> m_xFrameLoader;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xRowSetMediator;
+
+ ::boost::shared_ptr<rptui::OReportModel>
+ m_aReportModel;
+ ::rtl::OUString m_sName; /// name for the report definition
+ ::rtl::OUString m_sLastActivePage; /// last active property browser page
+ sal_Int32 m_nSplitPos; /// the position of the splitter
+ sal_Int32 m_nPageNum; /// the page number from the restoreView call
+ //sal_Int32 m_nExecuteReportEvent;
+ sal_Bool m_bShowRuler;
+ sal_Bool m_bGridVisible;
+ sal_Bool m_bGridUse;
+ sal_Bool m_bShowProperties;
+ sal_Bool m_bGroupFloaterWasVisible;
+ sal_Bool m_bHelplinesMove;
+
+
+ /** creates a formatted field in the given section with the given formula as data field
+ *
+ * \param _aArgs
+ * \param _xSection the section where to create the formatted field
+ * \param _sFunction the function which will be set at the data field.
+ */
+ void createControl(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,const ::rtl::OUString& _sFunction ,sal_uInt16 _nObjectId = OBJ_DLG_FORMATTEDFIELD);
+ /** switch the report header/footer sectionon off with undo or without depending on the given id.
+ *
+ * \param _nId Can either be SID_REPORTHEADER_WITHOUT_UNDO or SID_REPORTFOOTER_WITHOUT_UNDO or SID_REPORTHEADERFOOTER.
+ */
+ void switchReportSection(const sal_Int16 _nId);
+
+ /** switch the report header/footer sectionon off with undo or without depending on the given id.
+ *
+ * \param _nId Can either be SID_PAGEHEADER_WITHOUT_UNDO or SID_PAGEFOOTER_WITHOUT_UNDO or SID_PAGEHEADERFOOTER.
+ */
+ void switchPageSection(const sal_Int16 _nId);
+
+ /** append a new group or remove it with undo.
+ *
+ * \param _bAppend
+ * \param _aArgs The args which contains a element named PROPERTY_GROUP of type report::XGroup.
+ */
+ void modifyGroup(const bool _bAppend, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs);
+
+ /** creates a group section.
+ *
+ * \param _bUndo true when undo action should be created
+ * \param _bHeader true when it is a header otherwise it is a footer
+ * \param _aArgs The args which contains a element named PROPERTY_GROUP of type report::XGroup.
+ */
+ void createGroupSection(const bool _bUndo,const bool _bHeader,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&_aArgs);
+
+ /** add or remove me as listener at the report definition
+ *
+ * \param _bAdd
+ */
+ void listen(const bool _bAdd);
+
+ /** saves the report definition
+ @param _bSaveAs if <TRUE/> then the report will be saved as a new one.
+ */
+ sal_Bool doSaveDoc(sal_Bool _bSaveAs);
+
+ /** opens the common page dialog
+ */
+ void openPageDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection);
+
+ /** opens or hides the sorting and grouping dialog
+ */
+ void openSortingAndGroupingDialog();
+
+ /** returns the position of the group inside the groups collection
+ */
+ sal_Int32 getGroupPosition(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup);
+
+ /** calls propertyChanged when the header or footer is really turned on.
+ @param _rEvent the group
+ @param _bShow when <TRUE/> the header and footer will be shown otherwise not
+ */
+ void notifyGroupSections(const ::com::sun::star::container::ContainerEvent& _rEvent
+ ,bool _bShow);
+
+ /** change the sections for a group
+ @param _sPropName the header or footer
+ @param _xGroup the group
+ @param _nGroupPos the position of the group inside the groups collection or the previous index when it was removed
+ @param _bShow when <TRUE/> the header and footer will be shown otherwise not
+ */
+ void groupChange( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup
+ ,const ::rtl::OUString& _sPropName
+ ,sal_Int32 _nGroupPos
+ ,bool _bShow);
+
+ void executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun);
+ void alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false);
+
+ /** opens the file open dialog to allow the user to select a image which will be
+ * bound to a newly created image button.
+ */
+ void insertGraphic();
+
+ /** resets the floater
+ */
+ void updateFloater();
+
+ /** creates a new function in the given value context
+ *
+ * \param _aValue contains a XNameContainer
+ */
+ void createNewFunction(const ::com::sun::star::uno::Any& _aValue);
+
+ /** inserts a label - field pair into the current selected section
+ *
+ * \param aArgs
+ */
+ void addPairControls(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs);
+
+ /** inserts a label - field combination to show the page number and/or page count
+ *
+ * \param _aArgs
+ */
+ void createPageNumber(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs);
+
+ /** creates a formatted filed with TODAY() function and if set also an NOW() function
+ *
+ * \param _aArgs
+ */
+ void createDateTime(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs);
+
+ /** gets the current section (SdrView)
+ *
+ * \return the currently selected section or <NULL/> if noone is selected
+ */
+ OSectionView* getCurrentSectionView() const;
+
+ /**change the ZOrder of a current select object.
+ *
+ * \param _nId The command ID about what to do.
+ */
+ void changeZOrder(sal_Int32 _nId);
+
+ /** marks the next or previous section, when the first/last section was already selected then the report will be selected.
+ *
+ * \param _bNext
+ */
+ void markSection(const bool _bNext);
+
+ OReportController(OReportController&);
+ void operator =(OReportController&);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame();
+
+ protected:
+ DECL_LINK( OnInvalidateClipboard, void* );
+ DECL_LINK( OnClipboardChanged, void* );
+ DECL_LINK( OnExecuteReport, void* );
+ DECL_LINK( OnSave, void* );
+ DECL_LINK( OnSaveAs, void* );
+ short saveModified();
+ // all the features which should be handled by this class
+ virtual void describeSupportedFeatures();
+ // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot.
+ virtual dbaui::FeatureState GetState(sal_uInt16 nId) const;
+ // execute a feature
+ virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs);
+
+ virtual void losingConnection( );
+
+ virtual void updateTitle();
+
+ virtual ~OReportController();
+ public:
+ OReportController(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context);
+
+ DECL_LINK( NotifyUndoActionHdl, SfxUndoAction* );
+ DECL_LINK( EventLstHdl, VclWindowEvent* );
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // SfxListener
+ virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+
+ virtual void setModified(sal_Bool _bModified=sal_True);
+
+ // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();}
+ // need for undo's and redo's
+ SfxUndoManager* getUndoMgr();
+
+ /** returns <TRUE/> when the command is enbaled
+ @param _nCommand the command id
+ @param _xControlFormat the report control format
+ */
+ sal_Bool isFormatCommandEnabled(sal_uInt16 _nCommand
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat>& _xControlFormat) const;
+
+ virtual sal_Bool Construct(Window* pParent);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::frame::XController
+ virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::lang::XComponent
+ virtual void SAL_CALL disposing();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ // need by registration
+ static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+
+ // ::com::sun::star::container::XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::frame::XController
+ virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL getViewData(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL restoreViewData(const ::com::sun::star::uno::Any& Data) throw( ::com::sun::star::uno::RuntimeException );
+
+ /** gives access to the report definition
+ * \return the report definition object, may be <NULL/>
+ */
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> getReportDefinition() const { return m_xReportDefinition; }
+
+ // ::com::sun::star::frame::XController
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // XSelectionSupplier
+ virtual ::sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& xSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException);
+
+ /** returns the current position of the splitter
+ *
+ * \return
+ */
+ inline sal_Int32 getSplitPos() const { return m_nSplitPos;}
+ inline void setSplitPos(sal_Int32 _nSplitPos) { m_nSplitPos = _nSplitPos;}
+
+ /** creates a new report from the report definition.
+ *
+ * \return The model or <NULL/> if the model could not be created.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> executeReport();
+
+ /** returns the RowSet which reflects the current settings of the report definition
+
+ The caller is allowed to hold a reference to the RowSet - it is kept alive as long
+ as the controller lives, and it's settings will follow the report definition's settings.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > getRowSet();
+
+ /** hides or display all design floaters
+ *
+ * \param _bShow If <TRUE/> show floaters otherwise hide them.
+ */
+ void displayDesignFloater(sal_Bool _bShow);
+
+ /** return the SdrModel of the real model
+ *
+ * \return
+ */
+ ::boost::shared_ptr<rptui::OReportModel> getSdrModel();
+
+ protected:
+ virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager );
+ virtual void impl_initialize( );
+ };
+}
+#endif // RPTUI_REPORTCONTROLLER_HXX
diff --git a/reportdesign/source/ui/inc/ReportDefines.hxx b/reportdesign/source/ui/inc/ReportDefines.hxx
new file mode 100644
index 000000000000..b464fb389eb6
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportDefines.hxx
@@ -0,0 +1,47 @@
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#define RPTUI_REPORT_DEFINES_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportDefines.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+namespace rptui
+{
+ enum DlgEdMode { RPTUI_INSERT, RPTUI_SELECT, RPTUI_TEST, RPTUI_READONLY };
+
+#define REPORT_STARTMARKER_WIDTH 120
+#define REPORT_ENDMARKER_WIDTH 10
+#define REPORT_EXTRA_SPACE 10
+
+}
+#endif //RPTUI_REPORT_DEFINES_HXX
diff --git a/reportdesign/source/ui/inc/ReportRuler.hxx b/reportdesign/source/ui/inc/ReportRuler.hxx
new file mode 100644
index 000000000000..ef0289054003
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportRuler.hxx
@@ -0,0 +1,75 @@
+#ifndef RPTUI_RULER_HXX
+#define RPTUI_RULER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportRuler.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+
+namespace rptui
+{
+ class OReportSection;
+ class OReportWindow;
+ class OReportRuler : public Window
+ {
+ OReportSection* m_pSection;
+ OReportWindow* m_pParent;
+ sal_Bool m_bShow;
+ OReportRuler(OReportRuler&);
+ void operator =(OReportRuler&);
+ public:
+ OReportRuler(Window* _pParent,OReportWindow* _pReportWindowt,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ virtual ~OReportRuler();
+
+ // windows overloads
+ virtual void Resize();
+
+ inline OReportSection* getSection() const { return m_pSection; }
+ inline OReportWindow* getView() const { return m_pParent; }
+
+ /** makes the grid visible
+ *
+ * \param _bVisible when <TRUE/> the grid is made visible
+ */
+ void SetGridVisible(BOOL _bVisible);
+ };
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // RPTUI_RULER_HXX
diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx
new file mode 100644
index 000000000000..b623a8d1a54a
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportSection.hxx
@@ -0,0 +1,205 @@
+#ifndef REPORT_REPORTSECTION_HXX
+#define REPORT_REPORTSECTION_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportSection.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#include "ReportDefines.hxx"
+#ifndef _REPORT_RPTUIFUNC_HXX
+#include "dlgedfunc.hxx"
+#endif
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+#include <boost/shared_ptr.hpp>
+#include <memory>
+
+namespace rptui
+{
+ class OReportModel;
+ class OReportPage;
+ class OSectionView;
+ class OViewsWindow;
+
+ class OReportSection : public Window
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ , public DropTargetHelper
+ {
+ OReportPage* m_pPage;
+ OSectionView* m_pView;
+ OViewsWindow* m_pParent;
+ ::std::auto_ptr<DlgEdFunc> m_pFunc;
+ ::boost::shared_ptr<OReportModel> m_pModel;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pMulti;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection;
+
+ DlgEdMode m_eMode;
+ BOOL m_bDialogModelChanged;
+ sal_Bool m_bInDrag;
+
+ /** fills the section with all control from the report section
+ */
+ void fill();
+
+ OReportSection(OReportSection&);
+ void operator =(OReportSection&);
+ protected:
+ // DropTargetHelper overridables
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& _rEvt );
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& _rEvt );
+
+ // window overrides
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void LoseFocus();
+ virtual void GetFocus();
+ virtual void Resize();
+
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+ public:
+ OReportSection(OViewsWindow* _pParent,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ virtual ~OReportSection();
+
+ // window overrides
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+
+ /** copies the current selection in this section
+ @param _rAllreadyCopiedObjects This is an out/in put param which contains all already copied objects.
+ */
+ void Copy(::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rAllreadyCopiedObjects);
+
+ /** paste a new control in this section
+ @param _aAllreadyCopiedObjects objects to paste into the section. Only objects are pasted where the name is equal to the section name.
+ @param _bForce If set to <TRUE/> than the objects will be copied into this section. The name is not compared in this case.
+ */
+ void Paste(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce = false);
+
+ /** Deletes the current selection in this section
+ *
+ */
+ void Delete();
+
+ /** All objects will be marked.
+ */
+ void SelectAll();
+
+ /** makes the grid visible
+ *
+ * \param _bVisible when <TRUE/> the grid is made visible
+ */
+ void SetGridVisible(BOOL _bVisible);
+
+ /** adjusat the size of the current page
+ *
+ * \return <TRUE/> when the page was adjusted
+ */
+ bool adjustPageSize();
+
+ inline OViewsWindow* getViewsWindow() const { return m_pParent; }
+ inline OSectionView* getView() const { return m_pView; }
+ inline OReportPage* getPage() const { return m_pPage; }
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const { return m_xSection; }
+
+ BOOL UnmarkDialog();
+ BOOL RemarkDialog();
+
+ void SetDialogModelChanged( BOOL bChanged = TRUE ) { m_bDialogModelChanged = bChanged; }
+ BOOL IsDialogModelChanged() const { return m_bDialogModelChanged; }
+ DlgEdMode GetMode() const { return m_eMode; }
+ void SetMode( DlgEdMode m_eMode );
+
+ /** sets the height of the section
+ @param _nHeight Height is in pixel
+ */
+ void setSectionHeightPixel(sal_uInt32 _nHeight);
+
+ /** insert a new SdrObject which belongs to the report component.
+ @param _xObject the report component
+ */
+ void insertObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject);
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** returns the current control report model or <NULL/>
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > getCurrentControlModel() const;
+
+ /** fills the vector with all selected control models
+ /param _rSelection The vector will be filled and will not be cleared before.
+ */
+ void fillControlModelSelection(::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > >& _rSelection) const;
+
+ /** creates a default object
+ *
+ * @param _sType
+ */
+ void createDefault(const ::rtl::OUString& _sType);
+
+ /** calls on the section BrkAction
+ *
+ */
+ void breakAction();
+ };
+//==================================================================
+} //rptui
+//==================================================================
+#endif // REPORT_REPORTSECTION_HXX
+
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
new file mode 100644
index 000000000000..799dba9add28
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -0,0 +1,258 @@
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#define RPTUI_REPORT_WINDOW_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportWindow.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#include "ReportDefines.hxx"
+#endif
+#ifndef RPTUI_STARTMARKER_HXX
+#include "StartMarker.hxx"
+#endif
+#ifndef _RULER_HXX //autogen
+#include <svtools/ruler.hxx>
+#endif
+#ifndef _SVDEDTV_HXX
+#include <svx/svdedtv.hxx>
+#endif
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <MarkedSection.hxx>
+
+class Splitter;
+
+namespace rptui
+{
+ class ODesignView;
+ class OReportSection;
+ class OScrollWindowHelper;
+ class OSectionView;
+ class OReportModel;
+ class OEndMarker;
+ class OReportPage;
+ class DlgEdFunc;
+ class OSectionsWindow;
+ class OViewsWindow;
+ class DlgEdFactory;
+
+ class OReportWindow : public Window, public IMarkedSection
+ {
+ Ruler m_aHRuler;
+
+ ODesignView* m_pView;
+ OScrollWindowHelper* m_pParent;
+ OSectionsWindow* m_pSections;
+ OViewsWindow* m_pViews;
+ DlgEdFactory* m_pObjFac;
+
+ void ImplInitSettings();
+
+ sal_Int32 GetTotalHeight() const;
+
+ OReportWindow(OReportWindow&);
+ void operator =(OReportWindow&);
+ protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ public:
+ OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView);
+ virtual ~OReportWindow();
+
+ /** late ctor
+ */
+ void initialize();
+
+ DECL_LINK(Collapsed,OStartMarker*);
+ // WINDOW overloads
+ virtual void Resize();
+
+ inline ODesignView* getReportView() const { return m_pView; }
+ inline OScrollWindowHelper* getScrollWindow() const { return m_pParent; }
+
+ void SetMode( DlgEdMode m_eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ BOOL isDragStripes() const;
+
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed();
+
+ /** paste a new control in this section
+ */
+ void Paste();
+
+ /** Deletes the current selection in this section
+ *
+ */
+ void Delete();
+
+ /** All objects will be marked.
+ */
+ void SelectAll();
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection();
+
+ Point getScrollOffset() const;
+
+ /** removes the section at the given position.
+ *
+ * \param _nPosition Zero based.
+ */
+ void removeSection(USHORT _nPosition);
+
+ /** adds a new section at position _nPosition.
+ If the section is <NULL/> nothing happens.
+ If the position is grater than the current elements, the section will be appended.
+ */
+ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition = USHRT_MAX);
+
+ USHORT getSectionCount() const;
+
+ /** turns the grid on or off
+ *
+ * \param _bVisible
+ */
+ void toggleGrid(sal_Bool _bVisible);
+
+
+ /** shows the ruler
+ */
+ void showRuler(sal_Bool _bShow);
+
+ inline sal_Int32 getRulerHeight() const { return m_aHRuler.GetSizePixel().Height(); }
+
+ /** returns the total width of the first section
+ */
+ sal_Int32 GetTotalWidth() const;
+
+ /** calculate the max width of the markers
+ *
+ * @param _bWithEnd if <TRUE/> the end marker will be used for calculation as well otherwise not.
+ * \return the max width
+ */
+ sal_Int32 getMaxMarkerWidth(sal_Bool _bWithEnd) const;
+
+ /** returns the height of the first spliiter.
+ */
+ sal_Int32 getSplitterHeight() const;
+
+ /** sets the total size of the scroll window
+ */
+ void setTotalSize();
+
+ /** returns the minimum height of the section
+ *
+ * \param _nPos
+ * \return the height in pixel
+ */
+ sal_Int32 getMinHeight(USHORT _nPos) const;
+
+ void ScrollChildren(long nDeltaX, long nDeltaY);
+
+ void notifyHeightChanged();
+
+ /** unmark all objects on the views without the given one.
+ *
+ * @param _pSectionView The view where the objects should not be unmarked.
+ */
+ void unmarkAllObjects(OSectionView* _pSectionView);
+
+ /** triggers the property browser with the report component or section
+ @param _xReportComponent
+ */
+ void showProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xReportComponent);
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** the the section as marked or not marked
+ @param _pSectionView the section where to set the marked flag
+ @param _bMark the marked flag
+ */
+ void setMarked(OSectionView* _pSectionView,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape,sal_Bool _bMark);
+
+ // IMarkedSection
+ ::boost::shared_ptr<OReportSection> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ virtual void markSection(const sal_uInt16 _nPos);
+
+
+ /** fills the positions of all collapsed sections.
+ *
+ * \param _rCollapsedPositions Out parameter which holds afterwards all positions of the collapsed sections.
+ */
+ void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
+
+ /** collpase all sections given by their position
+ *
+ * \param _aCollpasedSections The position of the sections which should be collapsed.
+ */
+ void collapseSections(const com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections);
+
+ /** align all marked objects in all sections
+ *
+ * \param eHor
+ * \param eVert
+ * \param bBoundRects
+ */
+ void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection, bool bBoundRects = false);
+
+ sal_uInt32 getMarkedObjectCount() const;
+ };
+//==================================================================
+} //rptui
+//==================================================================
+#endif // RPTUI_REPORT_WINDOW_HXX
+
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
new file mode 100644
index 000000000000..0c242aae503f
--- /dev/null
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -0,0 +1,245 @@
+#ifndef RPTUI_SCROLLHELPER_HXX
+#define RPTUI_SCROLLHELPER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ScrollHelper.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#include "ReportDefines.hxx"
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef _SVDEDTV_HXX
+#include <svx/svdedtv.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef _RTL_REF_HXX_
+#include <rtl/ref.hxx>
+#endif
+#include <boost/shared_ptr.hpp>
+
+#include <MarkedSection.hxx>
+
+class SdrView;
+namespace rptui
+{
+ class OSectionsWindow;
+ class ODesignView;
+ class OReportWindow;
+ class OSectionView;
+ class OReportSection;
+ class OReportModel;
+
+ /** This class defines the scrollable area of the report design. It includes
+ the h-ruler and the sections, and end marker. Not the start marker.
+ */
+ typedef Window OScrollWindowHelper_BASE;
+ class OScrollWindowHelper : public ::cppu::BaseMutex
+ , public OScrollWindowHelper_BASE/*TabPage*/
+ , public ::comphelper::OPropertyChangeListener
+ , public IMarkedSection
+ {
+ private:
+ ScrollBar m_aHScroll;
+ ScrollBar m_aVScroll;
+ ScrollBarBox m_aCornerWin; // window in the bottom right corner
+ Point m_aScrollOffset;
+ Size m_aTotalPixelSize;
+ Point m_aPixOffset; // offset to virtual window (pixel)
+ ODesignView* m_pParent;
+ OReportWindow* m_pChild;
+ ::rtl::Reference<comphelper::OPropertyChangeMultiplexer >
+ m_pReportDefintionMultiPlexer; // listener for property changes
+
+ DECL_LINK( ScrollHdl, ScrollBar*);
+ DECL_LINK( EndScrollHdl, ScrollBar*);
+ Size ResizeScrollBars();
+ void ScrollPane( long nDeltaX, long nDeltaY );
+ void ImplInitSettings();
+ void impl_initScrollBar( ScrollBar& _rScrollBar ) const;
+ void impl_scrollContent( long nDeltaX, long nDeltaY );
+
+ OScrollWindowHelper(OScrollWindowHelper&);
+ void operator =(OScrollWindowHelper&);
+ protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ // window
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& rNEvt );
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+ public:
+ OScrollWindowHelper( ODesignView* _pReportDesignView);
+ virtual ~OScrollWindowHelper();
+
+ /** late ctor
+ */
+ void initialize();
+
+ void EndScroll( long nDeltaX, long nDeltaY );
+
+ inline Point getScrollOffset() const { return m_aScrollOffset; }
+ inline OReportWindow* getReportWindow() const { return m_pChild; }
+ void setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight);
+ inline Size getTotalSize() const { return m_aTotalPixelSize; }
+ inline ScrollBar* GetHScroll() { return &m_aHScroll; }
+ inline ScrollBar* GetVScroll() { return &m_aVScroll; }
+
+ // forwards
+ void SetMode( DlgEdMode _eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ BOOL isDragStripes() const;
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed();
+
+ /** paste a new control in this section
+ */
+ void Paste();
+
+ /** Deletes the current selection in this section
+ *
+ */
+ void Delete();
+
+ /** All objects will be marked.
+ */
+ void SelectAll();
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection();
+
+ /** removes the section at the given position.
+ *
+ * \param _nPosition Zero based.
+ */
+ void removeSection(USHORT _nPosition);
+
+ /** adds a new section at position _nPosition.
+ If the section is <NULL/> nothing happens.
+ If the position is grater than the current elements, the section will be appended.
+ */
+ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition = USHRT_MAX);
+
+ USHORT getSectionCount() const;
+
+ /** turns the grid on or off
+ *
+ * \param _bVisible
+ */
+ void toggleGrid(sal_Bool _bVisible);
+
+ /** unmark all objects on the views without the given one.
+ *
+ * @param _pSectionView The view where the objects should not be unmarked.
+ */
+ void unmarkAllObjects(OSectionView* _pSectionView);
+
+ /** shows or hides the ruler.
+ */
+ void showRuler(sal_Bool _bShow);
+
+ /** calculate the max width of the markers
+ *
+ * @param _bWithEnd if <TRUE/> the end marker will be used for calculation as well otherwise not.
+ * \return the max width
+ */
+ sal_Int32 getMaxMarkerWidth(sal_Bool _bWithEnd) const;
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** the the section as marked or not marked
+ @param _pSectionView the section where to set the marked flag
+ @param _bMark the marked flag
+ */
+ void setMarked(OSectionView* _pSectionView,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape,sal_Bool _bMark);
+
+ // IMarkedSection
+ ::boost::shared_ptr<OReportSection> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ virtual void markSection(const sal_uInt16 _nPos);
+
+
+ /** fills the positions of all collapsed sections.
+ *
+ * \param _rCollapsedPositions Out parameter which holds afterwards all positions of the collapsed sections.
+ */
+ void fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const;
+
+ /** collpase all sections given by their position
+ *
+ * \param _aCollpasedSections The position of the sections which should be collapsed.
+ */
+ void collapseSections(const com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections);
+
+ /** align all marked objects in all sections
+ *
+ * \param eHor
+ * \param eVert
+ * \param bBoundRects
+ */
+ void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection, bool bBoundRects = false);
+
+ sal_uInt32 getMarkedObjectCount() const;
+ };
+}
+#endif // RPTUI_SCROLLHELPER_HXX
diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx
new file mode 100644
index 000000000000..746e08bca501
--- /dev/null
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -0,0 +1,74 @@
+#ifndef _REPORT_SECTIONVIEW_HXX
+#define _REPORT_SECTIONVIEW_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SectionView.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+
+#ifndef _SVDVIEW_HXX
+#include <svx/svdview.hxx>
+#endif
+namespace rptui
+{
+class OReportWindow;
+class OReportSection;
+
+//============================================================================
+// OSectionView
+//============================================================================
+
+class OSectionView : public SdrView
+{
+private:
+ OReportWindow* m_pReportWindow;
+ OReportSection* m_pSectionWindow;
+
+ void ObjectRemovedInAliveMode( const SdrObject* pObject );
+ OSectionView(const OSectionView&);
+ void operator =(const OSectionView&);
+public:
+ TYPEINFO();
+
+ OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor );
+ virtual ~OSectionView();
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ virtual void MarkListHasChanged();
+ virtual void MakeVisible( const Rectangle& rRect, Window& rWin );
+
+ inline OReportSection* getSectionWindow() const { return m_pSectionWindow; }
+};
+}
+#endif //_REPORT_SECTIONVIEW_HXX
diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx
new file mode 100644
index 000000000000..946adf813462
--- /dev/null
+++ b/reportdesign/source/ui/inc/StartMarker.hxx
@@ -0,0 +1,105 @@
+#ifndef RPTUI_STARTMARKER_HXX
+#define RPTUI_STARTMARKER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StartMarker.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _OSL_INTERLOCK_H_
+#include <osl/interlck.h>
+#endif
+#ifndef _RULER_HXX //autogen
+#include <svtools/ruler.hxx>
+#endif
+#ifndef RPTUI_COLORLISTENER_HXX
+#include "ColorListener.hxx"
+#endif
+#ifndef _SV_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+
+
+namespace rptui
+{
+ class OSectionsWindow;
+ class OStartMarker : public OColorListener
+ {
+
+ Ruler m_aVRuler;
+ FixedText m_aText;
+ FixedImage m_aImage;
+ OSectionsWindow* m_pParent;
+ static Image* s_pDefCollapsed;
+ static Image* s_pDefExpanded;
+ static Image* s_pDefCollapsedHC;
+ static Image* s_pDefExpandedHC;
+ static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed
+ sal_Int32 m_nCornerSize;
+
+ sal_Bool m_bShowRuler;
+
+ void initDefaultNodeImages();
+ void setColor();
+ virtual void ImplInitSettings();
+ OStartMarker(OStartMarker&);
+ void operator =(OStartMarker&);
+ public:
+ OStartMarker(OSectionsWindow* _pParent,const ::rtl::OUString& _sColorEntry);
+ virtual ~OStartMarker();
+
+ // SfxListener
+ virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+ // window overloads
+ virtual void Paint( const Rectangle& rRect );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ using Window::Notify;
+
+ void setTitle(const String& _sTitle);
+ sal_Int32 getWidth() const;
+ sal_Int32 getMinHeight() const;
+
+ /** returns the offset where the horizontal ruler must start
+ */
+ sal_Int32 getRulerOffset() const;
+
+ /** shows or hides the ruler.
+ */
+ void showRuler(sal_Bool _bShow);
+
+ virtual void setCollapsed(sal_Bool _bCollapsed);
+ };
+}
+#endif // RPTUI_STARTMARKER_HXX
+
diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx
new file mode 100644
index 000000000000..0ea4d14e39cc
--- /dev/null
+++ b/reportdesign/source/ui/inc/UITools.hxx
@@ -0,0 +1,157 @@
+#ifndef RPTUI_UITOOLS_HXX
+#define RPTUI_UITOOLS_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UITools.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XGROUP_HPP_
+#include <com/sun/star/report/XGroup.hpp>
+#endif
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+
+#include <rtl/ref.hxx>
+#include <vcl/taskpanelist.hxx>
+#include <comphelper/stl_types.hxx>
+#include <functional>
+
+class SdrPage;
+class SdrObject;
+class SdrView;
+class Rectangle;
+namespace comphelper
+{
+ class OPropertyChangeMultiplexer;
+ class OPropertyChangeListener;
+}
+namespace rptui
+{
+ /** returns the position of the object inside the index container
+ @param _xReportDefinition the report definition to get the groups
+ @param _xGroup the group to search
+ @return returns the position of the group in the list, otherwise -1
+ */
+ template<typename T> sal_Int32 getPositionInIndexAccess(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _xCollection
+ ,const ::com::sun::star::uno::Reference< T >& _xSearch)
+ {
+ sal_Int32 nCount = _xCollection->getCount();
+ sal_Int32 i = (nCount == 0) ? -1 : 0;
+ for (;i<nCount ; ++i)
+ {
+ ::com::sun::star::uno::Reference< T > xObject(_xCollection->getByIndex(i),::com::sun::star::uno::UNO_QUERY);
+ if ( xObject == _xSearch )
+ break;
+ } // for (;i<nCount ; ++i)
+ return i;
+ }
+
+ /** set the name of the header and footer of the group by the expression appended by the localized name of the section
+ @param _xGroup the group where the header/footer name is set by the expression of the group
+ */
+ void adjustSectionName(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup,sal_Int32 _nPos);
+
+ /** add a listener for the properties size, left margin, right margin to the page style
+ *
+ * \param _xReportDefinition
+ * \param _pListener
+ * \return
+ */
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> addStyleListener( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition
+ ,::comphelper::OPropertyChangeListener* _pListener);
+
+ /** opens the common character font dialog
+ */
+ bool openCharDialog(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat>& _xReportControlFormat,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _xWindow
+ );
+
+ /** opens the common character font dialog
+ */
+ bool openCharDialog(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat>& _xReportControlFormat,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _xWindow,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _out_rNewValues
+ );
+
+ /** applies the character settings previously obtained via openCharDialog
+ */
+ void applyCharacterSettings(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat >& _rxReportControlFormat,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rSettings
+ );
+
+ /** notifySystemWindow adds or remove the given window _pToRegister at the Systemwindow found when search _pWindow.
+ @param _pWindow
+ The window which is used to search for the SystemWindow.
+ @param _pToRegister
+ The window which should be added or removed on the TaskPaneList.
+ @param _rMemFunc
+ The member function which should be called at the SystemWindow when found.
+ Possible values are:
+ ::comphelper::mem_fun(&TaskPaneList::AddWindow)
+ ::comphelper::mem_fun(&TaskPaneList::RemoveWindow)
+ */
+ void notifySystemWindow(Window* _pWindow,Window* _pToRegister, ::comphelper::mem_fun1_t<TaskPaneList,Window*> _rMemFunc);
+
+ /** checks whether the given rectangle overlapps another OUnoObject object in that view.
+ *
+ * \param _rRect
+ * \param _rPage
+ * \param _bAllObjects if <TRUE/> all objects are taken into account, otherwise only not marked ones
+ * \return the object which is overlapped, otherwise <NULL/>
+ */
+ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects = false,SdrObject* _pIgnore = NULL);
+
+ /** checks whether the given OUnoObject object rectangle overlapps another object in that view.
+ *
+ * \param _pObj
+ * \param _rPage
+ * \param _rView
+ * \param _bAllObjects if <TRUE/> all objects are taken into account, otherwise only not marked ones
+ * \return the object which is overlapped, otherwise <NULL/>. If the given object is not of type OUnoObject <NULL/> will be returned.
+ */
+ SdrObject* isOver(SdrObject* _pObj,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects = false);
+
+ /** retrieves the names of the parameters of the command which the given RowSet is bound to
+ */
+ ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ getParameterNames( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet );
+}
+#endif //RPTUI_UITOOLS_HXX
+
diff --git a/reportdesign/source/ui/inc/Undo.hxx b/reportdesign/source/ui/inc/Undo.hxx
new file mode 100644
index 000000000000..06ce55f72b7a
--- /dev/null
+++ b/reportdesign/source/ui/inc/Undo.hxx
@@ -0,0 +1,176 @@
+#ifndef RPTUI_UNDO_HXX
+#define RPTUI_UNDO_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Undo.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_UNDOACTIONS_HXX
+#include "UndoActions.hxx"
+#endif
+#include <functional>
+
+FORWARD_DECLARE_INTERFACE(awt,XControl)
+FORWARD_DECLARE_INTERFACE(awt,XControlContainer)
+FORWARD_DECLARE_INTERFACE(drawing,XShape)
+namespace dbaui
+{
+ class IController;
+}
+namespace rptui
+{
+ class OObjectBase;
+
+
+ /** \class OSectionUndo
+ * Undo class for section add and remove.
+ */
+ class OSectionUndo : public OCommentUndoAction
+ {
+ OSectionUndo(const OSectionUndo&);
+ void operator =(const OSectionUndo&);
+ protected:
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape> >
+ m_aControls;
+ ::std::vector< ::std::pair< ::rtl::OUString ,::com::sun::star::uno::Any> >
+ m_aValues;
+ Action m_eAction;
+ sal_uInt16 m_nSlot;
+ bool m_bInserted;
+
+ virtual void implReInsert( ) = 0;
+ virtual void implReRemove( ) = 0;
+
+ void collectControls(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ public:
+ TYPEINFO();
+ OSectionUndo( OReportModel& rMod
+ ,sal_uInt16 _nSlot
+ ,Action _eAction
+ ,USHORT nCommentID);
+ virtual ~OSectionUndo();
+
+ virtual void Undo();
+ virtual void Redo();
+ };
+
+ /** Undo action for the group header, footer, page header, footer
+ */
+ class OReportSectionUndo : public OSectionUndo
+ {
+ OReportHelper m_aReportHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> m_pMemberFunction;
+
+ void implReInsert( );
+ void implReRemove( );
+ OReportSectionUndo(const OReportSectionUndo&);
+ void operator =(const OReportSectionUndo&);
+ public:
+ TYPEINFO();
+ //OReportSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ OReportSectionUndo( OReportModel& rMod
+ ,sal_uInt16 _nSlot
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport
+ ,Action _eAction
+ ,USHORT nCommentID);
+ virtual ~OReportSectionUndo();
+ };
+
+ /** Undo action for the group header, footer
+ */
+ class OGroupSectionUndo : public OSectionUndo
+ {
+ OGroupHelper m_aGroupHelper;
+ ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> m_pMemberFunction;
+
+ mutable ::rtl::OUString m_sName;
+
+ void implReInsert( );
+ void implReRemove( );
+ OGroupSectionUndo(const OGroupSectionUndo&);
+ void operator =(const OGroupSectionUndo&);
+ public:
+ TYPEINFO();
+ //OGroupSectionUndo( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ OGroupSectionUndo( OReportModel& rMod
+ ,sal_uInt16 _nSlot
+ ,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup
+ ,Action _eAction
+ ,USHORT nCommentID);
+
+ virtual String GetComment() const;
+ };
+
+ /** \class OToggleSlotUndo
+ * \brief calls the slot every time an undo or redo action is performed.
+ */
+ class OToggleSlotUndo : public OCommentUndoAction
+ {
+ sal_uInt16 m_nSlot;
+ public:
+ TYPEINFO();
+ OToggleSlotUndo(OReportModel& rMod,sal_uInt16 _nSlot,USHORT nCommentID);
+ virtual void Undo();
+ virtual void Redo();
+ };
+
+ /** /class OGroupUndo
+ * \brief Undo action for removing a group object.
+ */
+ class OGroupUndo : public OCommentUndoAction
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup> m_xGroup; ///<! the group for the undo redo action
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; ///<! the parent report definition
+ Action m_eAction; ///<! the current action
+ sal_Int32 m_nLastPosition; ///<! the last position of the group
+
+ void implReInsert( );
+ void implReRemove( );
+ public:
+ TYPEINFO();
+ OGroupUndo(OReportModel& rMod
+ ,USHORT nCommentID
+ ,Action _eAction
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
+ virtual void Undo();
+ virtual void Redo();
+ };
+}
+#endif // RPTUI_UNDO_HXX
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
new file mode 100644
index 000000000000..c411c4724ca4
--- /dev/null
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -0,0 +1,333 @@
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#define RPTUI_VIEWSWINDOW_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ViewsWindow.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#include "ReportDefines.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef _CPPUHELPER_BASEMUTEX_HXX_
+#include "cppuhelper/basemutex.hxx"
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+#ifndef _SVDEDTV_HXX
+#include <svx/svdedtv.hxx>
+#endif
+#include <SectionView.hxx>
+
+#include <list>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <MarkedSection.hxx>
+
+class Splitter;
+class SdrHdl;
+namespace comphelper
+{
+ class OPropertyChangeMultiplexer;
+}
+namespace rptui
+{
+ class OReportWindow;
+ class ODesignView;
+ class OEndMarker;
+ class OReportSection;
+ class OSectionView;
+
+ // -----------------------------------------------------------------------------
+ struct RectangleLess : public ::std::binary_function< Rectangle, Rectangle, bool>
+ {
+ enum CompareMode { POS_LEFT,POS_RIGHT,POS_UPPER,POS_DOWN,POS_CENTER_HORIZONTAL,POS_CENTER_VERTICAL };
+ CompareMode m_eCompareMode;
+ Point m_aRefPoint;
+ RectangleLess(CompareMode _eCompareMode,const Point& _rRefPoint ) : m_eCompareMode(_eCompareMode),m_aRefPoint(_rRefPoint){}
+ bool operator() (const Rectangle& lhs, const Rectangle& rhs) const
+ {
+ switch(m_eCompareMode)
+ {
+ case POS_LEFT:
+ return lhs.Left() < rhs.Left();
+ case POS_RIGHT:
+ return lhs.Right() >= rhs.Right();
+ case POS_UPPER:
+ return lhs.Top() < rhs.Top();
+ case POS_DOWN:
+ return lhs.Bottom() >= rhs.Bottom();
+ case POS_CENTER_HORIZONTAL:
+ return abs(m_aRefPoint.X() - lhs.Center().X()) < abs(m_aRefPoint.X() - rhs.Center().X());
+ case POS_CENTER_VERTICAL:
+ return abs(lhs.Center().Y() - m_aRefPoint.Y()) < abs(rhs.Center().Y() - m_aRefPoint.Y());
+ }
+ return false;
+ }
+ };
+
+ class OViewsWindow : public Window
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ , public SfxListener
+ , public IMarkedSection
+ {
+ typedef ::std::multimap<Rectangle,::std::pair<SdrObject*,OSectionView*>,RectangleLess> TRectangleMap;
+ public:
+ typedef ::std::pair< ::boost::shared_ptr<OEndMarker>,::boost::shared_ptr<Splitter> > TSplitterPair;
+ typedef ::std::pair< ::boost::shared_ptr<OReportSection> , ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> >
+ TReportPair;
+ typedef ::std::pair< TReportPair, TSplitterPair > TSectionPair;
+ typedef ::std::vector< TSectionPair > TSectionsMap;
+
+ struct TReportPairHelper : public ::std::unary_function< TSectionsMap::value_type, ::boost::shared_ptr<OReportSection> >
+ {
+ const ::boost::shared_ptr<OReportSection>& operator() (const TSectionsMap::value_type& lhs) const
+ {
+ return lhs.first.first;
+ }
+ };
+ private:
+ TSectionsMap m_aSections;
+ svtools::ColorConfig m_aColorConfig;
+ OReportWindow* m_pParent;
+ ::rtl::OUString m_sShapeType;
+ sal_Bool m_bInSplitHandler;
+ sal_Bool m_bInUnmark;
+
+ void ImplInitSettings();
+ /** returns the iterator at pos _nPos or the end()
+ */
+ TSectionsMap::iterator getIteratorAtPos(USHORT _nPos);
+ void collectRectangles(TRectangleMap& _rMap,bool _bBoundRects);
+ void collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection,bool _bBoundRects,Rectangle& _rBound,Rectangle& _rResize);
+
+ DECL_LINK(StartSplitHdl, Splitter*);
+ DECL_LINK(SplitHdl, Splitter*);
+ DECL_LINK(EndSplitHdl, Splitter*);
+
+ OViewsWindow(OViewsWindow&);
+ void operator =(OViewsWindow&);
+ protected:
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ // windows overload
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ using Window::Notify;
+ // SfxListener
+ virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+ public:
+ OViewsWindow( Window* _pParent,OReportWindow* _pReportWindow);
+ virtual ~OViewsWindow();
+
+ // windows overload
+ virtual void Resize();
+
+ /** late ctor
+ */
+ void initialize();
+
+ inline OReportWindow* getView() const { return m_pParent; }
+
+ /** removes the section at the given position.
+ *
+ * \param _nPosition Zero based.
+ */
+ void removeSection(USHORT _nPosition);
+
+ /** adds a new section at position _nPosition.
+ If the section is <NULL/> nothing happens.
+ If the position is grater than the current elements, the section will be appended.
+ */
+ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition = USHRT_MAX);
+
+ USHORT getSectionCount() const;
+ /** return the section at the given position
+ *
+ * \param _nPos
+ * \return the section at this pos or an empty section
+ */
+ ::boost::shared_ptr<OReportSection> getSection(const USHORT _nPos) const;
+
+ void showView(USHORT _nPos,BOOL _bShow);
+
+ /** turns the grid on or off
+ *
+ * \param _bVisible
+ */
+ void toggleGrid(sal_Bool _bVisible);
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ BOOL isDragStripes() const;
+
+ /** returns the total accumulated height of all sections until _pSection is reached
+ @param _pSection Defines the end of accumulation, can be <NULL/>
+ */
+ sal_Int32 getTotalHeight(const OReportSection* _pSection = NULL) const;
+
+ /** returns the height of the first spliiter.
+ */
+ sal_Int32 getSplitterHeight() const;
+
+ inline bool empty() const { return m_aSections.empty(); }
+ void SetMode( DlgEdMode m_eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed();
+
+ /** paste a new control in this section
+ */
+ void Paste();
+
+ /** Deletes the current selection in this section
+ *
+ */
+ void Delete();
+
+ /** All objects will be marked.
+ */
+ void SelectAll();
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection();
+
+ void SectionHasFocus(OReportSection* _pSection,BOOL _bHasFocus);
+
+ /** unmark all objects on the views without the given one.
+ *
+ * @param _pSectionView The view where the objects should not be unmarked.
+ */
+ void unmarkAllObjects(OSectionView* _pSectionView);
+
+ /** returns the report section window for the given xsection
+ @param _xSection the section
+ */
+ ::boost::shared_ptr<OReportSection> getReportSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** the the section as marked or not marked
+ @param _pSectionView the section where to set the marked flag
+ @param _bMark the marked flag
+ */
+ void setMarked(OSectionView* _pSectionView,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,sal_Bool _bMark);
+ void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape,sal_Bool _bMark);
+
+ /** get section from point inside.
+ @param _aPosition
+ */
+ ::boost::shared_ptr<OReportSection> getSection(const Point& _aPosition);
+
+ // IMarkedSection
+ ::boost::shared_ptr<OReportSection> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ virtual void markSection(const sal_uInt16 _nPos);
+
+ /** align all marked objects in all sections
+ */
+ void alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects = false);
+
+ /** shows the properties of the section corresponding to the end marker
+ *
+ * \param _pEndMarker must be not <NULL/>
+ */
+ void showProperties(const OEndMarker* _pEndMarker);
+
+ /** creates a default object
+ *
+ */
+ void createDefault();
+
+ /** returns the currently set shape type.
+ *
+ * \return \member m_sShapeType
+ */
+ inline ::rtl::OUString getShapeType() const { return m_sShapeType; }
+
+ /** returns the current position in the list
+ */
+ USHORT getPosition(const OReportSection* _pSection = NULL) const;
+
+ /** calls on every section BrkAction
+ *
+ */
+ void breakAction();
+
+ void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl);
+ void EndDragObj(BOOL _bCopy = FALSE);
+ void EndAction();
+
+ void MovAction(const Point& rPnt);
+
+ sal_uInt32 getMarkedObjectCount() const;
+ };
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // RPTUI_VIEWSWINDOW_HXX
+
diff --git a/reportdesign/source/ui/inc/dlgedclip.hxx b/reportdesign/source/ui/inc/dlgedclip.hxx
new file mode 100644
index 000000000000..403bebd4782a
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedclip.hxx
@@ -0,0 +1,98 @@
+#ifndef _REPORT_RPTUICLIP_HXX
+#define _REPORT_RPTUICLIP_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedclip.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _TRANSFER_HXX
+#include <svtools/transfer.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+
+namespace rptui
+{
+//============================================================================
+// OReportExchange
+//============================================================================
+/** \class OReportExchange
+ * \brief defines a clipboard fromat for copying selection elements.
+ * \ingroup reportdesign_source_ui_report
+ *
+ *
+ */
+class OReportExchange : public TransferableHelper
+{
+public:
+ typedef ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > TSectionElements;
+
+ /** Constructs a new exchange object with section elements
+ *
+ * \param _rCopyElements the elements to copy. Each section is one entry. The value must be a sequence of elements.
+ * \return
+ */
+ OReportExchange( const TSectionElements& _rCopyElements);
+
+ /** checks whether or not a descriptor can be extracted from the data flavor vector given
+ *
+ * \param _rFlavors
+ available flavors
+ * \return
+ */
+ static sal_Bool canExtract(const DataFlavorExVector& _rFlavors);
+
+ /** extract the section elements
+ *
+ * \param _rData the clipboard data
+ * \return the copied elements
+ */
+ static TSectionElements extractCopies(const TransferableDataHelper& _rData);
+
+ /** returns the format id.
+ *
+ * \return the registered format id
+ */
+ static sal_uInt32 getDescriptorFormatId();
+
+protected:
+ // TransferableHelper overridables
+ virtual void AddSupportedFormats();
+ virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
+private:
+ TSectionElements m_aCopyElements;
+};
+}
+#endif // _REPORT_RPTUICLIP_HXX
diff --git a/reportdesign/source/ui/inc/dlgedfac.hxx b/reportdesign/source/ui/inc/dlgedfac.hxx
new file mode 100644
index 000000000000..c8186e27e809
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedfac.hxx
@@ -0,0 +1,60 @@
+#ifndef _REPORT_RPTUIFAC_HXX
+#define _REPORT_RPTUIFAC_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedfac.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+
+#ifndef _SVDOBJ_HXX
+#include <svx/svdobj.hxx>
+#endif
+
+namespace rptui
+{
+ class OReportSection;
+//============================================================================
+// DlgEdFactory
+//============================================================================
+class DlgEdFactory
+{
+public:
+ DlgEdFactory();
+ ~DlgEdFactory();
+
+ DECL_LINK( MakeObject, SdrObjFactory * );
+};
+}
+#endif // _REPORT_RPTUIFAC_HXX
+
diff --git a/reportdesign/source/ui/inc/dlgedfunc.hxx b/reportdesign/source/ui/inc/dlgedfunc.hxx
new file mode 100644
index 000000000000..05ba9eeff8f2
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedfunc.hxx
@@ -0,0 +1,139 @@
+#ifndef _REPORT_RPTUIFUNC_HXX
+#define _REPORT_RPTUIFUNC_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedfunc.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+
+class Timer;
+class MouseEvent;
+class Point;
+class SdrTextObj;
+namespace rptui
+{
+
+class OReportSection;
+
+//============================================================================
+// DlgEdFunc
+//============================================================================
+
+class DlgEdFunc /* : public LinkHdl */
+{
+ DlgEdFunc(const DlgEdFunc&);
+ void operator =(const DlgEdFunc&);
+protected:
+ OReportSection* pParent;
+ Timer aScrollTimer;
+ Point m_aMDPos;
+
+ DECL_LINK( ScrollTimeout, Timer * );
+ void ForceScroll( const Point& rPos );
+ /** checks that no other object is overlapped.
+ *
+ * \param rMEvt
+ */
+ void checkMovementAllowed(const MouseEvent& rMEvt);
+
+ /** sets the correct mouse pointer when moving a object
+ *
+ * \param rMEvt
+ * \return <TRUE/> when the pointer was already set.
+ */
+ bool setMovementPointer(const MouseEvent& rMEvt);
+
+ bool isRectangleHit(const MouseEvent& rMEvt);
+
+public:
+ DlgEdFunc( OReportSection* pParent );
+ virtual ~DlgEdFunc();
+
+ virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
+ virtual BOOL MouseMove( const MouseEvent& rMEvt );
+
+ /** checks if the keycode is known by the child windows
+ @param _rCode the keycode
+ @return <TRUE/> if the keycode is handled otherwise <FALSE/>
+ */
+ virtual sal_Bool handleKeyEvent(const KeyEvent& _rEvent);
+
+ /** returns <TRUE/> if the mouse event is over an existing object
+ *
+ * \param rMEvt
+ * \return <TRUE/> if overlapping, otherwise <FALSE/>
+ */
+ bool isOverlapping(const MouseEvent& rMEvt);
+};
+
+//============================================================================
+// DlgEdFuncInsert
+//============================================================================
+
+class DlgEdFuncInsert : public DlgEdFunc
+{
+public:
+ DlgEdFuncInsert( OReportSection* pParent );
+ ~DlgEdFuncInsert();
+
+ virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
+ virtual BOOL MouseMove( const MouseEvent& rMEvt );
+};
+
+//============================================================================
+// DlgEdFuncSelect
+//============================================================================
+
+class DlgEdFuncSelect : public DlgEdFunc
+{
+protected:
+ BOOL bMarkAction;
+
+public:
+ DlgEdFuncSelect( OReportSection* pParent );
+ ~DlgEdFuncSelect();
+
+ virtual BOOL MouseButtonDown( const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonUp( const MouseEvent& rMEvt );
+ virtual BOOL MouseMove( const MouseEvent& rMEvt );
+
+ void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag);
+};
+
+}
+#endif //_REPORT_RPTUIFUNC_HXX
diff --git a/reportdesign/source/ui/inc/dlgpage.hxx b/reportdesign/source/ui/inc/dlgpage.hxx
new file mode 100644
index 000000000000..063cf7f0124b
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgpage.hxx
@@ -0,0 +1,64 @@
+#ifndef RPTUI_DLGPAGE_HXX
+#define RPTUI_DLGPAGE_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgpage.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SFXTABDLG_HXX //autogen
+#include <sfx2/tabdlg.hxx>
+#endif
+
+namespace rptui
+{
+/*************************************************************************
+|*
+|* Seite einrichten-Tab-Dialog
+|*
+\************************************************************************/
+class ORptPageDialog : public SfxTabDialog
+{
+private:
+ const SfxItemSet& rOutAttrs;
+
+ ORptPageDialog(const ORptPageDialog&);
+ void operator =(const ORptPageDialog&);
+public:
+
+ ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId);
+ virtual ~ORptPageDialog() {}
+};
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_DLGPAGE_HXX
diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx
new file mode 100644
index 000000000000..ad6b3c65c560
--- /dev/null
+++ b/reportdesign/source/ui/inc/metadata.hxx
@@ -0,0 +1,163 @@
+#ifndef RPTUI_METADATA_HXX_
+#define RPTUI_METADATA_HXX_
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: metadata.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+
+/** === begin UNO includes === **/
+#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_
+#include <com/sun/star/beans/Property.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XPROPERTYHANDLER_HPP_
+#include <com/sun/star/inspection/XPropertyHandler.hpp>
+#endif
+/** === end UNO includes === **/
+
+//............................................................................
+namespace rptui
+{
+//............................................................................
+
+ struct OPropertyInfoImpl;
+
+ //========================================================================
+ //= OPropertyInfoService
+ //========================================================================
+ class OPropertyInfoService
+ :public OModuleClient
+ {
+ OPropertyInfoService(const OPropertyInfoService&);
+ void operator =(const OPropertyInfoService&);
+ protected:
+ static sal_uInt16 s_nCount;
+ static OPropertyInfoImpl* s_pPropertyInfos;
+ // TODO: a real structure which allows quick access by name as well as by id
+
+ public:
+ OPropertyInfoService(){}
+ virtual ~OPropertyInfoService(){}
+ // IPropertyInfoService
+ sal_Int32 getPropertyId(const String& _rName) const;
+ String getPropertyTranslation(sal_Int32 _nId) const;
+ sal_Int32 getPropertyHelpId(sal_Int32 _nId) const;
+ sal_Int16 getPropertyPos(sal_Int32 _nId) const;
+ sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const;
+ void getPropertyEnumRepresentations(sal_Int32 _nId,::std::vector< ::rtl::OUString >& _rOut) const;
+ String getPropertyName( sal_Int32 _nPropId );
+ static void getExcludeProperties(::std::vector< com::sun::star::beans::Property >& _rExcludeProperties,const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler);
+
+ bool isComposable(
+ const ::rtl::OUString& _rPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler
+ );
+
+ protected:
+ static const OPropertyInfoImpl* getPropertyInfo();
+
+ static const OPropertyInfoImpl* getPropertyInfo(const String& _rName);
+ static const OPropertyInfoImpl* getPropertyInfo(sal_Int32 _nId);
+ };
+
+ //========================================================================
+ //= HelpIdUrl
+ //========================================================================
+ /// small helper to translate help ids into help urls
+ class HelpIdUrl
+ {
+ public:
+ static sal_uInt32 getHelpId( const ::rtl::OUString& _rHelpURL );
+ static ::rtl::OUString getHelpURL( sal_uInt32 _nHelpId );
+ };
+
+ //========================================================================
+ //= UI flags (for all browseable properties)
+ //========================================================================
+
+#define PROP_FLAG_NONE 0x00000001 // no special flag
+#define PROP_FLAG_ENUM 0x00000002 // the property is some kind of enum property, i.e. its
+ // value is chosen from a fixed list of possible values
+#define PROP_FLAG_ENUM_ONE 0x00000004 // the property is an enum property starting with 1
+ // (note that this includes PROP_FLAG_ENUM)
+#define PROP_FLAG_COMPOSEABLE 0x00000008 // the property is "composeable", i.e. an intersection of property
+ // sets should expose it, if all elements do
+#define PROP_FLAG_EXPERIMENTAL 0x00000010 // the property is experimental, i.e. should not appear in the
+ // UI, unless experimental properties are enabled by a configuraiton
+ // option
+#define PROP_FLAG_DATA_PROPERTY 0x00000020 // the property is to appear on the "Data" page
+
+ //========================================================================
+ //= property ids (for all browseable properties)
+ //========================================================================
+
+ #define PROPERTY_ID_FORCENEWPAGE 1
+ #define PROPERTY_ID_NEWROWORCOL 2
+ #define PROPERTY_ID_KEEPTOGETHER 3
+ #define PROPERTY_ID_CANGROW 4
+ #define PROPERTY_ID_CANSHRINK 5
+ #define PROPERTY_ID_REPEATSECTION 6
+ #define PROPERTY_ID_BACKCOLOR 7
+ #define PROPERTY_ID_VISIBLE 8
+ #define PROPERTY_ID_GROUPKEEPTOGETHER 9
+ #define PROPERTY_ID_PAGEHEADEROPTION 10
+ #define PROPERTY_ID_PAGEFOOTEROPTION 11
+ #define PROPERTY_ID_POSITIONX 12
+ #define PROPERTY_ID_POSITIONY 13
+ #define PROPERTY_ID_WIDTH 14
+ #define PROPERTY_ID_HEIGHT 15
+ #define PROPERTY_ID_FORMULA 16
+ #define PROPERTY_ID_PRINTREPEATEDVALUES 17
+ #define PROPERTY_ID_CONDITIONALPRINTEXPRESSION 18
+ #define PROPERTY_ID_INITIALFORMULA 19
+ #define PROPERTY_ID_STARTNEWCOLUMN 20
+ #define PROPERTY_ID_DATAFIELD 21
+ #define PROPERTY_ID_RESETPAGENUMBER 22
+ #define PROPERTY_ID_CONTROLBACKGROUND 23
+ #define PROPERTY_ID_CHARFONTNAME 25
+ #define PROPERTY_ID_PRINTWHENGROUPCHANGE 26
+ #define PROPERTY_ID_DEEPTRAVERSING 27
+ #define PROPERTY_ID_PREEVALUATED 28
+ #define PROPERTY_ID_PRESERVEIRI 29
+ #define PROPERTY_ID_BACKTRANSPARENT 30
+ #define PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT 31
+
+//............................................................................
+} // namespace rptui
+//............................................................................
+
+#endif // RPTUI_METADATA_HXX_
+
diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx
new file mode 100644
index 000000000000..67d4af41b0d9
--- /dev/null
+++ b/reportdesign/source/ui/inc/propbrw.hxx
@@ -0,0 +1,147 @@
+#ifndef _REPORT_PROPBRW_HXX
+#define _REPORT_PROPBRW_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: propbrw.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_XCONTROLCONTAINER_HPP_
+#include <com/sun/star/awt/XControlContainer.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XOBJECTINSPECTOR_HPP_
+#include <com/sun/star/inspection/XObjectInspector.hpp>
+#endif
+
+#ifndef _SFXBRDCST_HXX //autogen
+#include <svtools/brdcst.hxx>
+#endif
+
+#ifndef _SFXLSTNER_HXX //autogen
+#include <svtools/lstner.hxx>
+#endif
+
+#ifndef _SV_DOCKWIN_HXX
+#include <vcl/dockwin.hxx>
+#endif
+#ifndef _SVDMARK_HXX //autogen
+#include <svx/svdmark.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+
+namespace rptui
+{
+
+class OSectionView;
+class ODesignView;
+class OObjectBase;
+//============================================================================
+// PropBrw
+//============================================================================
+
+class PropBrw : public DockingWindow , public SfxListener, public SfxBroadcaster
+{
+private:
+ OModuleClient m_aModuleClient;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
+ m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
+ m_xMeAsFrame;
+ ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspector >
+ m_xBrowserController;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
+ m_xBrowserComponentWindow;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>
+ m_xLastSection; /// is the previously displayed section
+ ::rtl::OUString m_sLastActivePage;
+ ODesignView* m_pDesignView;
+ OSectionView* m_pView;
+ sal_Bool m_bInitialStateChange;
+
+ PropBrw(PropBrw&);
+ void operator =(PropBrw&);
+protected:
+
+ virtual void Resize();
+ virtual sal_Bool Close();
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >
+ CreateCompPropSet(const SdrMarkList& rMarkList);
+
+ void implSetNewObject(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >& _aObjects = ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >());
+
+ ::rtl::OUString GetHeadlineName(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> >& _aObjects);
+
+ void implDetachController();
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> CreateComponentPair(OObjectBase* _pObj);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> CreateComponentPair(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xFormComponent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
+ DECL_LINK( OnAsyncGetFocus, void* );
+
+public:
+ PropBrw(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xORB
+ ,Window* pParent
+ ,ODesignView* _pDesignView);
+ virtual ~PropBrw();
+
+ virtual void LoseFocus();
+
+ void Update( OSectionView* m_pView );
+ void Update( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xReportComponent);
+ inline OSectionView* GetCurView() const { return m_pView; }
+ ::rtl::OUString getCurrentPage() const;
+ inline void setCurrentPage(const ::rtl::OUString& _sLastActivePage) { m_sLastActivePage = _sLastActivePage; }
+private:
+ using Window::Update;
+};
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // _REPORT_PROPBRW_HXX
diff --git a/reportdesign/source/ui/inc/toolboxcontroller.hxx b/reportdesign/source/ui/inc/toolboxcontroller.hxx
new file mode 100644
index 000000000000..94235cd009b8
--- /dev/null
+++ b/reportdesign/source/ui/inc/toolboxcontroller.hxx
@@ -0,0 +1,113 @@
+#ifndef RPTUI_TOOLBOXCONTROLLER_HXX
+#define RPTUI_TOOLBOXCONTROLLER_HXX
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: toolboxcontroller.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_TOOLBOXCONTROLLER_HXX
+#include <svtools/toolboxcontroller.hxx>
+#endif
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSUBTOOLBARCONTROLLER_HPP_
+#include <com/sun/star/frame/XSubToolbarController.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _COMPHELPER_IMPLEMENTATIONREFERENCE_HXX
+#include <comphelper/implementationreference.hxx>
+#endif
+
+class SfxToolBoxControl;
+namespace rptui
+{
+ typedef ::cppu::ImplHelper2 < ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::frame::XSubToolbarController> TToolboxController_BASE;
+ typedef ::comphelper::ImplementationReference<SfxToolBoxControl,::com::sun::star::frame::XToolbarController> TToolbarHelper;
+
+ class OToolboxController : public ::svt::ToolboxController
+ ,public TToolboxController_BASE
+ {
+ DECLARE_STL_USTRINGACCESS_MAP(sal_Bool,TCommandState);
+ TCommandState m_aStates;
+ TToolbarHelper m_pToolbarController;
+ sal_uInt16 m_nToolBoxId;
+ sal_uInt16 m_nSlotId;
+ OToolboxController(const OToolboxController&);
+ void operator =(const OToolboxController&);
+ public:
+ OToolboxController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ virtual ~OToolboxController();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ // need by registration
+ static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
+ create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::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);
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ // XToolbarController
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createPopupWindow() throw (::com::sun::star::uno::RuntimeException);
+
+ // XSubToolbarController
+ virtual ::sal_Bool SAL_CALL opensSubToolbar( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getSubToolbarName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL functionSelected( const ::rtl::OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL updateImage( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException);
+ };
+//..........................................................................
+} // rptui
+//..........................................................................
+#endif //RPTUI_TOOLBOXCONTROLLER_HXX
+
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
new file mode 100644
index 000000000000..c8a0bc06d9c7
--- /dev/null
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -0,0 +1,314 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DefaultInspection.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_DEFAULTINSPECTION_HXX
+#include "DefaultInspection.hxx"
+#endif
+#include <comphelper/sequence.hxx>
+#ifndef _COM_SUN_STAR_UCB_ALREADYINITIALIZEDEXCEPTION_HPP_
+#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#endif
+#ifndef _REPORT_DLGRESID_HRC
+#include <RptResId.hrc>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+#include <tools/debug.hxx>
+#ifndef RPTUI_METADATA_HXX_
+#include "metadata.hxx"
+#endif
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+ //------------------------------------------------------------------------
+ sal_uInt32 HelpIdUrl::getHelpId( const ::rtl::OUString& _rHelpURL )
+ {
+ sal_uInt32 nHelpId = 0;
+ if ( 0 == _rHelpURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "HID:" ) ) )
+ nHelpId = _rHelpURL.copy( sizeof( "HID:" ) - 1 ).toInt32();
+ return nHelpId;
+ }
+
+ //------------------------------------------------------------------------
+ ::rtl::OUString HelpIdUrl::getHelpURL( sal_uInt32 _nHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.appendAscii( "HID:" );
+ aBuffer.append( (sal_Int32)_nHelpId );
+ return aBuffer.makeStringAndClear();
+ }
+
+ /** === begin UNO using === **/
+ using namespace com::sun::star::uno;
+ using namespace com::sun::star;
+ using com::sun::star::inspection::PropertyCategoryDescriptor;
+ /** === end UNO using === **/
+
+ //====================================================================
+ //= DefaultComponentInspectorModel
+ //====================================================================
+ DBG_NAME(DefaultComponentInspectorModel)
+ //--------------------------------------------------------------------
+ DefaultComponentInspectorModel::DefaultComponentInspectorModel( const Reference< XComponentContext >& _rxContext)
+ :m_xContext( _rxContext )
+ ,m_bConstructed( false )
+ ,m_bHasHelpSection( false )
+ ,m_bIsReadOnly(sal_False)
+ ,m_nMinHelpTextLines( 3 )
+ ,m_nMaxHelpTextLines( 8 )
+ ,m_pInfoService(new OPropertyInfoService())
+ {
+ DBG_CTOR(DefaultComponentInspectorModel,NULL);
+ }
+
+ //------------------------------------------------------------------------
+ DefaultComponentInspectorModel::~DefaultComponentInspectorModel()
+ {
+ DBG_DTOR(DefaultComponentInspectorModel,NULL);
+ }
+
+ //------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL DefaultComponentInspectorModel::getImplementationName( ) throw(RuntimeException)
+ {
+ return getImplementationName_Static();
+ }
+
+ //------------------------------------------------------------------------
+ sal_Bool SAL_CALL DefaultComponentInspectorModel::supportsService( const ::rtl::OUString& ServiceName ) throw(RuntimeException)
+ {
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+ }
+
+ //------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL DefaultComponentInspectorModel::getSupportedServiceNames( ) throw(RuntimeException)
+ {
+ return getSupportedServiceNames_static();
+ }
+
+ //------------------------------------------------------------------------
+ ::rtl::OUString DefaultComponentInspectorModel::getImplementationName_Static( ) throw(RuntimeException)
+ {
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.DefaultComponentInspectorModel"));
+ }
+
+ //------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > DefaultComponentInspectorModel::getSupportedServiceNames_static( ) throw(RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.inspection.DefaultComponentInspectorModel"));
+ return aSupported;
+ }
+
+ //------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL DefaultComponentInspectorModel::create( const Reference< XComponentContext >& _rxContext )
+ {
+ return *(new DefaultComponentInspectorModel( _rxContext ));
+ }
+
+ //--------------------------------------------------------------------
+ Sequence< Any > SAL_CALL DefaultComponentInspectorModel::getHandlerFactories() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+
+ // service names for all our handlers
+ const struct
+ {
+ const sal_Char* serviceName;
+ } aFactories[] = {
+
+ // a generic handler for form component properties (must precede the ButtonNavigationHandler)
+ { "com.sun.star.report.inspection.ReportComponentHandler"},
+ { "com.sun.star.report.inspection.GeometryHandler"},
+
+ // generic virtual edit properties
+ { "com.sun.star.form.inspection.EditPropertyHandler"},
+ };
+
+ const size_t nFactories = sizeof( aFactories ) / sizeof( aFactories[ 0 ] );
+ Sequence< Any > aReturn( nFactories );
+ Any* pReturn = aReturn.getArray();
+ for ( size_t i = 0; i < nFactories; ++i )
+ {
+ *pReturn++ <<= ::rtl::OUString::createFromAscii( aFactories[i].serviceName );
+ }
+
+ return aReturn;
+ }
+ //--------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DefaultComponentInspectorModel::getHasHelpSection() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bHasHelpSection;
+ }
+
+ //--------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultComponentInspectorModel::getMinHelpTextLines() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nMinHelpTextLines;
+ }
+ //--------------------------------------------------------------------
+ ::sal_Bool SAL_CALL DefaultComponentInspectorModel::getIsReadOnly() throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bIsReadOnly;
+ }
+ //--------------------------------------------------------------------
+ void SAL_CALL DefaultComponentInspectorModel::setIsReadOnly( ::sal_Bool _isreadonly ) throw (::com::sun::star::uno::RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_bIsReadOnly = _isreadonly;
+ }
+
+ //--------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultComponentInspectorModel::getMaxHelpTextLines() throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nMaxHelpTextLines;
+ }
+ //--------------------------------------------------------------------
+ void SAL_CALL DefaultComponentInspectorModel::initialize( const Sequence< Any >& _arguments ) throw (Exception, RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_bConstructed )
+ throw ucb::AlreadyInitializedException();
+
+ if ( !_arguments.hasElements() )
+ { // constructor: "createDefault()"
+ createDefault();
+ return;
+ }
+
+ sal_Int32 nMinHelpTextLines( 0 ), nMaxHelpTextLines( 0 );
+ if ( _arguments.getLength() == 2 )
+ { // constructor: "createWithHelpSection( long, long )"
+ if ( !( _arguments[0] >>= nMinHelpTextLines ) || !( _arguments[1] >>= nMaxHelpTextLines ) )
+ throw lang::IllegalArgumentException( ::rtl::OUString(), *this, 0 );
+ createWithHelpSection( nMinHelpTextLines, nMaxHelpTextLines );
+ return;
+ }
+
+ throw lang::IllegalArgumentException( ::rtl::OUString(), *this, 0 );
+ }
+
+ //--------------------------------------------------------------------
+ void DefaultComponentInspectorModel::createDefault()
+ {
+ m_bConstructed = true;
+ }
+ //--------------------------------------------------------------------
+ void DefaultComponentInspectorModel::createWithHelpSection( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines )
+ {
+ if ( ( _nMinHelpTextLines <= 0 ) || ( _nMaxHelpTextLines <= 0 ) || ( _nMinHelpTextLines > _nMaxHelpTextLines ) )
+ throw lang::IllegalArgumentException( ::rtl::OUString(), *this, 0 );
+
+ m_bHasHelpSection = true;
+ m_nMinHelpTextLines = _nMinHelpTextLines;
+ m_nMaxHelpTextLines = _nMaxHelpTextLines;
+ m_bConstructed = true;
+ }
+ //--------------------------------------------------------------------
+ Sequence< PropertyCategoryDescriptor > SAL_CALL DefaultComponentInspectorModel::describeCategories( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ const struct
+ {
+ const sal_Char* programmaticName;
+ USHORT uiNameResId;
+ sal_uInt32 helpId;
+ } aCategories[] = {
+ { "General", RID_STR_PROPPAGE_DEFAULT, HID_PROPDLG_TAB_GENERAL },
+ { "Data", RID_STR_PROPPAGE_DATA, HID_PROPDLG_TAB_DATA },
+ };
+
+ const size_t nCategories = sizeof( aCategories ) / sizeof( aCategories[0] );
+ Sequence< PropertyCategoryDescriptor > aReturn( nCategories );
+ PropertyCategoryDescriptor* pReturn = aReturn.getArray();
+ for ( size_t i=0; i<nCategories; ++i, ++pReturn )
+ {
+ pReturn->ProgrammaticName = ::rtl::OUString::createFromAscii( aCategories[i].programmaticName );
+ pReturn->UIName = String( ModuleRes( aCategories[i].uiNameResId ) );
+ pReturn->HelpURL = HelpIdUrl::getHelpURL( aCategories[i].helpId );
+ }
+
+ return aReturn;
+ }
+
+ //--------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL DefaultComponentInspectorModel::getPropertyOrderIndex( const ::rtl::OUString& _rPropertyName ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ const sal_Int32 nPropertyId( m_pInfoService->getPropertyId( _rPropertyName ) );
+ if ( nPropertyId != -1 )
+ return nPropertyId;
+
+ if ( !m_xComponent.is() )
+ try
+ {
+ m_xComponent.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.DefaultFormComponentInspectorModel")),m_xContext),UNO_QUERY_THROW);
+ }
+ catch(Exception)
+ {
+ return 0;
+ }
+
+ return m_xComponent->getPropertyOrderIndex(_rPropertyName);
+ }
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
new file mode 100644
index 000000000000..b341644c15b2
--- /dev/null
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -0,0 +1,1165 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: GeometryHandler.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_GEOMETRYHANDLER_HXX
+#include "GeometryHandler.hxx"
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#include "reportformula.hxx"
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
+#include <svtools/syslocale.hxx>
+#endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_STRINGREPRESENTATION_HPP_
+#include "com/sun/star/inspection/StringRepresentation.hpp"
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_PROPERTYLINEELEMENT_HPP_
+#include <com/sun/star/inspection/PropertyLineElement.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_PROPERTYCONTROLTYPE_HPP_
+#include <com/sun/star/inspection/PropertyControlType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XSTRINGLISTCONTROL_HPP_
+#include <com/sun/star/inspection/XStringListControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#include <com/sun/star/report/XShape.hpp>
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XFORMATTEDFIELD_HPP_
+#include <com/sun/star/report/XFormattedField.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XNUMERICCONTROL_HPP_
+#include <com/sun/star/inspection/XNumericControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_MEASUREUNIT_HPP_
+#include <com/sun/star/util/MeasureUnit.hpp>
+#endif
+#ifndef _VCL_FLDUNIT_HXX
+#include <vcl/fldunit.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#include "UITools.hxx"
+#ifndef _DBHELPER_DBEXCEPTION_HXX_
+#include <connectivity/dbexception.hxx>
+#endif
+#ifndef _DBHELPER_DBCONVERSION_HXX_
+#include <connectivity/dbconversion.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
+#endif
+#include <com/sun/star/report/XFixedLine.hpp>
+#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
+#include <com/sun/star/sdbc/XConnection.hpp>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _VCL_STDTEXT_HXX
+#include <vcl/stdtext.hxx>
+#endif
+#ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_
+#include <com/sun/star/sdb/SQLContext.hpp>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#include <boost/bind.hpp>
+#include <tools/string.hxx>
+#ifndef RPTUI_METADATA_HXX_
+#include "metadata.hxx"
+#endif
+
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet
+#include <svtools/itemset.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#define ITEMID_COLOR_TABLE SID_COLOR_TABLE
+#define ITEMID_DASH_LIST SID_DASH_LIST
+#define ITEMID_LINEEND_LIST SID_LINEEND_LIST
+#include <svx/xdef.hxx>
+#include <svx/xpool.hxx>
+#include <svx/xtable.hxx>
+#include <svx/xoutx.hxx>
+#ifndef _SVX_XLNWTIT_HXX
+#include <svx/xlnwtit.hxx>
+#endif
+#ifndef _SVX_XLNTRIT_HXX
+#include <svx/xlntrit.hxx>
+#endif
+#ifndef _SVX_XLNCLIT_HXX
+#include <svx/xlnclit.hxx>
+#endif
+#ifndef _SVX_XLNSTIT_HXX
+#include <svx/xlnstit.hxx>
+#endif
+#ifndef _SVX_XLNEDIT_HXX
+#include <svx/xlnedit.hxx>
+#endif
+#ifndef _SVX_XLNSTWIT_HXX
+#include <svx/xlnstwit.hxx>
+#endif
+#ifndef _SVX_XLNEDWIT_HXX
+#include <svx/xlnedwit.hxx>
+#endif
+#ifndef _SVX_XLNSTCIT_HXX
+#include <svx/xlnstcit.hxx>
+#endif
+#ifndef _SVX_XLNEDCIT_HXX
+#include <svx/xlnedcit.hxx>
+#endif
+#ifndef _SVX_XLNDSIT_HXX
+#include <svx/xlndsit.hxx>
+#endif
+#ifndef _SVX_XLINEIT0_HXX
+#include <svx/xlineit0.hxx>
+#endif
+
+#ifndef _SVX_SVXIDS_HRC
+#include <svx/svxids.hrc>
+#endif
+
+#define ITEMID_COLOR_TABLE SID_COLOR_TABLE
+#define ITEMID_DASH_LIST SID_DASH_LIST
+#define ITEMID_LINEEND_LIST SID_LINEEND_LIST
+#ifndef _SVX_DRAWITEM_HXX
+#include <svx/drawitem.hxx>
+#endif
+#define ITEMID_BRUSH SID_ATTR_BRUSH
+#ifndef _SVX_BRSHITEM_HXX //autogen
+#include <svx/brshitem.hxx>
+#endif
+#ifndef RPTUI_DLGPAGE_HXX
+#include "dlgpage.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#include <toolkit/helper/convert.hxx>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+using namespace ::com::sun::star;
+// using namespace comphelper;
+
+// comparing two property instances
+struct PropertyCompare : public ::std::binary_function< beans::Property, ::rtl::OUString , bool >
+{
+ bool operator() (const beans::Property& x, const ::rtl::OUString& y) const
+ {
+ return x.Name.equals(y);// ? true : false;
+ }
+ bool operator() (const ::rtl::OUString& x,const beans::Property& y) const
+ {
+ return x.equals(y.Name);// ? true : false;
+ }
+};
+void lcl_collectFunctionNames(const uno::Reference< report::XFunctions>& _xFunctions,::std::vector< ::rtl::OUString >& _rFunctionNames)
+{
+ const static ::rtl::OUString sLeftBracket(RTL_CONSTASCII_USTRINGPARAM("["));
+ const static ::rtl::OUString sRightBracket(RTL_CONSTASCII_USTRINGPARAM("]"));
+
+ const sal_Int32 nCount = _xFunctions->getCount();
+ for (sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ uno::Reference< report::XFunction > xFunction(_xFunctions->getByIndex(i),uno::UNO_QUERY);
+ ::rtl::OUString sName = sLeftBracket;
+ sName += xFunction->getName();
+ sName += sRightBracket;
+ _rFunctionNames.push_back(sName);
+ }
+}
+void lcl_collectFunctionNames(const uno::Reference< report::XSection>& _xSection,::std::vector< ::rtl::OUString >& _rFunctionNames)
+{
+ uno::Reference< report::XReportDefinition> xReportDefinition = _xSection->getReportDefinition();
+ uno::Reference< report::XGroups> xGroups = xReportDefinition->getGroups();
+ sal_Int32 nPos = -1;
+ uno::Reference< report::XGroup> xGroup = _xSection->getGroup();
+ if ( xGroup.is() )
+ nPos = getPositionInIndexAccess(xGroups.get(),xGroup);
+ else if ( _xSection == xReportDefinition->getDetail() )
+ nPos = xGroups->getCount()-1;
+
+ for (sal_Int32 i = 0 ; i <= nPos ; ++i)
+ {
+ xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY);
+ lcl_collectFunctionNames(xGroup->getFunctions(),_rFunctionNames);
+ }
+ lcl_collectFunctionNames(xReportDefinition->getFunctions(),_rFunctionNames);
+}
+// -----------------------------------------------------------------------------
+void lcl_convertFormulaTo(const uno::Any& _aPropertyValue,uno::Any& _rControlValue)
+{
+ ::rtl::OUString sName;
+ _aPropertyValue >>= sName;
+ sal_Int32 nLen = sName.getLength();
+ if ( nLen )
+ {
+ ReportFormula aFormula( sName );
+ _rControlValue <<= aFormula.getUndecoratedContent();
+ }
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString GeometryHandler::impl_convertToFormula( const uno::Any& _rControlValue )
+{
+ ::rtl::OUString sName;
+ _rControlValue >>= sName;
+
+ if ( !sName.getLength() )
+ return sName;
+
+ ReportFormula aParser( sName );
+ if ( aParser.isValid() )
+ return sName;
+
+ const ::rtl::OUString* pEnd = m_aFieldNames.getConstArray() + m_aFieldNames.getLength();
+ bool bIsField = ( ::std::find( m_aFieldNames.getConstArray(), pEnd, sName ) != pEnd );
+
+ pEnd = m_aParamNames.getConstArray() + m_aParamNames.getLength();
+ bool bIsParam = ( ::std::find( m_aParamNames.getConstArray(), pEnd, sName ) != pEnd );
+
+ aParser = ReportFormula( bIsField || bIsParam ? ReportFormula::Field : ReportFormula::Expression, sName );
+ return aParser.getCompleteFormula();
+}
+
+GeometryHandler::GeometryHandler(uno::Reference< uno::XComponentContext > const & context) :
+ GeometryHandler_Base(m_aMutex),
+ m_xContext(context),
+ m_pInfoService(new OPropertyInfoService())
+{
+ try
+ {
+ uno::Reference< lang::XMultiComponentFactory > xFac = m_xContext->getServiceManager();
+ m_xFormComponentHandler.set(xFac->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.FormComponentPropertyHandler")),m_xContext),uno::UNO_QUERY_THROW);
+ m_xTypeConverter.set(xFac->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter" )),m_xContext),uno::UNO_QUERY_THROW);
+ }
+ catch(const uno::Exception&)
+ {
+ }
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString SAL_CALL GeometryHandler::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------
+sal_Bool SAL_CALL GeometryHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL GeometryHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_static();
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString GeometryHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.GeometryHandler"));
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > GeometryHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.inspection.GeometryHandler"));
+ return aSupported;
+}
+
+//------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL GeometryHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
+{
+ return *(new GeometryHandler( _rxContext ));
+}
+// overload WeakComponentImplHelperBase::disposing()
+// This function is called upon disposing the component,
+// if your component needs special work when it becomes
+// disposed, do it here.
+void SAL_CALL GeometryHandler::disposing()
+{
+ ::comphelper::disposeComponent(m_xFormComponentHandler);
+}
+void SAL_CALL GeometryHandler::addEventListener(const uno::Reference< lang::XEventListener > & xListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->addEventListener(xListener);
+}
+
+void SAL_CALL GeometryHandler::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removeEventListener(aListener);
+}
+
+// inspection::XPropertyHandler:
+
+/********************************************************************************/
+void SAL_CALL GeometryHandler::inspect( const uno::Reference< uno::XInterface > & _rxInspectee ) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ try
+ {
+ uno::Reference< container::XNameContainer > xObjectAsContainer( _rxInspectee, uno::UNO_QUERY );
+ m_xReportComponent.set( xObjectAsContainer->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReportComponent" ) ) ), uno::UNO_QUERY );
+
+ const ::rtl::OUString sRowSet(RTL_CONSTASCII_USTRINGPARAM("RowSet"));
+ if ( xObjectAsContainer->hasByName( sRowSet ) )
+ {
+ uno::Any aRowSet = xObjectAsContainer->getByName(sRowSet);
+ aRowSet >>= m_xRowSet;
+ // forward the rowset to our delegator handler
+ uno::Reference< beans::XPropertySet > xProp( m_xFormComponentHandler,uno::UNO_QUERY );
+ xProp->setPropertyValue( sRowSet, aRowSet );
+ }
+ uno::Reference< report::XReportComponent> xReportComponent( m_xReportComponent, uno::UNO_QUERY );
+ uno::Reference< report::XSection> xSection( m_xReportComponent, uno::UNO_QUERY );
+ if ( !xSection.is() && xReportComponent.is() )
+ xSection = xReportComponent->getSection();
+ if ( xSection.is() )
+ lcl_collectFunctionNames( xSection, m_aFunctionNames );
+ }
+ catch(uno::Exception)
+ {
+ throw lang::NullPointerException();
+ }
+ m_xFormComponentHandler->inspect(m_xReportComponent);
+}
+
+uno::Any SAL_CALL GeometryHandler::getPropertyValue(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Any aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName );
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
+ case PROPERTY_ID_INITIALFORMULA:
+ case PROPERTY_ID_FORMULA:
+ case PROPERTY_ID_DATAFIELD:
+ lcl_convertFormulaTo(aPropertyValue,aPropertyValue);
+ break;
+ default:
+ break;
+ }
+ return aPropertyValue;
+}
+
+void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Any aNewValue = Value;
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ bool bHandled = false;
+ switch(nId)
+ {
+ case PROPERTY_ID_INITIALFORMULA:
+ case PROPERTY_ID_FORMULA:
+ case PROPERTY_ID_DATAFIELD:
+ // aNewValue <<= impl_convertToFormula( aNewValue );
+ break;
+ case PROPERTY_ID_POSITIONX:
+ case PROPERTY_ID_POSITIONY:
+ case PROPERTY_ID_HEIGHT:
+ case PROPERTY_ID_WIDTH:
+ {
+ uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ if ( xSourceReportComponent.is() ) // check only report components
+ {
+ sal_Int32 nNewValue = 0;
+ Value >>= nNewValue;
+ awt::Point aAwtPoint = xSourceReportComponent->getPosition();
+ awt::Size aAwtSize = xSourceReportComponent->getSize();
+ if ( nId == PROPERTY_ID_POSITIONX )
+ aAwtPoint.X = nNewValue;
+ else if ( nId == PROPERTY_ID_POSITIONY )
+ aAwtPoint.Y = nNewValue;
+ else if ( nId == PROPERTY_ID_HEIGHT )
+ aAwtSize.Height = nNewValue;
+ else if ( nId == PROPERTY_ID_WIDTH )
+ aAwtSize.Width = nNewValue;
+
+ checkPosAndSize(aAwtPoint,aAwtSize);
+ }
+ }
+ break;
+ case PROPERTY_ID_CHARFONTNAME:
+ {
+ uno::Reference< report::XReportControlFormat > xReportControlFormat( m_xReportComponent,uno::UNO_QUERY_THROW );
+ uno::Sequence< beans::NamedValue > aFontSettings;
+ OSL_VERIFY( Value >>= aFontSettings );
+ applyCharacterSettings( xReportControlFormat, aFontSettings );
+ bHandled = true;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if ( !bHandled )
+ m_xReportComponent->setPropertyValue(PropertyName, aNewValue);
+}
+
+// -----------------------------------------------------------------------------
+beans::PropertyState SAL_CALL GeometryHandler::getPropertyState(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_xFormComponentHandler->getPropertyState(PropertyName);
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::implCreateListLikeControl(
+ const uno::Reference< inspection::XPropertyControlFactory >& _rxControlFactory
+ ,inspection::LineDescriptor & out_Descriptor
+ ,sal_uInt16 _nResId
+ ,sal_Bool _bReadOnlyControl
+ ,sal_Bool _bTrueIfListBoxFalseIfComboBox
+ )
+{
+ const String aEntries = String( ModuleRes( _nResId ) );
+ implCreateListLikeControl(_rxControlFactory,out_Descriptor,aEntries,_bReadOnlyControl,_bTrueIfListBoxFalseIfComboBox);
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::implCreateListLikeControl(
+ const uno::Reference< inspection::XPropertyControlFactory >& _rxControlFactory
+ ,inspection::LineDescriptor & out_Descriptor
+ ,const ::rtl::OUString& _sEntries
+ ,sal_Bool _bReadOnlyControl
+ ,sal_Bool _bTrueIfListBoxFalseIfComboBox
+ )
+{
+ uno::Reference< inspection::XStringListControl > xListControl(
+ _rxControlFactory->createPropertyControl(
+ _bTrueIfListBoxFalseIfComboBox ? inspection::PropertyControlType::ListBox : inspection::PropertyControlType::ComboBox, _bReadOnlyControl
+ ),
+ uno::UNO_QUERY_THROW
+ );
+
+ out_Descriptor.Control = xListControl.get();
+ const String sEntries(_sEntries);
+ const xub_StrLen nCount = sEntries.GetTokenCount();
+ for ( xub_StrLen i=0; i < nCount; ++i )
+ xListControl->appendListEntry( sEntries.GetToken(i) );
+}
+// -----------------------------------------------------------------------------
+void lcl_collectParamNames_nothrow( const uno::Reference< container::XIndexAccess >& _rxParams, ::std::vector< ::rtl::OUString >& _out_rParamNames )
+{
+ _out_rParamNames.resize( 0 );
+ if ( !_rxParams.is() )
+ return;
+
+ try
+ {
+ sal_Int32 count( _rxParams->getCount() );
+ _out_rParamNames.reserve( count );
+
+ uno::Reference< beans::XPropertySet > xParam;
+ ::rtl::OUString sParamName;
+ for ( sal_Int32 i=0; i<count; ++i )
+ {
+ xParam.set( _rxParams->getByIndex(i), uno::UNO_QUERY_THROW );
+ OSL_VERIFY( xParam->getPropertyValue( PROPERTY_NAME ) >>= sParamName );
+ _out_rParamNames.push_back( sParamName );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const ::rtl::OUString & PropertyName, const uno::Reference< inspection::XPropertyControlFactory > & _xControlFactory) throw (beans::UnknownPropertyException, lang::NullPointerException,uno::RuntimeException)
+{
+ inspection::LineDescriptor aOut;
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_FORCENEWPAGE:
+ case PROPERTY_ID_NEWROWORCOL:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_FORCENEWPAGE_CONST,sal_False,sal_True);
+ break;
+ case PROPERTY_ID_GROUPKEEPTOGETHER:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_GROUPKEEPTOGETHER_CONST,sal_False,sal_True);
+ break;
+ case PROPERTY_ID_PAGEHEADEROPTION:
+ case PROPERTY_ID_PAGEFOOTEROPTION:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_REPORTPRINTOPTION_CONST,sal_False,sal_True);
+ break;
+
+ case PROPERTY_ID_VISIBLE:
+ case PROPERTY_ID_CANGROW:
+ case PROPERTY_ID_CANSHRINK:
+ case PROPERTY_ID_REPEATSECTION:
+ case PROPERTY_ID_PRINTREPEATEDVALUES:
+ case PROPERTY_ID_STARTNEWCOLUMN:
+ case PROPERTY_ID_RESETPAGENUMBER:
+ case PROPERTY_ID_PRINTWHENGROUPCHANGE:
+ case PROPERTY_ID_KEEPTOGETHER:
+ case PROPERTY_ID_DEEPTRAVERSING:
+ case PROPERTY_ID_PREEVALUATED:
+ case PROPERTY_ID_PRESERVEIRI:
+ case PROPERTY_ID_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ sal_uInt16 nResId = RID_STR_BOOL;
+ if ( PROPERTY_ID_KEEPTOGETHER == nId && uno::Reference< report::XGroup>(m_xReportComponent,uno::UNO_QUERY).is())
+ nResId = RID_STR_KEEPTOGETHER_CONST;
+ implCreateListLikeControl(_xControlFactory,aOut,nResId,sal_False,sal_True);
+ }
+ break;
+ case PROPERTY_ID_INITIALFORMULA:
+ case PROPERTY_ID_FORMULA:
+ case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField , sal_False);
+ break;
+ case PROPERTY_ID_DATAFIELD:
+ {
+ uno::Reference< inspection::XStringListControl > xListControl;
+ aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory);
+
+ xListControl.set( aOut.Control, uno::UNO_QUERY );
+ if ( xListControl.is() )
+ {
+ // the usual field names
+ m_aFieldNames = xListControl->getListEntries();
+
+ // add parameter names
+ m_aParamNames = getParameterNames( m_xRowSet );
+ ::std::for_each( m_aParamNames.getConstArray(), m_aParamNames.getConstArray() + m_aParamNames.getLength(),
+ ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl, _1 ) );
+
+ // add function names
+ ::std::for_each( m_aFunctionNames.begin(), m_aFunctionNames.end(),
+ ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl, _1 ) );
+ }
+ }
+ break;
+ case PROPERTY_ID_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::ColorListBox, sal_False );
+ break;
+ case PROPERTY_ID_CHARFONTNAME:
+ aOut.PrimaryButtonId = UID_RPT_PROP_DLG_FONT_TYPE;
+ aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True );
+ aOut.HasPrimaryButton = sal_True;
+ break;
+ default:
+ {
+ aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory);
+ }
+ }
+
+ if ( nId != -1 )
+ {
+ aOut.Category = ((m_pInfoService->getPropertyUIFlags(nId ) & PROP_FLAG_DATA_PROPERTY) != 0) ?
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"))
+ :
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("General"));
+ aOut.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( nId ) );
+ aOut.DisplayName = m_pInfoService->getPropertyTranslation(nId);
+ }
+
+ if ( ( nId == PROPERTY_ID_POSITIONX )
+ || ( nId == PROPERTY_ID_POSITIONY )
+ || ( nId == PROPERTY_ID_WIDTH )
+ || ( nId == PROPERTY_ID_HEIGHT )
+ )
+ {
+ const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+ const sal_Int16 nDisplayUnit = VCLUnoHelper::ConvertToMeasurementUnit( MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH, 1 );
+ uno::Reference< inspection::XNumericControl > xNumericControl(aOut.Control,uno::UNO_QUERY);
+ xNumericControl->setDecimalDigits( 2 );
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
+ xNumericControl->setValueUnit( util::MeasureUnit::MM_100TH );
+ if ( nDisplayUnit != -1 )
+ xNumericControl->setDisplayUnit( nDisplayUnit );
+ uno::Reference< report::XReportComponent> xComp(m_xReportComponent,uno::UNO_QUERY);
+ if ( xComp.is() )
+ {
+ OSL_ENSURE(xComp->getSection().is(),"No Section!");
+ uno::Reference< report::XReportDefinition > xReport = xComp->getSection()->getReportDefinition();
+ OSL_ENSURE(xReport.is(),"Why is the report definition NULL!");
+ if ( xReport.is() )
+ {
+ const awt::Size aSize = getStyleProperty<awt::Size>(xReport,PROPERTY_PAPERSIZE);
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN);
+ switch(nId)
+ {
+ case PROPERTY_ID_POSITIONX:
+ case PROPERTY_ID_POSITIONY:
+ case PROPERTY_ID_WIDTH:
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
+ xNumericControl->setMaxValue(beans::Optional<double>(sal_True,double(aSize.Width - nLeftMargin - nRightMargin) / 1000.0));
+ if ( PROPERTY_ID_WIDTH == nId )
+ {
+ uno::Reference<report::XFixedLine> xFixedLine(m_xReportComponent,uno::UNO_QUERY);
+ if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.08 ));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else if ( PROPERTY_ID_HEIGHT == nId )
+ {
+ uno::Reference< report::XSection> xSection(m_xReportComponent,uno::UNO_QUERY);
+ if ( xSection.is() )
+ {
+ sal_Int32 nHeight = 0;
+ const sal_Int32 nCount = xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference<drawing::XShape> xShape(xSection->getByIndex(i),uno::UNO_QUERY);
+ nHeight = ::std::max<sal_Int32>(nHeight,xShape->getPosition().Y + xShape->getSize().Height);
+ }
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,nHeight / 1000.0 ));
+ }
+ }
+ }
+ return aOut;
+}
+// -----------------------------------------------------------------------------
+beans::Property GeometryHandler::getProperty(const ::rtl::OUString & PropertyName)
+{
+ uno::Sequence< beans::Property > aProps = getSupportedProperties();
+ const beans::Property* pIter = aProps.getConstArray();
+ const beans::Property* pEnd = pIter + aProps.getLength();
+ const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(PropertyName)));
+ if ( pFind == pEnd )
+ return beans::Property();
+ return *pFind;
+}
+uno::Any GeometryHandler::getConstantValue(sal_Bool _bToControlValue,sal_uInt16 nResId,const uno::Any& _aValue,const ::rtl::OUString& _sConstantName,const ::rtl::OUString & PropertyName )
+{
+ const String sConstantValues = String(ModuleRes(nResId));
+
+ const xub_StrLen nCount = sConstantValues.GetTokenCount();
+ uno::Sequence< ::rtl::OUString > aSeq(nCount);
+ for (xub_StrLen i = 0; i < nCount; ++i)
+ {
+ aSeq[i] = sConstantValues.GetToken(i);
+ }
+ uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::createConstant( m_xContext,m_xTypeConverter
+ ,_sConstantName,aSeq);
+ if ( _bToControlValue )
+ {
+ return uno::makeAny( xConversionHelper->convertToControlValue( _aValue ) );
+ }
+ else
+ {
+ ::rtl::OUString sControlValue;
+ _aValue >>= sControlValue;
+ const beans::Property aProp = getProperty(PropertyName);
+ return xConversionHelper->convertToPropertyValue( sControlValue, aProp.Type );
+ }
+}
+
+uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & _rControlValue) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Any aPropertyValue( _rControlValue );
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_FORCENEWPAGE:
+ case PROPERTY_ID_NEWROWORCOL:
+ aPropertyValue = getConstantValue(sal_False,RID_STR_FORCENEWPAGE_CONST,_rControlValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ForceNewPage")),PropertyName);
+ break;
+ case PROPERTY_ID_GROUPKEEPTOGETHER:
+ aPropertyValue = getConstantValue(sal_False,RID_STR_GROUPKEEPTOGETHER_CONST,_rControlValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.GroupKeepTogether")),PropertyName);
+ break;
+ case PROPERTY_ID_PAGEHEADEROPTION:
+ case PROPERTY_ID_PAGEFOOTEROPTION:
+ aPropertyValue = getConstantValue(sal_False,RID_STR_REPORTPRINTOPTION_CONST,_rControlValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ReportPrintOption")),PropertyName);
+ break;
+ case PROPERTY_ID_KEEPTOGETHER:
+ if ( uno::Reference< report::XGroup>(m_xReportComponent,uno::UNO_QUERY).is())
+ {
+ aPropertyValue = getConstantValue(sal_False,RID_STR_KEEPTOGETHER_CONST,_rControlValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.KeepTogether")),PropertyName);
+ break;
+ }
+ // run through
+ case PROPERTY_ID_VISIBLE:
+ case PROPERTY_ID_CANGROW:
+ case PROPERTY_ID_CANSHRINK:
+ case PROPERTY_ID_REPEATSECTION:
+ case PROPERTY_ID_PRINTREPEATEDVALUES:
+ case PROPERTY_ID_STARTNEWCOLUMN:
+ case PROPERTY_ID_RESETPAGENUMBER:
+ case PROPERTY_ID_PRINTWHENGROUPCHANGE:
+ case PROPERTY_ID_DEEPTRAVERSING:
+ case PROPERTY_ID_PREEVALUATED:
+ case PROPERTY_ID_PRESERVEIRI:
+ case PROPERTY_ID_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ case PROPERTY_ID_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ if ( !aPropertyValue.hasValue() )
+ // NULL is converted to NULL
+ break;
+
+ const beans::Property aProp = getProperty(PropertyName);
+ if ( aPropertyValue.getValueType().equals( aProp.Type ) )
+ // nothing to do, type is already as desired
+ return aPropertyValue;
+
+ if ( _rControlValue.getValueType().getTypeClass() == uno::TypeClass_STRING )
+ {
+ ::rtl::OUString sControlValue;
+ _rControlValue >>= sControlValue;
+
+ uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::create( m_xContext,m_xTypeConverter );
+ aPropertyValue = xConversionHelper->convertToPropertyValue( sControlValue, aProp.Type );
+ }
+ else
+ {
+ try
+ {
+ aPropertyValue = m_xTypeConverter->convertTo( _rControlValue, aProp.Type );
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+ }
+ }
+ break;
+ }
+ case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
+ case PROPERTY_ID_INITIALFORMULA:
+ case PROPERTY_ID_FORMULA:
+ case PROPERTY_ID_DATAFIELD:
+ return uno::makeAny( impl_convertToFormula( _rControlValue ) );
+
+ case PROPERTY_ID_POSITIONX:
+ {
+ aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue);
+ sal_Int32 nPosX = 0;
+ aPropertyValue >>= nPosX;
+ uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ nPosX += getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ aPropertyValue <<= nPosX;
+ }
+ break;
+ case PROPERTY_ID_CHARFONTNAME:
+ return m_xFormComponentHandler->convertToPropertyValue(PROPERTY_FONTNAME, _rControlValue);
+ default:
+ return m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue);
+ }
+ return aPropertyValue;
+}
+
+uno::Any SAL_CALL GeometryHandler::convertToControlValue(const ::rtl::OUString & PropertyName, const uno::Any & _rPropertyValue, const uno::Type & _rControlValueType) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ uno::Any aControlValue( _rPropertyValue );
+ if ( !aControlValue.hasValue() )
+ // NULL is converted to NULL
+ return aControlValue;
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_FORCENEWPAGE:
+ case PROPERTY_ID_NEWROWORCOL:
+ aControlValue = getConstantValue(sal_True,RID_STR_FORCENEWPAGE_CONST,_rPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ForceNewPage")),PropertyName);
+ break;
+ case PROPERTY_ID_GROUPKEEPTOGETHER:
+ aControlValue = getConstantValue(sal_True,RID_STR_GROUPKEEPTOGETHER_CONST,_rPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.GroupKeepTogether")),PropertyName);
+ break;
+ case PROPERTY_ID_PAGEHEADEROPTION:
+ case PROPERTY_ID_PAGEFOOTEROPTION:
+ aControlValue = getConstantValue(sal_True,RID_STR_REPORTPRINTOPTION_CONST,_rPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ReportPrintOption")),PropertyName);
+ break;
+ case PROPERTY_ID_KEEPTOGETHER:
+ if ( uno::Reference< report::XGroup>(m_xReportComponent,uno::UNO_QUERY).is())
+ {
+ aControlValue = getConstantValue(sal_True,RID_STR_KEEPTOGETHER_CONST,_rPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.KeepTogether")),PropertyName);
+ break;
+ }
+ // run through
+ case PROPERTY_ID_VISIBLE:
+ case PROPERTY_ID_CANGROW:
+ case PROPERTY_ID_CANSHRINK:
+ case PROPERTY_ID_REPEATSECTION:
+ case PROPERTY_ID_PRINTREPEATEDVALUES:
+ case PROPERTY_ID_STARTNEWCOLUMN:
+ case PROPERTY_ID_RESETPAGENUMBER:
+ case PROPERTY_ID_PRINTWHENGROUPCHANGE:
+ case PROPERTY_ID_DEEPTRAVERSING:
+ case PROPERTY_ID_PREEVALUATED:
+ case PROPERTY_ID_PRESERVEIRI:
+ case PROPERTY_ID_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ case PROPERTY_ID_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ if ( _rControlValueType.getTypeClass() == uno::TypeClass_STRING )
+ {
+ uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::create( m_xContext,m_xTypeConverter );
+ aControlValue <<= xConversionHelper->convertToControlValue( _rPropertyValue );
+ }
+ else
+ {
+ try
+ {
+ aControlValue = m_xTypeConverter->convertTo( _rPropertyValue, _rControlValueType );
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "GeometryHandler::convertToControlValue: caught an exception while converting via TypeConverter!" );
+ }
+ }
+ break;
+ }
+ case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
+ case PROPERTY_ID_INITIALFORMULA:
+ case PROPERTY_ID_FORMULA:
+ case PROPERTY_ID_DATAFIELD:
+ lcl_convertFormulaTo(_rPropertyValue,aControlValue);
+ break;
+ case PROPERTY_ID_CHARFONTNAME:
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PROPERTY_FONTNAME, _rPropertyValue, _rControlValueType);
+ break;
+ case PROPERTY_ID_POSITIONX:
+ {
+ uno::Any aTemp = _rPropertyValue;
+ sal_Int32 nPosX = 0;
+ aTemp >>= nPosX;
+ uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ nPosX -= getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ aTemp <<= nPosX;
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, aTemp, _rControlValueType);
+ }
+ break;
+ default:
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, _rPropertyValue, _rControlValueType);
+ }
+ return aControlValue;
+}
+
+void SAL_CALL GeometryHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & Listener) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ m_xFormComponentHandler->addPropertyChangeListener(Listener);
+}
+
+void SAL_CALL GeometryHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removePropertyChangeListener(_rxListener);
+}
+// -----------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedProperties() throw (uno::RuntimeException)
+{
+ ::std::vector< beans::Property > aNewProps;
+ aNewProps.reserve(20); // only a guess
+ m_pInfoService->getExcludeProperties( aNewProps, m_xFormComponentHandler );
+
+ const ::rtl::OUString pIncludeProperties[] =
+ {
+ PROPERTY_FORCENEWPAGE
+// ,PROPERTY_NEWROWORCOL
+ ,PROPERTY_KEEPTOGETHER
+ ,PROPERTY_CANGROW
+ ,PROPERTY_CANSHRINK
+ ,PROPERTY_REPEATSECTION
+ ,PROPERTY_PRINTREPEATEDVALUES
+ ,PROPERTY_CONDITIONALPRINTEXPRESSION
+ ,PROPERTY_STARTNEWCOLUMN
+ ,PROPERTY_RESETPAGENUMBER
+ ,PROPERTY_PRINTWHENGROUPCHANGE
+ ,PROPERTY_VISIBLE
+// ,PROPERTY_GROUPKEEPTOGETHER
+ ,PROPERTY_PAGEHEADEROPTION
+ ,PROPERTY_PAGEFOOTEROPTION
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlLabel"))
+ ,PROPERTY_POSITIONX
+ ,PROPERTY_POSITIONY
+ ,PROPERTY_WIDTH
+ ,PROPERTY_HEIGHT
+ ,PROPERTY_PREEVALUATED
+ ,PROPERTY_DEEPTRAVERSING
+ ,PROPERTY_FORMULA
+ ,PROPERTY_INITIALFORMULA
+ ,PROPERTY_PRESERVEIRI
+ ,PROPERTY_DATAFIELD
+ ,PROPERTY_CHARFONTNAME
+ ,PROPERTY_BACKCOLOR
+ ,PROPERTY_BACKTRANSPARENT
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ ,PROPERTY_LABEL
+ };
+ uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo();
+ uno::Sequence< beans::Property> aSeq = xInfo->getProperties();
+ for (size_t i = 0; i < sizeof(pIncludeProperties)/sizeof(pIncludeProperties[0]) ;++i )
+ {
+ const beans::Property* pIter = aSeq.getConstArray();
+ const beans::Property* pEnd = pIter + aSeq.getLength();
+ const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(pIncludeProperties[i])));
+ if ( pFind != pEnd )
+ {
+ aNewProps.push_back(*pFind);
+ }
+ }
+
+ return uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL GeometryHandler::getSupersededProperties() throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aRet;
+ uno::Reference<report::XReportDefinition> xReport(m_xReportComponent,uno::UNO_QUERY);
+ if ( xReport.is() && !uno::Reference< report::XSection>(xReport->getParent(),uno::UNO_QUERY).is() )
+ {
+ aRet.realloc(5);
+ ::rtl::OUString* pIter = aRet.getArray();
+ *pIter++ = PROPERTY_POSITIONX;
+ *pIter++ = PROPERTY_POSITIONY;
+ *pIter++ = PROPERTY_WIDTH;
+ *pIter++ = PROPERTY_HEIGHT;
+ *pIter++ = PROPERTY_DATAFIELD;
+ }
+ return aRet;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL GeometryHandler::getActuatingProperties() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_xFormComponentHandler->getActuatingProperties();
+}
+
+::sal_Bool SAL_CALL GeometryHandler::isComposable(const ::rtl::OUString & _rPropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_pInfoService->isComposable( _rPropertyName, m_xFormComponentHandler );
+}
+
+inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, uno::Any & _rData, const uno::Reference< inspection::XObjectInspectorUI > & _rxInspectorUI) throw (uno::RuntimeException, beans::UnknownPropertyException, lang::NullPointerException)
+{
+ if ( !_rxInspectorUI.is() )
+ throw lang::NullPointerException();
+ if ( PropertyName.equalsAscii(PROPERTY_FILTER) )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ ::rtl::OUString sClause;
+ if ( impl_dialogFilter_nothrow( sClause, aGuard ) )
+ {
+ _rData <<= sClause;
+ eResult = inspection::InteractiveSelectionResult_ObtainedValue;
+ }
+ return eResult;
+ }
+ else if ( PropertyName.equalsAscii(PROPERTY_CHARFONTNAME) )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ uno::Reference< report::XReportControlFormat> xReportControlFormat(m_xReportComponent,uno::UNO_QUERY);
+ aGuard.clear();
+
+ uno::Sequence< beans::NamedValue > aFontSettings;
+ if ( rptui::openCharDialog( xReportControlFormat, xInspectorWindow, aFontSettings ) )
+ {
+ _rData <<= aFontSettings;
+ eResult = inspection::InteractiveSelectionResult_ObtainedValue;
+ }
+ return eResult;
+ }
+
+ return m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, _rData, _rxInspectorUI);
+}
+
+void SAL_CALL GeometryHandler::actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const uno::Any & NewValue, const uno::Any & OldValue, const uno::Reference< inspection::XObjectInspectorUI > & _rxInspectorUI, ::sal_Bool FirstTimeInit) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ if ( !_rxInspectorUI.is() )
+ throw lang::NullPointerException();
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, _rxInspectorUI, FirstTimeInit);
+}
+
+::sal_Bool SAL_CALL GeometryHandler::suspend(::sal_Bool Suspend) throw (uno::RuntimeException)
+{
+ return m_xFormComponentHandler->suspend(Suspend);
+}
+bool GeometryHandler::impl_dialogFilter_nothrow( ::rtl::OUString& _out_rSelectedClause, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
+{
+ _out_rSelectedClause = ::rtl::OUString();
+ bool bSuccess = false;
+ ::dbtools::SQLExceptionInfo aErrorInfo;
+ uno::Reference< awt::XWindow > xInspectorWindow;
+ uno::Reference< lang::XMultiComponentFactory > xFactory;
+ uno::Reference<lang::XMultiServiceFactory> xServiceFactory;
+ try
+ {
+ xFactory = m_xContext->getServiceManager();
+ xServiceFactory.set(xFactory,uno::UNO_QUERY);
+ xInspectorWindow.set(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ uno::Reference<sdbc::XConnection> xCon(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection"))) ,uno::UNO_QUERY);
+ if ( !xCon.is() )
+ return false;
+
+ uno::Reference< beans::XPropertySet> xRowSetProp(m_xRowSet,uno::UNO_QUERY);
+ if ( !m_xRowSet.is() )
+ {
+ m_xRowSet.set(xFactory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.RowSet")),m_xContext),uno::UNO_QUERY);
+ xRowSetProp.set(m_xRowSet,uno::UNO_QUERY);
+ xRowSetProp->setPropertyValue(PROPERTY_ACTIVECONNECTION,uno::makeAny(xCon));
+ ::comphelper::copyProperties(m_xReportComponent,xRowSetProp);
+ }
+
+ // get a composer for the statement which the form is currently based on
+ uno::Reference< sdb::XSingleSelectQueryComposer > xComposer( ::dbtools::getCurrentSettingsComposer( xRowSetProp, xServiceFactory ) );
+ OSL_ENSURE( xComposer.is(), "GeometryHandler::impl_dialogFilter_nothrow: could not obtain a composer!" );
+ if ( !xComposer.is() )
+ return false;
+
+ // create the dialog
+ uno::Reference< ui::dialogs::XExecutableDialog > xDialog(xFactory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.FilterDialog")),m_xContext),uno::UNO_QUERY);
+ if ( !xDialog.is() )
+ {
+ Window* pInspectorWindow = VCLUnoHelper::GetWindow( xInspectorWindow );
+ ShowServiceNotAvailableError( pInspectorWindow, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.FilterDialog")), sal_True );
+ return false;
+ }
+
+ const ::rtl::OUString sPropertyUIName( String(ModuleRes(RID_STR_FILTER)) );
+ // initialize the dialog
+ uno::Reference< beans::XPropertySet > xDialogProps( xDialog, uno::UNO_QUERY_THROW );
+ xDialogProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "QueryComposer" ) ), uno::makeAny( xComposer ) );
+ xDialogProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RowSet" ) ), uno::makeAny( m_xRowSet ) );
+ xDialogProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ParentWindow" ) ), uno::makeAny( xInspectorWindow ) );
+ xDialogProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), uno::makeAny( sPropertyUIName ) );
+
+ _rClearBeforeDialog.clear();
+ bSuccess = ( xDialog->execute() != 0 );
+ if ( bSuccess )
+ _out_rSelectedClause = xComposer->getFilter();
+ }
+ catch (sdb::SQLContext& e) { aErrorInfo = e; }
+ catch (sdbc::SQLWarning& e) { aErrorInfo = e; }
+ catch (sdbc::SQLException& e) { aErrorInfo = e; }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" );
+ }
+
+ if ( aErrorInfo.isValid() )
+ ::dbtools::showError( aErrorInfo, xInspectorWindow, xServiceFactory );
+
+ return bSuccess;
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos,
+ const awt::Size& _aSize)
+{
+ uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY);
+ if ( !xSection.is() || uno::Reference< report::XShape>(xSourceReportComponent,uno::UNO_QUERY).is() ) // shapes can overlap.
+ return;
+
+ ::Point aPos(VCLPoint(_aNewPos));
+ if ( aPos.X() < 0 || aPos.Y() < 0 ) // TODO: have to check size with pos aka || (aPos.X() + aAwtSize.Width) > m_xSection->getReportDefinition()->
+ throw beans::PropertyVetoException(String(ModuleRes(RID_STR_ILLEGAL_POSITION)),xSourceReportComponent);
+
+ ::Rectangle aSourceRect(aPos,VCLSize(_aSize));
+
+ sal_Int32 nCount = xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ uno::Reference< report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY);
+ if ( xReportComponent.is() && xReportComponent != xSourceReportComponent )
+ {
+ ::Rectangle aBoundRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize()));
+ ::Rectangle aRect = aSourceRect.GetIntersection(aBoundRect);
+ if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ throw beans::PropertyVetoException(String(ModuleRes( RID_STR_OVERLAP_OTHER_CONTROL)),xSourceReportComponent);
+ }
+ }
+}
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
new file mode 100644
index 000000000000..6a681724d797
--- /dev/null
+++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportComponentHandler.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_REPORTCOMPONENTHANDLER_HXX
+#include "ReportComponentHandler.hxx"
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COMPHELPER_SEQUENCE_HXX_
+#include <comphelper/sequence.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
+#include <svtools/syslocale.hxx>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_PROPERTYCONTROLTYPE_HPP_
+#include <com/sun/star/inspection/PropertyControlType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XREPORTDEFINITION_HPP_
+#include <com/sun/star/report/XReportDefinition.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XNUMERICCONTROL_HPP_
+#include <com/sun/star/inspection/XNumericControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_MEASUREUNIT_HPP_
+#include <com/sun/star/util/MeasureUnit.hpp>
+#endif
+#ifndef _VCL_FLDUNIT_HXX
+#include <vcl/fldunit.hxx>
+#endif
+#ifndef RPTUI_METADATA_HXX_
+#include "metadata.hxx"
+#endif
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+using namespace ::com::sun::star;
+// using namespace comphelper;
+
+ReportComponentHandler::ReportComponentHandler(uno::Reference< uno::XComponentContext > const & context)
+ :ReportComponentHandler_Base(m_aMutex)
+ ,m_xContext(context)
+ ,m_pInfoService( new OPropertyInfoService() )
+{
+ try
+ {
+ m_xFormComponentHandler.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.FormComponentPropertyHandler")),m_xContext),uno::UNO_QUERY_THROW);
+
+ }catch(uno::Exception)
+ {
+ }
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ReportComponentHandler::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------
+sal_Bool SAL_CALL ReportComponentHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL ReportComponentHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_static();
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString ReportComponentHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.ReportComponentHandler"));
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > ReportComponentHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.inspection.ReportComponentHandler"));
+ return aSupported;
+}
+
+//------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL ReportComponentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
+{
+ return *(new ReportComponentHandler( _rxContext ));
+}
+// overload WeakComponentImplHelperBase::disposing()
+// This function is called upon disposing the component,
+// if your component needs special work when it becomes
+// disposed, do it here.
+void SAL_CALL ReportComponentHandler::disposing()
+{
+ ::comphelper::disposeComponent(m_xFormComponentHandler);
+}
+void SAL_CALL ReportComponentHandler::addEventListener(const uno::Reference< lang::XEventListener > & xListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->addEventListener(xListener);
+}
+
+void SAL_CALL ReportComponentHandler::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removeEventListener(aListener);
+}
+
+// inspection::XPropertyHandler:
+
+/********************************************************************************/
+void SAL_CALL ReportComponentHandler::inspect(const uno::Reference< uno::XInterface > & Component) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ try
+ {
+ uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY);
+ ::rtl::OUString sFormComponent(RTL_CONSTASCII_USTRINGPARAM("FormComponent"));
+ if ( xNameCont->hasByName(sFormComponent) )
+ xNameCont->getByName(sFormComponent) >>= m_xFormComponent;
+ ::rtl::OUString sRowSet(RTL_CONSTASCII_USTRINGPARAM("RowSet"));
+ if ( xNameCont->hasByName(sRowSet) )
+ {
+ uno::Reference<beans::XPropertySet> xProp(m_xFormComponentHandler,uno::UNO_QUERY);
+ xProp->setPropertyValue(sRowSet,xNameCont->getByName(sRowSet));
+ }
+ }
+ catch(uno::Exception)
+ {
+ throw lang::NullPointerException();
+ }
+ if ( m_xFormComponent.is() )
+ {
+ m_xFormComponentHandler->inspect(m_xFormComponent);
+ }
+}
+
+uno::Any SAL_CALL ReportComponentHandler::getPropertyValue(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_xFormComponentHandler->getPropertyValue(PropertyName);
+}
+
+void SAL_CALL ReportComponentHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ m_xFormComponentHandler->setPropertyValue(PropertyName, Value);
+}
+
+beans::PropertyState SAL_CALL ReportComponentHandler::getPropertyState(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_xFormComponentHandler->getPropertyState(PropertyName);
+}
+
+inspection::LineDescriptor SAL_CALL ReportComponentHandler::describePropertyLine(const ::rtl::OUString & PropertyName, const uno::Reference< inspection::XPropertyControlFactory > & ControlFactory) throw (beans::UnknownPropertyException, lang::NullPointerException,uno::RuntimeException)
+{
+ return m_xFormComponentHandler->describePropertyLine(PropertyName, ControlFactory);
+}
+
+uno::Any SAL_CALL ReportComponentHandler::convertToPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & ControlValue) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_xFormComponentHandler->convertToPropertyValue(PropertyName, ControlValue);
+}
+
+uno::Any SAL_CALL ReportComponentHandler::convertToControlValue(const ::rtl::OUString & PropertyName, const uno::Any & PropertyValue, const uno::Type & ControlValueType) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_xFormComponentHandler->convertToControlValue(PropertyName, PropertyValue, ControlValueType);
+}
+
+void SAL_CALL ReportComponentHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & Listener) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ m_xFormComponentHandler->addPropertyChangeListener(Listener);
+}
+
+void SAL_CALL ReportComponentHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removePropertyChangeListener(_rxListener);
+}
+
+uno::Sequence< beans::Property > SAL_CALL ReportComponentHandler::getSupportedProperties() throw (uno::RuntimeException)
+{
+ ::std::vector< beans::Property > aNewProps;
+ m_pInfoService->getExcludeProperties( aNewProps, m_xFormComponentHandler );
+
+ return aNewProps.empty() ? uno::Sequence< beans::Property > () : uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL ReportComponentHandler::getSupersededProperties() throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aRet;
+ return aRet;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL ReportComponentHandler::getActuatingProperties() throw (uno::RuntimeException)
+{
+ return m_xFormComponentHandler->getActuatingProperties();
+}
+
+::sal_Bool SAL_CALL ReportComponentHandler::isComposable( const ::rtl::OUString& _rPropertyName ) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_pInfoService->isComposable( _rPropertyName, m_xFormComponentHandler );
+}
+
+inspection::InteractiveSelectionResult SAL_CALL ReportComponentHandler::onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, uno::Any & out_Data, const uno::Reference< inspection::XObjectInspectorUI > & InspectorUI) throw (uno::RuntimeException, beans::UnknownPropertyException, lang::NullPointerException)
+{
+ return m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, out_Data, InspectorUI);
+}
+
+void SAL_CALL ReportComponentHandler::actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const uno::Any & NewValue, const uno::Any & OldValue, const uno::Reference< inspection::XObjectInspectorUI > & InspectorUI, ::sal_Bool FirstTimeInit) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
+}
+
+::sal_Bool SAL_CALL ReportComponentHandler::suspend(::sal_Bool Suspend) throw (uno::RuntimeException)
+{
+ return m_xFormComponentHandler->suspend(Suspend);
+}
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/ui/inspection/inspection.src b/reportdesign/source/ui/inspection/inspection.src
new file mode 100644
index 000000000000..3521b07ebc43
--- /dev/null
+++ b/reportdesign/source/ui/inspection/inspection.src
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: inspection.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+String RID_STR_PROPPAGE_DEFAULT
+{
+ Text [ de ] = "Allgemein" ;
+ Text [ en-US ] = "General" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPPAGE_DATA
+{
+ Text [ de ] = "Daten" ;
+ Text [ en-US ] = "Data" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_BOOL
+{
+ Text [ de ] = "Nein;Ja" ;
+ Text [ en-US ] = "No;Yes" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_FORCENEWPAGE
+{
+ Text [ de ] = "Neue Seite erzwingen" ;
+ Text [ en-US ] = "Force New Page" ;
+};
+String RID_STR_FORCENEWPAGE_CONST
+{
+ Text [ de ] = "Nein;Bevor Sektion;Nach Sektion;Bevor und Nach Sektion" ;
+ Text [ en-US ] = "None;Before Section;After Section;Before & After Section" ;
+};
+String RID_STR_NEWROWORCOL
+{
+ Text [ de ] = "Neue Zeile oder Spalte" ;
+ Text [ en-US ] = "New Row Or Column" ;
+};
+String RID_STR_KEEPTOGETHER
+{
+ Text [ de ] = "Keep Together" ;
+ Text [ en-US ] = "Keep Together" ;
+};
+String RID_STR_KEEPTOGETHER_CONST
+{
+ Text [ de ] = "Nein;Ganze Gruppe;Mit erstem Detailbereich" ;
+ Text [ en-US ] = "No;Whole Group;With First Detail" ;
+};
+String RID_STR_CANGROW
+{
+ Text [ de ] = "Kann wachsen" ;
+ Text [ en-US ] = "Can Grow" ;
+};
+String RID_STR_CANSHRINK
+{
+ Text [ de ] = "Kann schrumpfen" ;
+ Text [ en-US ] = "Can Shrink" ;
+};
+String RID_STR_REPEATSECTION
+{
+ Text [ de ] = "Bereich wiederholen" ;
+ Text [ en-US ] = "Repeat Section" ;
+};
+String RID_STR_PRINTREPEATEDVALUES
+{
+ Text [ de ] = "Print repeated values" ;
+ Text [ en-US ] = "Print repeated values" ;
+};
+String RID_STR_CONDITIONALPRINTEXPRESSION
+{
+ Text [ de ] = "Conditional Print Expression" ;
+ Text [ en-US ] = "Conditional Print Expression" ;
+};
+String RID_STR_STARTNEWCOLUMN
+{
+ Text [ de ] = "Auf neuer Spalte beginnen" ;
+ Text [ en-US ] = "Start new column" ;
+};
+String RID_STR_STARTNEWPAGE
+{
+ Text [ de ] = "Auf neuer Seite beginnen" ;
+ Text [ en-US ] = "Start new page" ;
+};
+String RID_STR_RESETPAGENUMBER
+{
+ Text [ de ] = "Seitenzahl zurücksetzen" ;
+ Text [ en-US ] = "Reset page number" ;
+};
+String RID_STR_MINHEIGHTNEWPAGE
+{
+ Text [ de ] = "RID_STR_MINHEIGHTNEWPAGE" ;
+ Text [ en-US ] = "RID_STR_MINHEIGHTNEWPAGE" ;
+};
+String RID_STR_PRINTWHENGROUPCHANGE
+{
+ Text [ de ] = "Drucke bei Gruppenänderung" ;
+ Text [ en-US ] = "Print When Group Change" ;
+};
+String RID_STR_VISIBLE
+{
+ Text [ de ] = "Sichtbar" ;
+ Text [ en-US ] = "Visible" ;
+};
+String RID_STR_GROUPKEEPTOGETHER
+{
+ Text [ de ] = "Gruppe zusammen halten" ;
+ Text [ en-US ] = "Group keep together" ;
+};
+String RID_STR_GROUPKEEPTOGETHER_CONST
+{
+ Text [ de ] = "Pro Seite;Pro Spalte" ;
+ Text [ en-US ] = "Per Page;Per Column" ;
+};
+String RID_STR_SECTIONPAGEBREAK_CONST
+{
+ Text [ de ] = "Keine;Bereich;Automatisch" ;
+ Text [ en-US ] = "None;Section;Automatic" ;
+};
+String RID_STR_PAGEHEADEROPTION
+{
+ Text [ de ] = "Seitenkopf" ;
+ Text [ en-US ] = "Page header" ;
+};
+String RID_STR_PAGEFOOTEROPTION
+{
+ Text [ de ] = "Seitenfuß" ;
+ Text [ en-US ] = "Page footer" ;
+};
+String RID_STR_REPORTPRINTOPTION_CONST
+{
+ Text [ de ] = "Alle Seiten;Nicht mit Berichtskopf;Nicht mit Berichtsfuß;Weder mit Berichtskopf noch Fuß" ;
+ Text [ en-US ] = "All Pages;Not With Report Header;Not With Report Footer;Not With Report Header/Footer" ;
+};
+String RID_STR_DEEPTRAVERSING
+{
+ Text [ de ] = "Unterberichte einbinden" ;
+ Text [ en-US ] = "Deep traversing" ;
+};
+String RID_STR_PREEVALUATED
+{
+ Text [ de ] = "Vorraus Berechnung" ;
+ Text [ en-US ] = "Pre evaluation" ;
+};
+String RID_STR_POSITIONX
+{
+ Text [ de ] = "Position X";
+ Text [ en-US ] = "Position X";
+};
+String RID_STR_POSITIONY
+{
+ Text [ de ] = "Position Y";
+ Text [ en-US ] = "Position Y";
+};
+String RID_STR_WIDTH
+{
+ Text [ de ] = "Breite";
+ Text [ en-US ] = "Width";
+};
+String RID_STR_HEIGHT
+{
+ Text [ de ] = "Höhe";
+ Text [ en-US ] = "Height";
+};
+String RID_STR_INITIALFORMULA
+{
+ Text [ de ] = "Anfangswert" ;
+ Text [ en-US ] = "Initial value" ;
+};
+String RID_STR_PRESERVEIRI
+{
+ Text [ de ] = "Verknüpfung beibehalten" ;
+ Text [ en-US ] = "Preserve as Link" ;
+};
+String RID_STR_FORMULA
+{
+ Text [ de ] = "Formel" ;
+ Text [ en-US ] = "Formula" ;
+};
+String RID_STR_DATAFIELD
+{
+ Text [ de ] = "Datenfeld" ;
+ Text [ en-US ] = "Data field" ;
+};
+String RID_STR_FONT
+{
+ Text [ de ] = "Schrift" ;
+ Text [ en-US ] = "Font" ;
+};
+String RID_STR_BACKCOLOR
+{
+ Text [ de ] = "Hintergrundfarbe" ;
+ Text [ en-US ] = "Background color";
+};
+String RID_STR_BACKTRANSPARENT
+{
+ Text [ de ] = "Hintergrund Transparent" ;
+ Text [ en-US ] = "Background Transparent";
+};
+String RID_STR_CONTROLBACKGROUNDTRANSPARENT
+{
+ Text [ de ] = "Hintergrund Transparent" ;
+ Text [ en-US ] = "Background Transparent";
+};
+String RID_STR_OVERLAP_OTHER_CONTROL
+{
+ Text [ de ] = "Änderung ist nicht möglich. Das Kontrollelement überschneidet sich mit einem anderen Kontrollelement.";
+ Text [ en-US ] = "This operation is not allowed. The control overlaps with another one.";
+};
+String RID_STR_ILLEGAL_POSITION
+{
+ Text [ de ] = "Diese Position ist ungültig.";
+ Text [ en-US ] = "This position can not be set. It is invalid.";
+};
diff --git a/reportdesign/source/ui/inspection/makefile.mk b/reportdesign/source/ui/inspection/makefile.mk
new file mode 100644
index 000000000000..446ae25d2ef1
--- /dev/null
+++ b/reportdesign/source/ui/inspection/makefile.mk
@@ -0,0 +1,58 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=ui_inspection
+ENABLE_EXCEPTIONS=TRUE
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES=\
+ $(SLO)$/DefaultInspection.obj \
+ $(SLO)$/ReportComponentHandler.obj \
+ $(SLO)$/GeometryHandler.obj \
+ $(SLO)$/metadata.obj
+
+
+SRS1NAME=$(TARGET)
+SRC1FILES = inspection.src
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
new file mode 100644
index 000000000000..9116487c96ec
--- /dev/null
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: metadata.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_METADATA_HXX_
+#include "metadata.hxx"
+#endif
+#ifndef _SVTOOLS_LOCALRESACCESS_HXX_
+#include <svtools/localresaccess.hxx>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_XPROPERTYHANDLER_HPP_
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COMPHELPER_EXTRACT_HXX_
+#include <cppuhelper/extract.hxx>
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+
+#include <functional>
+#include <algorithm>
+
+//............................................................................
+namespace rptui
+{
+//............................................................................
+
+ using namespace ::com::sun::star::uno;
+ using namespace ::com::sun::star;
+
+ //========================================================================
+ //= OPropertyInfoImpl
+ //========================================================================
+ struct OPropertyInfoImpl
+ {
+ String sName;
+ String sTranslation;
+ sal_uInt32 nHelpId;
+ sal_Int32 nId;
+ sal_uInt16 nPos;
+ sal_uInt32 nUIFlags;
+
+ OPropertyInfoImpl(
+ const ::rtl::OUString& rName,
+ sal_Int32 _nId,
+ const String& aTranslation,
+ sal_uInt16 nPosId,
+ sal_uInt32 nHelpId,
+ sal_uInt32 _nUIFlags);
+ };
+
+ //------------------------------------------------------------------------
+ OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId,
+ const String& aString, sal_uInt16 nP, sal_uInt32 nHid, sal_uInt32 _nUIFlags)
+ :sName(_rName)
+ ,sTranslation(aString)
+ ,nHelpId(nHid)
+ ,nId(_nId)
+ ,nPos(nP)
+ ,nUIFlags(_nUIFlags)
+ {
+ }
+
+ //------------------------------------------------------------------------
+ // Vergleichen von PropertyInfo
+ struct PropertyInfoLessByName : public ::std::binary_function< OPropertyInfoImpl, OPropertyInfoImpl, bool >
+ {
+ bool operator()( const OPropertyInfoImpl& _lhs, const OPropertyInfoImpl& _rhs )
+ {
+ return _lhs.sName < _rhs.sName;
+ }
+ };
+
+ //========================================================================
+ //= OPropertyInfoService
+ //========================================================================
+#define DEF_INFO( ident, uinameres, helpid, flags ) \
+ OPropertyInfoImpl( PROPERTY_##ident, PROPERTY_ID_##ident, \
+ String( ModuleRes( RID_STR_##uinameres ) ), nPos++, HID_PROP_##helpid, flags )
+
+#define DEF_INFO_1( ident, uinameres, helpid, flag1 ) \
+ DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 )
+
+#define DEF_INFO_2( ident, uinameres, helpid, flag1, flag2 ) \
+ DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 )
+
+#define DEF_INFO_3( ident, uinameres, helpid, flag1, flag2, flag3 ) \
+ DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 )
+
+#define DEF_INFO_4( ident, uinameres, helpid, flag1, flag2, flag3, flag4 ) \
+ DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 )
+
+#define DEF_INFO_5( ident, uinameres, helpid, flag1, flag2, flag3, flag4, flag5 ) \
+ DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 | PROP_FLAG_##flag5 )
+
+ sal_uInt16 OPropertyInfoService::s_nCount = 0;
+ OPropertyInfoImpl* OPropertyInfoService::s_pPropertyInfos = NULL;
+ //------------------------------------------------------------------------
+ const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo()
+ {
+ if ( s_pPropertyInfos )
+ return s_pPropertyInfos;
+
+ OModuleClient aResourceAccess;
+ // this ensures that we have our resource file loaded
+
+ sal_uInt16 nPos = 1;
+
+ static OPropertyInfoImpl aPropertyInfos[] =
+ {
+ /*
+ DEF_INFO_?( propname and id, resoure id, help id, flags ),
+ */
+ DEF_INFO_1( FORCENEWPAGE, FORCENEWPAGE, FORCENEWPAGE, COMPOSEABLE )
+ ,DEF_INFO_1( NEWROWORCOL, NEWROWORCOL, NEWROWORCOL, COMPOSEABLE )
+ ,DEF_INFO_1( KEEPTOGETHER, KEEPTOGETHER, KEEPTOGETHER, COMPOSEABLE )
+ ,DEF_INFO_1( CANGROW, CANGROW, CANGROW, COMPOSEABLE )
+ ,DEF_INFO_1( CANSHRINK, CANSHRINK, CANSHRINK, COMPOSEABLE )
+ ,DEF_INFO_1( REPEATSECTION, REPEATSECTION, REPEATSECTION, COMPOSEABLE )
+ ,DEF_INFO_1( PRINTREPEATEDVALUES, PRINTREPEATEDVALUES, PRINTREPEATEDVALUES, COMPOSEABLE )
+ ,DEF_INFO_1( CONDITIONALPRINTEXPRESSION, CONDITIONALPRINTEXPRESSION, CONDITIONALPRINTEXPRESSION, COMPOSEABLE )
+ ,DEF_INFO_1( STARTNEWCOLUMN, STARTNEWCOLUMN, STARTNEWCOLUMN, COMPOSEABLE )
+ ,DEF_INFO_1( RESETPAGENUMBER, RESETPAGENUMBER, RESETPAGENUMBER, COMPOSEABLE )
+ ,DEF_INFO_1( PRINTWHENGROUPCHANGE, PRINTWHENGROUPCHANGE, PRINTWHENGROUPCHANGE, COMPOSEABLE )
+ ,DEF_INFO_1( VISIBLE, VISIBLE, VISIBLE, COMPOSEABLE )
+ ,DEF_INFO_1( GROUPKEEPTOGETHER, GROUPKEEPTOGETHER, GROUPKEEPTOGETHER, COMPOSEABLE )
+ ,DEF_INFO_1( PAGEHEADEROPTION, PAGEHEADEROPTION, PAGEHEADEROPTION, COMPOSEABLE )
+ ,DEF_INFO_1( PAGEFOOTEROPTION, PAGEFOOTEROPTION, PAGEFOOTEROPTION, COMPOSEABLE )
+ ,DEF_INFO_1( POSITIONX, POSITIONX, RPT_POSITIONX, COMPOSEABLE )
+ ,DEF_INFO_1( POSITIONY, POSITIONY, RPT_POSITIONY, COMPOSEABLE )
+ ,DEF_INFO_1( WIDTH, WIDTH, RPT_WIDTH, COMPOSEABLE )
+ ,DEF_INFO_1( HEIGHT, HEIGHT, RPT_HEIGHT, COMPOSEABLE )
+ ,DEF_INFO_1( CHARFONTNAME, FONT, RPT_FONT, COMPOSEABLE )
+ ,DEF_INFO_1( PREEVALUATED, PREEVALUATED, PREEVALUATED, COMPOSEABLE )
+ ,DEF_INFO_1( DEEPTRAVERSING, DEEPTRAVERSING, DEEPTRAVERSING, COMPOSEABLE )
+ ,DEF_INFO_1( FORMULA, FORMULA, FORMULA, COMPOSEABLE )
+ ,DEF_INFO_1( INITIALFORMULA, INITIALFORMULA, INITIALFORMULA, COMPOSEABLE )
+ ,DEF_INFO_2( DATAFIELD, DATAFIELD, DATAFIELD, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_1( BACKCOLOR, BACKCOLOR, BACKCOLOR, COMPOSEABLE )
+ ,DEF_INFO_1( CONTROLBACKGROUND, BACKCOLOR, BACKCOLOR, COMPOSEABLE )
+ ,DEF_INFO_1( PRESERVEIRI, PRESERVEIRI, PRESERVEIRI, COMPOSEABLE )
+ ,DEF_INFO_1( BACKTRANSPARENT, BACKTRANSPARENT, BACKTRANSPARENT, COMPOSEABLE )
+ ,DEF_INFO_1( CONTROLBACKGROUNDTRANSPARENT, CONTROLBACKGROUNDTRANSPARENT
+ ,CONTROLBACKGROUNDTRANSPARENT, COMPOSEABLE )
+ };
+
+ s_pPropertyInfos = aPropertyInfos;
+ s_nCount = sizeof(aPropertyInfos) / sizeof(OPropertyInfoImpl);
+
+ ::std::sort( aPropertyInfos, aPropertyInfos + s_nCount, PropertyInfoLessByName() );
+
+ return s_pPropertyInfos;
+ }
+
+ //------------------------------------------------------------------------
+ sal_Int32 OPropertyInfoService::getPropertyId(const String& _rName) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_rName);
+ return pInfo ? pInfo->nId : -1;
+ }
+
+ //------------------------------------------------------------------------
+ String OPropertyInfoService::getPropertyName( sal_Int32 _nPropId )
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nPropId);
+ return pInfo ? pInfo->sName : String();
+ }
+
+ //------------------------------------------------------------------------
+ String OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->sTranslation : String();
+ }
+
+ //------------------------------------------------------------------------
+ sal_Int32 OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->nHelpId : 0;
+ }
+
+ //------------------------------------------------------------------------
+ sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->nPos : 0xFFFF;
+ }
+
+ //------------------------------------------------------------------------
+ sal_uInt32 OPropertyInfoService::getPropertyUIFlags(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->nUIFlags : 0;
+ }
+
+ //------------------------------------------------------------------------
+ void OPropertyInfoService::getPropertyEnumRepresentations(sal_Int32 _nId,::std::vector< ::rtl::OUString >& _rOut) const
+ {
+ OSL_ENSURE( ( ( getPropertyUIFlags( _nId ) & PROP_FLAG_ENUM ) != 0 ) ,
+ "OPropertyInfoService::getPropertyEnumRepresentations: this is no enum property!" );
+
+ sal_Int16 nCommaSeparatedListResId = 0;
+ sal_Int16 nStringItemsResId = 0;
+ switch ( _nId )
+ {
+ case PROPERTY_ID_FORCENEWPAGE:
+ nCommaSeparatedListResId = RID_STR_FORCENEWPAGE_CONST;
+ break;
+ }
+
+ if ( nCommaSeparatedListResId )
+ {
+ String sSeparatedList = String( ModuleRes( nCommaSeparatedListResId ) );
+ xub_StrLen nTokens = sSeparatedList.GetTokenCount();
+ _rOut.reserve( nTokens );
+ for ( xub_StrLen i = 0; i < nTokens; ++i )
+ _rOut.push_back( sSeparatedList.GetToken( i ) );
+ }
+ else if ( nStringItemsResId )
+ {
+ ModuleRes aModuleRes( nStringItemsResId );
+ ::svt::OLocalResourceAccess aEnumStrings( aModuleRes, RSC_RESOURCE );
+
+ sal_Int16 i = 1;
+ ModuleRes aLocalId( i );
+ while ( aEnumStrings.IsAvailableRes( aLocalId.SetRT( RSC_STRING ) ) )
+ {
+ _rOut.push_back( String( aLocalId ) );
+ aLocalId = ModuleRes( ++i );
+ }
+ }
+ }
+
+ //------------------------------------------------------------------------
+ const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(const String& _rName)
+ {
+ // intialisierung
+ if(!s_pPropertyInfos)
+ getPropertyInfo();
+ OPropertyInfoImpl aSearch(_rName, 0L, String(), 0, 0, 0);
+
+ const OPropertyInfoImpl* pPropInfo = ::std::lower_bound(
+ s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() );
+
+ if ( ( pPropInfo < s_pPropertyInfos + s_nCount ) && pPropInfo->sName == _rName )
+ return pPropInfo;
+
+ return NULL;
+ }
+
+
+ //------------------------------------------------------------------------
+ const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(sal_Int32 _nId)
+ {
+ // intialisierung
+ if(!s_pPropertyInfos)
+ getPropertyInfo();
+
+ // TODO: a real structure which allows quick access by name as well as by id
+ for (sal_uInt16 i = 0; i < s_nCount; i++)
+ if (s_pPropertyInfos[i].nId == _nId)
+ return &s_pPropertyInfos[i];
+
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------
+ bool OPropertyInfoService::isComposable( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxFormComponentHandler )
+ {
+ sal_Int32 nId = getPropertyId( _rPropertyName );
+ if ( nId != -1 )
+ {
+ sal_uInt32 nFlags = getPropertyUIFlags( nId );
+ return ( nFlags & PROP_FLAG_COMPOSEABLE ) != 0;
+ }
+
+ return _rxFormComponentHandler->isComposable( _rPropertyName );
+ }
+
+ //------------------------------------------------------------------------
+ void OPropertyInfoService::getExcludeProperties(::std::vector< beans::Property >& _rExcludeProperties,const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler)
+ {
+ uno::Sequence< beans::Property > aProps = _xFormComponentHandler->getSupportedProperties();
+ ::rtl::OUString pExcludeProperties[] =
+ {
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Enabled")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Printable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WordBreak")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MultiLine")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Tag")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpText")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelpURL")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MaxTextLen")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Tabstop")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TabIndex")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ValueMin")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ValueMax")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Spin")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SpinValue")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SpinValueMin")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SpinValueMax")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultSpinValue")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SpinIncrement")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Repeat")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepeatDelay")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlLabel")), /// TODO: has to be checked
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LabelControl")),
+ PROPERTY_MAXTEXTLEN,
+ PROPERTY_EFFECTIVEDEFAULT,
+ PROPERTY_EFFECTIVEMAX,
+ PROPERTY_EFFECTIVEMIN,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HideInactiveSelection")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SubmitAction")),
+ PROPERTY_EMPTY_IS_NULL,
+ PROPERTY_FILTERPROPOSAL
+ ,PROPERTY_POSITIONX
+ ,PROPERTY_POSITIONY
+ ,PROPERTY_WIDTH
+ ,PROPERTY_HEIGHT
+ ,PROPERTY_FONTNAME
+ ,PROPERTY_LABEL
+ ,PROPERTY_LINECOLOR
+ ,PROPERTY_BORDER
+ ,PROPERTY_BORDERCOLOR
+ ,PROPERTY_BACKTRANSPARENT
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_BACKGROUNDCOLOR
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ };
+
+ beans::Property* pPropsIter = aProps.getArray();
+ beans::Property* pPropsEnd = pPropsIter + aProps.getLength();
+ for (; pPropsIter != pPropsEnd; ++pPropsIter)
+ {
+ size_t nPos = 0;
+ for (; nPos < sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) && pExcludeProperties[nPos] != pPropsIter->Name;++nPos )
+ ;
+ if ( nPos == sizeof(pExcludeProperties)/sizeof(pExcludeProperties[0]) )
+ _rExcludeProperties.push_back(*pPropsIter);
+ }
+ }
+
+
+//............................................................................
+} // namespace pcr
+//............................................................................
+
diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx
new file mode 100644
index 000000000000..de743467f3d6
--- /dev/null
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ColorListener.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:31 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_COLORLISTENER_HXX
+#include "ColorListener.hxx"
+#endif
+#ifndef _SFXSMPLHINT_HXX
+#include <svtools/smplhint.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+
+#define BORDERCOLORCHANGE 191
+//=====================================================================
+namespace rptui
+{
+//=====================================================================
+ DBG_NAME( rpt_OColorListener )
+OColorListener::OColorListener(Window* _pParent ,const ::rtl::OUString& _sColorEntry)
+: Window(_pParent)
+,m_sColorEntry(_sColorEntry)
+,m_nColor(COL_LIGHTBLUE)
+,m_bCollapsed(sal_False)
+,m_bMarked(sal_False)
+{
+ DBG_CTOR( rpt_OColorListener,NULL);
+ StartListening(m_aExtendedColorConfig);
+ m_nColor = m_aExtendedColorConfig.GetColorValue(CFG_REPORTDESIGNER,m_sColorEntry).nColor;
+ m_nTextBoundaries = m_aColorConfig.GetColorValue(::svtools::DOCBOUNDARIES).nColor;
+}
+// -----------------------------------------------------------------------------
+OColorListener::~OColorListener()
+{
+ DBG_DTOR( rpt_OColorListener,NULL);
+ EndListening(m_aExtendedColorConfig);
+}
+// -----------------------------------------------------------------------
+void OColorListener::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
+{
+ if (rHint.ISA(SfxSimpleHint)
+ && (static_cast< SfxSimpleHint const & >(rHint).GetId()
+ == SFX_HINT_COLORS_CHANGED))
+ {
+ m_nColor = m_aExtendedColorConfig.GetColorValue(CFG_REPORTDESIGNER,m_sColorEntry).nColor;
+ m_nTextBoundaries = m_aColorConfig.GetColorValue(::svtools::DOCBOUNDARIES).nColor;
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
+}
+//-----------------------------------------------------------------------------
+void OColorListener::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+void OColorListener::setCollapsed(sal_Bool _bCollapsed)
+{
+ m_bCollapsed = _bCollapsed;
+ if ( m_aCollapsedLink.IsSet() )
+ m_aCollapsedLink.Call(this);
+}
+// -----------------------------------------------------------------------------
+void OColorListener::setMarked(sal_Bool _bMark)
+{
+ m_bMarked = _bMark;
+}
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
new file mode 100644
index 000000000000..5379fbf011ce
--- /dev/null
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -0,0 +1,871 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: UITools.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+//Erstmal definieren, damit die Klassendeklarionen angezogen werden.
+#define ITEMID_FONT 10
+#define ITEMID_POSTURE 11
+#define ITEMID_WEIGHT 12
+#define ITEMID_SHADOWED 13
+#define ITEMID_WORDLINEMODE 14
+#define ITEMID_CONTOUR 15
+#define ITEMID_CROSSEDOUT 16
+#define ITEMID_UNDERLINE 17
+#define ITEMID_FONTHEIGHT 18
+#define ITEMID_PROPSIZE 19
+#define ITEMID_COLOR 20
+#define ITEMID_KERNING 21
+#define ITEMID_CASEMAP 22
+#define ITEMID_LANGUAGE 23
+#define ITEMID_ESCAPEMENT 24
+#define ITEMID_FONTLIST 25
+#define ITEMID_AUTOKERN 26
+#define ITEMID_COLOR_TABLE 27
+#define ITEMID_BLINK 28
+#define ITEMID_EMPHASISMARK 29
+#define ITEMID_TWOLINES 30
+#define ITEMID_CHARROTATE 31
+#define ITEMID_CHARRELIEF 32
+#define ITEMID_CHARHIDDEN 33
+#define ITEMID_CHARSCALE_W 34
+#define ITEMID_BRUSH 35
+#define ITEMID_HORJUSTIFY 36
+#define ITEMID_VERJUSTIFY 37
+//#define ITEMID_IDENT 38
+//#define ITEMID_DEGREES 39
+//#define ITEMID_CHARROTATE SID_ATTR_CHAR_ROTATED
+
+#include <svx/charscaleitem.hxx>
+#include <svx/algitem.hxx>
+#include <svx/svdpagv.hxx>
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX
+#include <svtools/pathoptions.hxx>
+#endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
+#ifndef _CTRLTOOL_HXX
+#include <svtools/ctrltool.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _COM_SUN_STAR_LANG_NULLPOINTEREXCEPTION_HPP_
+#include <com/sun/star/lang/NullPointerException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
+#include <com/sun/star/beans/NamedValue.hpp>
+#endif
+#include <svx/xtable.hxx> // XColorTable
+#include <svx/brshitem.hxx>
+#include <svx/fontitem.hxx>
+#include <svx/emphitem.hxx>
+#include <svx/postitem.hxx>
+#include <svx/udlnitem.hxx>
+#include <svx/crsditem.hxx>
+#include <svx/cntritem.hxx>
+#include <svx/langitem.hxx>
+#include <svx/wghtitem.hxx>
+#include <svx/fhgtitem.hxx>
+#include <svx/shdditem.hxx>
+#include <svx/escpitem.hxx>
+#include <svx/prszitem.hxx>
+#include <svx/wrlmitem.hxx>
+#include <svx/cmapitem.hxx>
+#include <svx/kernitem.hxx>
+#include <svx/blnkitem.hxx>
+#include <svx/flstitem.hxx>
+#include <svx/akrnitem.hxx>
+#include <svx/colritem.hxx>
+#include <svx/drawitem.hxx>
+#include <svx/twolinesitem.hxx>
+#include <svx/charreliefitem.hxx>
+#include <svx/charrotateitem.hxx>
+#include <svx/charhiddenitem.hxx>
+#include <svx/svditer.hxx>
+#include <svx/xtable.hxx>
+#include "RptObject.hxx"
+#include <svx/svdview.hxx>
+#include <svx/svdpage.hxx>
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet
+#include <svtools/itemset.hxx>
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _COMPHELPER_PROPERTY_MULTIPLEX_HXX_
+#include <comphelper/propmultiplex.hxx>
+#endif
+#ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
+#include <comphelper/namedvaluecollection.hxx>
+#endif
+#include <com/sun/star/report/XGroups.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#include <i18npool/mslangid.hxx>
+#ifndef RPTUI_DLGPAGE_HXX
+#include "dlgpage.hxx"
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+// -----------------------------------------------------------------------------
+SvxCellHorJustify lcl_MapHorizontalAlignment(const sal_Int16 _nAlign)
+{
+ SvxCellHorJustify eRet = SVX_HOR_JUSTIFY_STANDARD;
+ switch(_nAlign)
+ {
+ case awt::TextAlign::LEFT:
+ eRet = SVX_HOR_JUSTIFY_LEFT;
+ break;
+ case awt::TextAlign::CENTER:
+ eRet = SVX_HOR_JUSTIFY_CENTER;
+ break;
+ case awt::TextAlign::RIGHT:
+ eRet = SVX_HOR_JUSTIFY_RIGHT;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ return eRet;
+}
+// -----------------------------------------------------------------------------
+sal_Int16 lcl_MapHorizontalAlignment(const SvxCellHorJustify _eAlign)
+{
+ sal_Int16 nRet = awt::TextAlign::LEFT;
+ switch(_eAlign)
+ {
+ case SVX_HOR_JUSTIFY_LEFT:
+ nRet = awt::TextAlign::LEFT;
+ break;
+ case SVX_HOR_JUSTIFY_CENTER:
+ nRet = awt::TextAlign::CENTER;
+ break;
+ case SVX_HOR_JUSTIFY_RIGHT:
+ nRet = awt::TextAlign::RIGHT;
+ break;
+ case SVX_HOR_JUSTIFY_BLOCK:
+ case SVX_HOR_JUSTIFY_REPEAT:
+ nRet = awt::TextAlign::CENTER;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ return nRet;
+}
+// -----------------------------------------------------------------------------
+SvxCellVerJustify lcl_MapVerticalAlignment(const sal_Int16 _nAlign)
+{
+ SvxCellVerJustify eRet = SVX_VER_JUSTIFY_STANDARD;
+ switch(_nAlign)
+ {
+ case text::ParagraphVertAlign::AUTOMATIC:
+ case text::ParagraphVertAlign::BASELINE:
+ eRet = SVX_VER_JUSTIFY_STANDARD;
+ break;
+ case text::ParagraphVertAlign::TOP:
+ eRet = SVX_VER_JUSTIFY_TOP;
+ break;
+ case text::ParagraphVertAlign::CENTER:
+ eRet = SVX_VER_JUSTIFY_CENTER;
+ break;
+ case text::ParagraphVertAlign::BOTTOM:
+ eRet = SVX_VER_JUSTIFY_BOTTOM;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ return eRet;
+}
+// -----------------------------------------------------------------------------
+sal_Int16 lcl_MapVerticalAlignment(const SvxCellVerJustify _eAlign)
+{
+ sal_Int16 nRet = text::ParagraphVertAlign::TOP;
+ switch(_eAlign)
+ {
+ case SVX_VER_JUSTIFY_STANDARD:
+ nRet = text::ParagraphVertAlign::AUTOMATIC;
+ break;
+ case SVX_VER_JUSTIFY_TOP:
+ nRet = text::ParagraphVertAlign::TOP;
+ break;
+ case SVX_VER_JUSTIFY_CENTER:
+ nRet = text::ParagraphVertAlign::CENTER;
+ break;
+ case SVX_VER_JUSTIFY_BOTTOM:
+ nRet = text::ParagraphVertAlign::BOTTOM;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal text alignment value!");
+ break;
+ }
+ return nRet;
+}
+// -----------------------------------------------------------------------------
+sal_Int32 getGroupPosition(const uno::Reference< report::XReportDefinition >& _xReportDefinition,const uno::Reference< report::XGroup >& _xGroup)
+{
+ OSL_ENSURE(_xReportDefinition.is(),"No report definition -> GPF!");
+ uno::Reference< report::XGroups > xGroups = _xReportDefinition->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+ sal_Int32 i = 0;
+ for (;i<nCount ; ++i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ if ( xGroup == _xGroup )
+ break;
+ } // for (;i<nCount ; ++i)
+ return i;
+}
+// -----------------------------------------------------------------------------
+void adjustSectionName(const uno::Reference< report::XGroup >& _xGroup,sal_Int32 _nPos)
+{
+ OSL_ENSURE(_xGroup.is(),"Group is NULL -> GPF");
+ if ( _xGroup->getHeaderOn() && !_xGroup->getHeader()->getName().getLength() )
+ {
+ ::rtl::OUString sName = String(ModuleRes(RID_STR_GROUPHEADER));
+ sName += ::rtl::OUString::valueOf(_nPos);
+ _xGroup->getHeader()->setName(sName);
+ } // if ( _xGroup->getHeaderOn() )
+
+ if ( _xGroup->getFooterOn() && !_xGroup->getFooter()->getName().getLength() )
+ {
+ ::rtl::OUString sName = String(ModuleRes(RID_STR_GROUPFOOTER));
+ sName += ::rtl::OUString::valueOf(_nPos);
+ _xGroup->getFooter()->setName(sName);
+ } // if ( _xGroup->getHeaderOn() )
+}
+// -----------------------------------------------------------------------------
+::rtl::Reference< comphelper::OPropertyChangeMultiplexer> addStyleListener(const uno::Reference< report::XReportDefinition >& _xReportDefinition,::comphelper::OPropertyChangeListener* _pListener)
+{
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> pRet = NULL;
+ if ( _xReportDefinition.is() )
+ {
+ uno::Reference<beans::XPropertySet> xPageStyle(getUsedStyle(_xReportDefinition),uno::UNO_QUERY);
+ if ( xPageStyle.is() )
+ {
+ pRet = new comphelper::OPropertyChangeMultiplexer(_pListener,xPageStyle);
+ pRet->addProperty(PROPERTY_LEFTMARGIN);
+ pRet->addProperty(PROPERTY_RIGHTMARGIN);
+ pRet->addProperty(PROPERTY_PAPERSIZE);
+ }
+ }
+ return pRet;
+}
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ // -------------------------------------------------------------------------
+ Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont )
+ {
+ if ( !_rxReportControlFormat.is() )
+ throw uno::RuntimeException();
+
+ _out_rControlFont = _rxReportControlFormat->getFontDescriptor();
+ Font aDefaultFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont();
+ return VCLUnoHelper::CreateFont( _out_rControlFont, aDefaultFont );
+ }
+
+ // -------------------------------------------------------------------------
+ Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat )
+ {
+ awt::FontDescriptor aAwtFont;
+ return lcl_getReportControlFont( _rxReportControlFormat, aAwtFont );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_CharPropertiesToItems( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ SfxItemSet& _rItemSet )
+ {
+ if ( !_rxReportControlFormat.is() )
+ throw lang::NullPointerException();
+
+ // fill it
+ awt::FontDescriptor aControlFont;
+ const Font aFont( lcl_getReportControlFont( _rxReportControlFormat, aControlFont ) );
+ SvxFontItem aFontItem(ITEMID_FONT);
+ aFontItem.PutValue( uno::makeAny( aControlFont ) );
+ _rItemSet.Put(aFontItem);
+ _rItemSet.Put(SvxPostureItem(aFont.GetItalic(),ITEMID_POSTURE));
+ _rItemSet.Put(SvxWeightItem(aFont.GetWeight(),ITEMID_WEIGHT));
+ _rItemSet.Put(SvxShadowedItem(_rxReportControlFormat->getCharShadowed(),ITEMID_SHADOWED));
+ _rItemSet.Put(SvxWordLineModeItem(aFont.IsWordLineMode(),ITEMID_WORDLINEMODE));
+ _rItemSet.Put(SvxContourItem(_rxReportControlFormat->getCharContoured(),ITEMID_CONTOUR));
+ _rItemSet.Put(SvxAutoKernItem(_rxReportControlFormat->getCharAutoKerning(),ITEMID_AUTOKERN));
+ _rItemSet.Put(SvxCrossedOutItem(aFont.GetStrikeout(),ITEMID_CROSSEDOUT));
+ _rItemSet.Put(SvxCaseMapItem(static_cast<SvxCaseMap>(_rxReportControlFormat->getCharCaseMap()),ITEMID_CASEMAP));
+ _rItemSet.Put(SvxLanguageItem(MsLangId::convertLocaleToLanguage(_rxReportControlFormat->getCharLocale()),ITEMID_LANGUAGE));
+ _rItemSet.Put(SvxEscapementItem(_rxReportControlFormat->getCharEscapement(),_rxReportControlFormat->getCharEscapementHeight(),ITEMID_ESCAPEMENT));
+ _rItemSet.Put(SvxBlinkItem(_rxReportControlFormat->getCharFlash(),ITEMID_BLINK));
+ _rItemSet.Put(SvxCharHiddenItem(_rxReportControlFormat->getCharHidden(),ITEMID_CHARHIDDEN));
+ _rItemSet.Put(SvxTwoLinesItem(_rxReportControlFormat->getCharCombineIsOn(),_rxReportControlFormat->getCharCombinePrefix().toChar(),_rxReportControlFormat->getCharCombineSuffix().toChar(),ITEMID_TWOLINES));
+ SvxUnderlineItem aUnderLineItem(aFont.GetUnderline(),ITEMID_UNDERLINE);
+ aUnderLineItem.SetColor(_rxReportControlFormat->getCharUnderlineColor());
+ _rItemSet.Put(aUnderLineItem);
+ _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetHeight()), MAP_POINT, MAP_TWIP).Height(),100,ITEMID_FONTHEIGHT));
+ _rItemSet.Put(SvxKerningItem(_rxReportControlFormat->getCharKerning(),ITEMID_KERNING));
+ _rItemSet.Put(SvxEmphasisMarkItem(static_cast<FontEmphasisMark>(_rxReportControlFormat->getCharEmphasis()),ITEMID_EMPHASISMARK));
+ //_rItemSet.Put(SvxTwoLinesItem());
+ _rItemSet.Put(SvxCharReliefItem(static_cast<FontRelief>(_rxReportControlFormat->getCharRelief()),ITEMID_CHARRELIEF));
+ _rItemSet.Put(SvxColorItem(::Color(_rxReportControlFormat->getCharColor()),ITEMID_COLOR));
+ _rItemSet.Put(SvxCharRotateItem(_rxReportControlFormat->getCharRotation(),sal_False,ITEMID_CHARROTATE));
+ _rItemSet.Put(SvxCharScaleWidthItem(_rxReportControlFormat->getCharScaleWidth(),ITEMID_CHARSCALE_W));
+
+ _rItemSet.Put(SvxHorJustifyItem(lcl_MapHorizontalAlignment(_rxReportControlFormat->getParaAdjust()),ITEMID_HORJUSTIFY));
+ //_rItemSet.Put(SfxInt32Item(ITEMID_DEGREES,_rxReportControlFormat->getCharRotation()));
+ _rItemSet.Put(SvxVerJustifyItem(lcl_MapVerticalAlignment(_rxReportControlFormat->getParaVertAlignment()),ITEMID_VERJUSTIFY));
+ //_rItemSet.Put(SfxInt32Item(ITEMID_IDENT,_rxReportControlFormat->getCharRotation()));
+
+ uno::Reference< report::XShape> xShape(_rxReportControlFormat,uno::UNO_QUERY);
+ if ( !xShape.is() )
+ _rItemSet.Put(SvxBrushItem(::Color(_rxReportControlFormat->getControlBackground()),ITEMID_BRUSH));
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_pushBack( uno::Sequence< beans::NamedValue >& _out_rProperties, const sal_Char* _pAsciiName, const uno::Any& _rValue )
+ {
+ sal_Int32 nLen( _out_rProperties.getLength() );
+ _out_rProperties.realloc( nLen + 1 );
+ _out_rProperties[ nLen ] = beans::NamedValue( ::rtl::OUString::createFromAscii( _pAsciiName ), _rValue );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_initAwtFont( const Font& _rOriginalFont, const SfxItemSet& _rItemSet, awt::FontDescriptor& _out_rAwtFont )
+ {
+ Font aNewFont( _rOriginalFont );
+ const SfxPoolItem* pItem( NULL );
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONT,sal_True,&pItem) && pItem->ISA(SvxFontItem))
+ {
+ const SvxFontItem* pFontItem = static_cast<const SvxFontItem*>(pItem);
+ aNewFont.SetName( pFontItem->GetFamilyName());
+ aNewFont.SetStyleName(pFontItem->GetStyleName());
+ aNewFont.SetFamily(pFontItem->GetFamily());
+ aNewFont.SetPitch(pFontItem->GetPitch());
+ aNewFont.SetCharSet(pFontItem->GetCharSet());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_POSTURE,sal_True,&pItem) && pItem->ISA(SvxPostureItem))
+ {
+ const SvxPostureItem* pFontItem = static_cast<const SvxPostureItem*>(pItem);
+ aNewFont.SetItalic(pFontItem->GetPosture());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_WEIGHT,sal_True,&pItem) && pItem->ISA(SvxWeightItem))
+ {
+ const SvxWeightItem* pFontItem = static_cast<const SvxWeightItem*>(pItem);
+ aNewFont.SetWeight(pFontItem->GetWeight());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_WORDLINEMODE,sal_True,&pItem) && pItem->ISA(SvxWordLineModeItem))
+ {
+ const SvxWordLineModeItem* pFontItem = static_cast<const SvxWordLineModeItem*>(pItem);
+ aNewFont.SetWordLineMode(pFontItem->GetValue());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CROSSEDOUT,sal_True,&pItem) && pItem->ISA(SvxCrossedOutItem))
+ {
+ const SvxCrossedOutItem* pFontItem = static_cast<const SvxCrossedOutItem*>(pItem);
+ aNewFont.SetStrikeout(pFontItem->GetStrikeout());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONTHEIGHT,sal_True,&pItem) && pItem->ISA(SvxFontHeightItem))
+ {
+ const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem);
+ aNewFont.SetHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MAP_TWIP, MAP_POINT).Height());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_PROPSIZE,sal_True,&pItem) && pItem->ISA(SvxPropSizeItem))
+ {
+ //const SvxPropSizeItem* pFontItem = static_cast<const SvxPropSizeItem*>(pItem);
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONTLIST,sal_True,&pItem) && pItem->ISA(SvxFontListItem))
+ {
+ //const SvxFontListItem* pFontItem = static_cast<const SvxFontListItem*>(pItem);
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARROTATE,sal_True,&pItem) && pItem->ISA(SvxCharRotateItem))
+ {
+ const SvxCharRotateItem* pRotateItem = static_cast<const SvxCharRotateItem*>(pItem);
+ aNewFont.SetOrientation(pRotateItem->GetValue());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARSCALE_W,sal_True,&pItem) && pItem->ISA(SvxCharScaleWidthItem))
+ {
+ const SvxCharScaleWidthItem* pCharItem = static_cast<const SvxCharScaleWidthItem*>(pItem);
+ aNewFont.SetWidthType(VCLUnoHelper::ConvertFontWidth(pCharItem->GetValue()));
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && pItem->ISA(SvxUnderlineItem))
+ {
+ const SvxUnderlineItem* pFontItem = static_cast<const SvxUnderlineItem*>(pItem);
+ aNewFont.SetUnderline(pFontItem->GetUnderline());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && pItem->ISA(SvxColorItem))
+ {
+ const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
+ aNewFont.SetColor(pFontItem->GetValue().GetColor());
+ }
+
+ _out_rAwtFont = VCLUnoHelper::CreateFontDescriptor( aNewFont );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_itemsToCharProperties( const Font& _rOriginalControlFont, const SfxItemSet& _rItemSet, uno::Sequence< beans::NamedValue >& _out_rProperties )
+ {
+ const SfxPoolItem* pItem( NULL );
+
+ // create an AWT font
+ awt::FontDescriptor aAwtFont;
+ lcl_initAwtFont( _rOriginalControlFont, _rItemSet, aAwtFont );
+ lcl_pushBack( _out_rProperties, "Font", uno::makeAny( aAwtFont ) );
+
+ // properties which cannot be represented in an AWT font need to be preserved directly
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_SHADOWED,sal_True,&pItem) && pItem->ISA(SvxShadowedItem))
+ {
+ const SvxShadowedItem* pFontItem = static_cast<const SvxShadowedItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharShadowed", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CONTOUR,sal_True,&pItem) && pItem->ISA(SvxContourItem))
+ {
+ const SvxContourItem* pFontItem = static_cast<const SvxContourItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharContoured", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,sal_True,&pItem) && pItem->ISA(SvxUnderlineItem))
+ {
+ const SvxUnderlineItem* pFontItem = static_cast<const SvxUnderlineItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharUnderlineColor", uno::makeAny( pFontItem->GetColor().GetColor() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_HORJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxHorJustifyItem))
+ {
+ const SvxHorJustifyItem* pJustifyItem = static_cast<const SvxHorJustifyItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "ParaAdjust", uno::makeAny( lcl_MapHorizontalAlignment( static_cast< SvxCellHorJustify >( pJustifyItem->GetEnumValue() ) ) ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_VERJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxVerJustifyItem))
+ {
+ const SvxVerJustifyItem* pJustifyItem = static_cast<const SvxVerJustifyItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "ParaVertAlignment", uno::makeAny( lcl_MapVerticalAlignment( static_cast< SvxCellVerJustify >( pJustifyItem->GetEnumValue() ) ) ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARRELIEF,sal_True,&pItem) && pItem->ISA(SvxCharReliefItem))
+ {
+ const SvxCharReliefItem* pFontItem = static_cast<const SvxCharReliefItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharRelief", uno::makeAny( static_cast< sal_Int16 >( pFontItem->GetEnumValue() ) ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CHARHIDDEN,sal_True,&pItem) && pItem->ISA(SvxCharHiddenItem))
+ {
+ const SvxCharHiddenItem* pFontItem = static_cast<const SvxCharHiddenItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharHidden", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_AUTOKERN,sal_True,&pItem) && pItem->ISA(SvxAutoKernItem))
+ {
+ const SvxAutoKernItem* pFontItem = static_cast<const SvxAutoKernItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharAutoKerning", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BRUSH,sal_True,&pItem) && pItem->ISA(SvxBrushItem))
+ {
+ const SvxBrushItem* pFontItem = static_cast<const SvxBrushItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "ControlBackground", uno::makeAny( pFontItem->GetColor().GetColor() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_BLINK,sal_True,&pItem) && pItem->ISA(SvxBlinkItem))
+ {
+ const SvxBlinkItem* pFontItem = static_cast<const SvxBlinkItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharFlash", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_EMPHASISMARK,sal_True,&pItem) && pItem->ISA(SvxEmphasisMarkItem))
+ {
+ const SvxEmphasisMarkItem* pFontItem = static_cast<const SvxEmphasisMarkItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharEmphasis", uno::makeAny( static_cast< sal_Int16 >( pFontItem->GetEmphasisMark() ) ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_TWOLINES,sal_True,&pItem) && pItem->ISA(SvxTwoLinesItem))
+ {
+ const SvxTwoLinesItem* pFontItem = static_cast<const SvxTwoLinesItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharCombineIsOn", uno::makeAny( pFontItem->GetValue() ) );
+ lcl_pushBack( _out_rProperties, "CharCombinePrefix", uno::makeAny( ::rtl::OUString( pFontItem->GetStartBracket() ) ) );
+ lcl_pushBack( _out_rProperties, "CharCombineSuffix", uno::makeAny( ::rtl::OUString( pFontItem->GetEndBracket() ) ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_COLOR,sal_True,&pItem) && pItem->ISA(SvxColorItem))
+ {
+ const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharColor", uno::makeAny( pFontItem->GetValue().GetColor() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_KERNING,sal_True,&pItem) && pItem->ISA(SvxKerningItem))
+ {
+ const SvxKerningItem* pFontItem = static_cast<const SvxKerningItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharKerning", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem))
+ {
+ const SvxCaseMapItem* pFontItem = static_cast<const SvxCaseMapItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharCaseMap", uno::makeAny( pFontItem->GetValue() ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_LANGUAGE,sal_True,&pItem) && pItem->ISA(SvxLanguageItem))
+ {
+ const SvxLanguageItem* pFontItem = static_cast<const SvxLanguageItem*>(pItem);
+ lang::Locale aCharLocale;
+ MsLangId::convertLanguageToLocale( pFontItem->GetLanguage(), aCharLocale );
+ lcl_pushBack( _out_rProperties, "CharLocale", uno::makeAny( aCharLocale ) );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,sal_True,&pItem) && pItem->ISA(SvxEscapementItem))
+ {
+ const SvxEscapementItem* pFontItem = static_cast<const SvxEscapementItem*>(pItem);
+ lcl_pushBack( _out_rProperties, "CharEscapement", uno::makeAny( pFontItem->GetEsc() ) );
+ lcl_pushBack( _out_rProperties, "CharEscapementHeight", uno::makeAny( (sal_Int8)pFontItem->GetProp() ) );
+ }
+ }
+
+ // -------------------------------------------------------------------------
+ template< class ATTRIBUTE_TYPE >
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const sal_Char* _pAttributeName,
+ const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ void (SAL_CALL report::XReportControlFormat::*pSetter)( ATTRIBUTE_TYPE ) )
+ {
+ ATTRIBUTE_TYPE aAttributeValue = ATTRIBUTE_TYPE();
+ if ( _rAttrValues.get_ensureType( _pAttributeName, aAttributeValue ) )
+ (_rxReportControlFormat.get()->*pSetter)( aAttributeValue );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const sal_Char* _pAttributeName,
+ const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ void (SAL_CALL report::XReportControlFormat::*pSetter)( const ::rtl::OUString& ) )
+ {
+ ::rtl::OUString aAttributeValue;
+ if ( _rAttrValues.get_ensureType( _pAttributeName, aAttributeValue ) )
+ (_rxReportControlFormat.get()->*pSetter)( aAttributeValue );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const sal_Char* _pAttributeName,
+ const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ void (SAL_CALL report::XReportControlFormat::*pSetter)( const lang::Locale& ) )
+ {
+ lang::Locale aAttributeValue;
+ if ( _rAttrValues.get_ensureType( _pAttributeName, aAttributeValue ) )
+ (_rxReportControlFormat.get()->*pSetter)( aAttributeValue );
+ }
+}
+
+// -----------------------------------------------------------------------------
+bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ const uno::Reference< awt::XWindow>& _rxParentWindow, uno::Sequence< beans::NamedValue >& _out_rNewValues )
+{
+ OSL_PRECOND( _rxReportControlFormat.is() && _rxParentWindow.is(), "openCharDialog: invalid parameters!" );
+ if ( !_rxReportControlFormat.is() || !_rxParentWindow.is() )
+ return false;
+
+ _out_rNewValues = uno::Sequence< beans::NamedValue >();
+
+ // ------------
+ // UNO->ItemSet
+ static SfxItemInfo aItemInfos[] =
+ {
+ { SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_PROPSIZE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_KERNING, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CASEMAP, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_ESCAPEMENT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_FONTLIST, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_AUTOKERN, SFX_ITEM_POOLABLE },
+ { SID_COLOR_TABLE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_FLASH, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_TWO_LINES, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_ROTATED, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_SCALEWIDTH, SFX_ITEM_POOLABLE },
+ { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE },
+ { SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE },
+ //{ SID_ATTR_ALIGN_INDENT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }
+ //{ SID_ATTR_ALIGN_DEGREES, SFX_ITEM_POOLABLE }
+ };
+ Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow );
+ ::std::auto_ptr<FontList> pFontList(new FontList( pParent ));
+ ::std::auto_ptr<XColorTable> pColorTable( new XColorTable( SvtPathOptions().GetPalettePath() ));
+ SfxPoolItem* pDefaults[] =
+ {
+ new SvxFontItem(ITEMID_FONT),
+ new SvxPostureItem(ITALIC_NONE,ITEMID_POSTURE),
+ new SvxWeightItem(WEIGHT_NORMAL,ITEMID_WEIGHT),
+ new SvxShadowedItem(FALSE,ITEMID_SHADOWED),
+ new SvxWordLineModeItem(FALSE,ITEMID_WORDLINEMODE),
+ new SvxContourItem(FALSE,ITEMID_CONTOUR),
+ new SvxCrossedOutItem(STRIKEOUT_NONE,ITEMID_CROSSEDOUT),
+ new SvxUnderlineItem(UNDERLINE_NONE,ITEMID_UNDERLINE),
+ new SvxFontHeightItem(240,100,ITEMID_FONTHEIGHT),
+ new SvxPropSizeItem(100,ITEMID_PROPSIZE),
+ new SvxColorItem(ITEMID_COLOR),
+ new SvxKerningItem(0,ITEMID_KERNING),
+ new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED,ITEMID_CASEMAP),
+ new SvxLanguageItem(LANGUAGE_GERMAN,ITEMID_LANGUAGE),
+ new SvxEscapementItem(ITEMID_ESCAPEMENT),
+ new SvxFontListItem(pFontList.get(),ITEMID_FONTLIST),
+ new SvxAutoKernItem(FALSE,ITEMID_AUTOKERN),
+ new SvxColorTableItem(pColorTable.get(),ITEMID_COLOR_TABLE),
+ new SvxBlinkItem(FALSE,ITEMID_BLINK),
+ new SvxEmphasisMarkItem(EMPHASISMARK_NONE,ITEMID_EMPHASISMARK),
+ new SvxTwoLinesItem(TRUE,0,0,ITEMID_TWOLINES),
+ new SvxCharRotateItem(0,sal_False,ITEMID_CHARROTATE),
+ new SvxCharReliefItem(RELIEF_NONE,ITEMID_CHARRELIEF),
+ new SvxCharHiddenItem(FALSE,ITEMID_CHARHIDDEN),
+ new SvxCharScaleWidthItem(100,ITEMID_CHARSCALE_W),
+ new SvxBrushItem(ITEMID_BRUSH),
+ new SvxHorJustifyItem(ITEMID_HORJUSTIFY),
+ //new SfxInt32Item(ITEMID_IDENT),
+ new SvxVerJustifyItem(ITEMID_VERJUSTIFY)
+ //new SfxInt32Item(ITEMID_DEGREES)
+ };
+
+ static USHORT pRanges[] =
+ {
+ /*
+ SID_ATTR_CHAR_FONT,
+ SID_ATTR_CHAR_WEIGHT,
+ SID_ATTR_CHAR_FONTHEIGHT,
+ SID_ATTR_CHAR_FONTHEIGHT,
+ SID_ATTR_CHAR_COLOR,
+ SID_ATTR_CHAR_COLOR,
+ SID_ATTR_CHAR_LANGUAGE,
+ SID_ATTR_CHAR_LANGUAGE,
+ SID_ATTR_CHAR_CJK_FONT,
+ SID_ATTR_CHAR_CJK_WEIGHT,
+ SID_ATTR_CHAR_CTL_FONT,
+ SID_ATTR_CHAR_CTL_WEIGHT
+ */
+ ITEMID_FONT,ITEMID_VERJUSTIFY
+ };
+
+ bool bSuccess = false;
+ try
+ {
+ ::std::auto_ptr<SfxItemPool> pPool( new SfxItemPool(String::CreateFromAscii("ReportCharProperties"), ITEMID_FONT,ITEMID_VERJUSTIFY, aItemInfos, pDefaults) );
+ // not needed for font height pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); // ripped, don't understand why
+ pPool->FreezeIdRanges(); // the same
+
+ ::std::auto_ptr<SfxItemSet> pDescriptor( new SfxItemSet( *pPool, pRanges ) );
+ lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor );
+
+ { // want the dialog to be destroyed before our set
+ ORptPageDialog aDlg(pParent, pDescriptor.get(),RID_PAGEDIALOG_CHAR);
+ uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY );
+ if ( xShape.is() )
+ aDlg.RemoveTabPage( RID_PAGE_BACKGROUND );
+ bSuccess = ( RET_OK == aDlg.Execute() );
+ if ( bSuccess )
+ {
+ lcl_itemsToCharProperties( lcl_getReportControlFont( _rxReportControlFormat ), *aDlg.GetOutputItemSet(), _out_rNewValues );
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+ delete pDefaults[i];
+
+ return bSuccess;
+}
+
+// -----------------------------------------------------------------------------
+void applyCharacterSettings( const uno::Reference< report::XReportControlFormat >& _rxReportControlFormat, const uno::Sequence< beans::NamedValue >& _rSettings )
+{
+ ::comphelper::NamedValueCollection aSettings( _rSettings );
+
+ try
+ {
+ awt::FontDescriptor aAwtFont;
+ if ( aSettings.get( "Font" ) >>= aAwtFont )
+ {
+ ::rtl::OUString sTemp = aAwtFont.Name;
+ aAwtFont.Name = ::rtl::OUString(); // hack to
+ _rxReportControlFormat->setFontDescriptor( aAwtFont );
+ _rxReportControlFormat->setCharFontName( sTemp );
+ }
+
+ lcl_applyFontAttribute( aSettings, "CharShadowed", _rxReportControlFormat, &report::XReportControlFormat::setCharShadowed );
+ lcl_applyFontAttribute( aSettings, "CharContoured", _rxReportControlFormat, &report::XReportControlFormat::setCharContoured );
+ lcl_applyFontAttribute( aSettings, "CharUnderlineColor", _rxReportControlFormat, &report::XReportControlFormat::setCharUnderlineColor );
+ lcl_applyFontAttribute( aSettings, "ParaAdjust", _rxReportControlFormat, &report::XReportControlFormat::setParaAdjust );
+ lcl_applyFontAttribute( aSettings, "ParaVertAlignment", _rxReportControlFormat, &report::XReportControlFormat::setParaVertAlignment );
+ lcl_applyFontAttribute( aSettings, "CharRelief", _rxReportControlFormat, &report::XReportControlFormat::setCharRelief );
+ lcl_applyFontAttribute( aSettings, "CharHidden", _rxReportControlFormat, &report::XReportControlFormat::setCharHidden );
+ lcl_applyFontAttribute( aSettings, "CharAutoKerning", _rxReportControlFormat, &report::XReportControlFormat::setCharAutoKerning );
+ lcl_applyFontAttribute( aSettings, "ControlBackground", _rxReportControlFormat, &report::XReportControlFormat::setControlBackground );
+ lcl_applyFontAttribute( aSettings, "CharFlash", _rxReportControlFormat, &report::XReportControlFormat::setCharFlash );
+ lcl_applyFontAttribute( aSettings, "CharEmphasis", _rxReportControlFormat, &report::XReportControlFormat::setCharEmphasis );
+ lcl_applyFontAttribute( aSettings, "CharCombineIsOn", _rxReportControlFormat, &report::XReportControlFormat::setCharCombineIsOn );
+ lcl_applyFontAttribute( aSettings, "CharCombinePrefix", _rxReportControlFormat, &report::XReportControlFormat::setCharCombinePrefix );
+ lcl_applyFontAttribute( aSettings, "CharCombineSuffix", _rxReportControlFormat, &report::XReportControlFormat::setCharCombineSuffix );
+ lcl_applyFontAttribute( aSettings, "CharColor", _rxReportControlFormat, &report::XReportControlFormat::setCharColor );
+ lcl_applyFontAttribute( aSettings, "CharKerning", _rxReportControlFormat, &report::XReportControlFormat::setCharKerning );
+ lcl_applyFontAttribute( aSettings, "CharCaseMap", _rxReportControlFormat, &report::XReportControlFormat::setCharCaseMap );
+ lcl_applyFontAttribute( aSettings, "CharLocale", _rxReportControlFormat, &report::XReportControlFormat::setCharLocale );
+ lcl_applyFontAttribute( aSettings, "CharEscapement", _rxReportControlFormat, &report::XReportControlFormat::setCharEscapement );
+ lcl_applyFontAttribute( aSettings, "CharEscapementHeight", _rxReportControlFormat, &report::XReportControlFormat::setCharEscapementHeight );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+bool openCharDialog(const uno::Reference<report::XReportControlFormat>& _rxReportControlFormat,
+ const uno::Reference< awt::XWindow>& _xWindow)
+{
+ uno::Sequence< beans::NamedValue > aSettings;
+ if ( !openCharDialog( _rxReportControlFormat, _xWindow, aSettings ) )
+ return false;
+ applyCharacterSettings( _rxReportControlFormat, aSettings );
+ return true;
+}
+
+// -----------------------------------------------------------------------------
+void notifySystemWindow(Window* _pWindow,Window* _pToRegister, ::comphelper::mem_fun1_t<TaskPaneList,Window*> _rMemFunc)
+{
+ OSL_ENSURE(_pWindow,"Window can not be null!");
+ SystemWindow* pSystemWindow = _pWindow ? _pWindow->GetSystemWindow() : NULL;
+ if ( pSystemWindow )
+ {
+ _rMemFunc( pSystemWindow->GetTaskPaneList(), _pToRegister );
+ }
+}
+// -----------------------------------------------------------------------------
+SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects,SdrObject* _pIgnore)
+{
+ SdrObject* pOverlappedObj = NULL;
+ SdrObjListIter aIter(_rPage,IM_DEEPNOGROUPS);
+ SdrObject* pObjIter = NULL;
+
+ while( !pOverlappedObj && (pObjIter = aIter.Next()) != NULL )
+ {
+ if ( _pIgnore != pObjIter
+ && (_bAllObjects || !_rView.IsObjMarked(pObjIter))
+ && dynamic_cast<OUnoObject*>(pObjIter) != NULL )
+ {
+ Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
+ if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ pOverlappedObj = pObjIter;
+ }
+ }
+ return pOverlappedObj;
+}
+//----------------------------------------------------------------------------
+SdrObject* isOver(SdrObject* _pObj,SdrPage& _rPage,SdrView& _rView,bool _bUnMarkedObjects)
+{
+ SdrObject* pOverlappedObj = NULL;
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(_pObj);
+ if ( pUnoObj ) // this doesn't need to be done for shapes
+ {
+ Rectangle aRect = pUnoObj->GetCurrentBoundRect();
+ pOverlappedObj = isOver(aRect,_rPage,_rView,_bUnMarkedObjects,_pObj);
+ }
+ return pOverlappedObj;
+}
+
+// -----------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > getParameterNames( const uno::Reference< sdbc::XRowSet >& _rxRowSet )
+{
+ uno::Sequence< ::rtl::OUString > aNames;
+
+ try
+ {
+ uno::Reference< sdb::XParametersSupplier > xSuppParams( _rxRowSet, uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xParams( xSuppParams->getParameters() );
+ if ( xParams.is() )
+ {
+ sal_Int32 count( xParams->getCount() );
+ aNames.realloc( count );
+
+ uno::Reference< beans::XPropertySet > xParam;
+ ::rtl::OUString sParamName;
+ for ( sal_Int32 i=0; i<count; ++i )
+ {
+ xParam.set( xParams->getByIndex(i), uno::UNO_QUERY_THROW );
+ OSL_VERIFY( xParam->getPropertyValue( PROPERTY_NAME ) >>= sParamName );
+ aNames[i] = sParamName;
+ }
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return aNames;
+}
+
+// -----------------------------------------------------------------------------
+} // namespace rptui
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/Undo.cxx
new file mode 100644
index 000000000000..f1210fc93fc3
--- /dev/null
+++ b/reportdesign/source/ui/misc/Undo.cxx
@@ -0,0 +1,465 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: Undo.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "Undo.hxx"
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef DBAUI_ICONTROLLER_HXX
+#include <dbaccess/IController.hxx>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSECTION_HPP_
+#include <com/sun/star/report/XSection.hpp>
+#endif
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include "UndoEnv.hxx"
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <svx/unoshape.hxx>
+#include <boost/bind.hpp>
+#include <functional>
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+ using namespace uno;
+ using namespace lang;
+ using namespace script;
+ using namespace beans;
+ using namespace awt;
+ using namespace util;
+ using namespace container;
+ using namespace report;
+
+//----------------------------------------------------------------------------
+namespace
+{
+ void lcl_collectElements(const uno::Reference< report::XSection >& _xSection,::std::vector< uno::Reference< drawing::XShape> >& _rControls)
+ {
+ if ( _xSection.is() )
+ {
+ sal_Int32 nCount = _xSection->getCount();
+ _rControls.reserve(nCount);
+ while ( nCount )
+ {
+ uno::Reference< drawing::XShape> xShape(_xSection->getByIndex(nCount-1),uno::UNO_QUERY);
+ _rControls.push_back(xShape);
+ _xSection->remove(xShape);
+ --nCount;
+ }
+ } // if ( _xSection.is() )
+ }
+ //----------------------------------------------------------------------------
+ void lcl_insertElements(const uno::Reference< report::XSection >& _xSection,const ::std::vector< uno::Reference< drawing::XShape> >& _aControls)
+ {
+ if ( _xSection.is() )
+ {
+ ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aIter = _aControls.rbegin();
+ ::std::vector< uno::Reference< drawing::XShape> >::const_reverse_iterator aEnd = _aControls.rend();
+ for (; aIter != aEnd; ++aIter)
+ {
+ try
+ {
+ const awt::Point aPos = (*aIter)->getPosition();
+ const awt::Size aSize = (*aIter)->getSize();
+ _xSection->add(*aIter);
+ (*aIter)->setPosition( aPos );
+ (*aIter)->setSize( aSize );
+ }
+ catch(const uno::Exception&)
+ {
+ OSL_ENSURE(0,"lcl_insertElements:Exception caught!");
+ }
+ }
+ }
+ }
+ //----------------------------------------------------------------------------
+ void lcl_setValues(const uno::Reference< report::XSection >& _xSection,const ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >& _aValues)
+ {
+ if ( _xSection.is() )
+ {
+ ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aIter = _aValues.begin();
+ ::std::vector< ::std::pair< ::rtl::OUString ,uno::Any> >::const_iterator aEnd = _aValues.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ try
+ {
+ _xSection->setPropertyValue(aIter->first,aIter->second);
+ }
+ catch(const uno::Exception&)
+ {
+ OSL_ENSURE(0,"lcl_setValues:Exception caught!");
+ }
+ }
+ }
+ }
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OSectionUndo, OCommentUndoAction );
+//----------------------------------------------------------------------------
+OSectionUndo::OSectionUndo(OReportModel& _rMod
+ ,sal_uInt16 _nSlot
+ ,Action _eAction
+ ,USHORT nCommentID)
+: OCommentUndoAction(_rMod,nCommentID)
+,m_eAction(_eAction)
+,m_nSlot(_nSlot)
+,m_bInserted(false)
+{
+}
+// -----------------------------------------------------------------------------
+OSectionUndo::~OSectionUndo()
+{
+ if ( !m_bInserted )
+ {
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ ::std::vector< uno::Reference< drawing::XShape> >::iterator aEnd = m_aControls.end();
+ for (::std::vector< uno::Reference< drawing::XShape> >::iterator aIter = m_aControls.begin(); aIter != aEnd; ++aIter)
+ {
+ uno::Reference< drawing::XShape> xShape = *aIter;
+ rEnv.RemoveElement(xShape);
+
+#if OSL_DEBUG_LEVEL > 0
+ SvxShape* pShape = SvxShape::getImplementation( xShape );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ OSL_ENSURE( pShape && pShape->HasSdrObjectOwnership() && pObject && !pObject->IsInserted(),
+ "OSectionUndo::~OSectionUndo: inconsistency in the shape/object ownership!" );
+#endif
+ try
+ {
+ comphelper::disposeComponent(xShape);
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xSection)
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ const OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ m_aControls.clear();
+ try
+ {
+ // copy all properties for restoring
+ uno::Reference< beans::XPropertySetInfo> xInfo = _xSection->getPropertySetInfo();
+ uno::Sequence< beans::Property> aSeq = xInfo->getProperties();
+ const beans::Property* pIter = aSeq.getConstArray();
+ const beans::Property* pEnd = pIter + aSeq.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ if ( 0 == (pIter->Attributes & beans::PropertyAttribute::READONLY) )
+ m_aValues.push_back(::std::pair< ::rtl::OUString ,uno::Any>(pIter->Name,_xSection->getPropertyValue(pIter->Name)));
+ }
+ lcl_collectElements(_xSection,m_aControls);
+ }
+ catch(uno::Exception&)
+ {
+ }
+}
+//----------------------------------------------------------------------------
+void OSectionUndo::Undo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ if ( !rEnv.IsLocked() )
+ {
+ const OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ //rEnv.Lock();
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReRemove();
+ break;
+
+ case Removed:
+ implReInsert();
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OSectionUndo::Undo: caught an exception!" );
+ }
+ //rEnv.UnLock();
+ }
+
+}
+//----------------------------------------------------------------------------
+void OSectionUndo::Redo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ if ( !rEnv.IsLocked() )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ //rEnv.Lock();
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReInsert();
+ break;
+
+ case Removed:
+ implReRemove();
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OSectionUndo::Redo: caught an exception!" );
+ }
+ //rEnv.UnLock();
+ }
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OReportSectionUndo, OCommentUndoAction );
+//----------------------------------------------------------------------------
+OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OReportHelper> _pMemberFunction
+ ,const uno::Reference< report::XReportDefinition >& _xReport
+ ,Action _eAction
+ ,USHORT nCommentID)
+: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID)
+,m_aReportHelper(_xReport)
+,m_pMemberFunction(_pMemberFunction)
+{
+ if( m_eAction == Removed )
+ collectControls(m_pMemberFunction(&m_aReportHelper));
+}
+// -----------------------------------------------------------------------------
+OReportSectionUndo::~OReportSectionUndo()
+{
+}
+//----------------------------------------------------------------------------
+void OReportSectionUndo::implReInsert( )
+{
+ const uno::Sequence< beans::PropertyValue > aArgs;
+ m_pController->executeChecked(m_nSlot,aArgs);
+ uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aReportHelper);
+ lcl_insertElements(xSection,m_aControls);
+ lcl_setValues(xSection,m_aValues);
+ m_bInserted = true;
+}
+//----------------------------------------------------------------------------
+void OReportSectionUndo::implReRemove( )
+{
+ if( m_eAction == Removed )
+ collectControls(m_pMemberFunction(&m_aReportHelper));
+ const uno::Sequence< beans::PropertyValue > aArgs;
+ m_pController->executeChecked(m_nSlot,aArgs);
+ m_bInserted = false;
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OGroupSectionUndo, OSectionUndo );
+//----------------------------------------------------------------------------
+OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot
+ ,::std::mem_fun_t< uno::Reference< report::XSection >
+ ,OGroupHelper> _pMemberFunction
+ ,const uno::Reference< report::XGroup >& _xGroup
+ ,Action _eAction
+ ,USHORT nCommentID)
+: OSectionUndo(_rMod,_nSlot,_eAction,nCommentID)
+,m_aGroupHelper(_xGroup)
+,m_pMemberFunction(_pMemberFunction)
+{
+ if( m_eAction == Removed )
+ {
+ uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper);
+ if ( xSection.is() )
+ m_sName = xSection->getName();
+ collectControls(xSection);
+ }
+}
+//----------------------------------------------------------------------------
+String OGroupSectionUndo::GetComment() const
+{
+ if ( !m_sName.getLength() )
+ {
+ try
+ {
+ uno::Reference< report::XSection > xSection = const_cast<OGroupSectionUndo*>(this)->m_pMemberFunction(&const_cast<OGroupSectionUndo*>(this)->m_aGroupHelper);
+
+ if ( xSection.is() )
+ m_sName = xSection->getName();
+ }
+ catch(uno::Exception&)
+ {}
+ }
+ return m_strComment + m_sName;
+}
+//----------------------------------------------------------------------------
+void OGroupSectionUndo::implReInsert( )
+{
+ uno::Sequence< beans::PropertyValue > aArgs(2);
+
+ aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON;
+ aArgs[0].Value <<= sal_True;
+ aArgs[1].Name = PROPERTY_GROUP;
+ aArgs[1].Value <<= m_aGroupHelper.getGroup();
+ m_pController->executeChecked(m_nSlot,aArgs);
+
+ uno::Reference< report::XSection > xSection = m_pMemberFunction(&m_aGroupHelper);
+ lcl_insertElements(xSection,m_aControls);
+ lcl_setValues(xSection,m_aValues);
+ m_bInserted = true;
+}
+//----------------------------------------------------------------------------
+void OGroupSectionUndo::implReRemove( )
+{
+ if( m_eAction == Removed )
+ collectControls(m_pMemberFunction(&m_aGroupHelper));
+
+ uno::Sequence< beans::PropertyValue > aArgs(2);
+
+ aArgs[0].Name = SID_GROUPHEADER_WITHOUT_UNDO == m_nSlot? PROPERTY_HEADERON : PROPERTY_FOOTERON;
+ aArgs[0].Value <<= sal_False;
+ aArgs[1].Name = PROPERTY_GROUP;
+ aArgs[1].Value <<= m_aGroupHelper.getGroup();
+
+ m_pController->executeChecked(m_nSlot,aArgs);
+ m_bInserted = false;
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OToggleSlotUndo, OCommentUndoAction );
+//----------------------------------------------------------------------------
+OToggleSlotUndo::OToggleSlotUndo(OReportModel& _rMod,sal_uInt16 _nSlot,USHORT nCommentID)
+: OCommentUndoAction(_rMod,nCommentID)
+,m_nSlot(_nSlot)
+{
+}
+//----------------------------------------------------------------------------
+void OToggleSlotUndo::Undo()
+{
+ const uno::Sequence< beans::PropertyValue > aArgs;
+ m_pController->executeChecked(m_nSlot,aArgs);
+}
+//----------------------------------------------------------------------------
+void OToggleSlotUndo::Redo()
+{
+ Undo();
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OGroupUndo, OCommentUndoAction );
+//----------------------------------------------------------------------------
+OGroupUndo::OGroupUndo(OReportModel& _rMod
+ ,USHORT nCommentID
+ ,Action _eAction
+ ,const uno::Reference< report::XGroup>& _xGroup
+ ,const uno::Reference< report::XReportDefinition >& _xReportDefinition)
+: OCommentUndoAction(_rMod,nCommentID)
+,m_xGroup(_xGroup)
+,m_xReportDefinition(_xReportDefinition)
+,m_eAction(_eAction)
+{
+ m_nLastPosition = getPositionInIndexAccess(m_xReportDefinition->getGroups().get(),m_xGroup);
+}
+//----------------------------------------------------------------------------
+void OGroupUndo::implReInsert( )
+{
+ try
+ {
+ m_xReportDefinition->getGroups()->insertByIndex(m_nLastPosition,uno::makeAny(m_xGroup));
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while undoing remove group");
+ }
+}
+//----------------------------------------------------------------------------
+void OGroupUndo::implReRemove( )
+{
+ try
+ {
+ m_xReportDefinition->getGroups()->removeByIndex(m_nLastPosition);
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while redoing remove group");
+ }
+}
+//----------------------------------------------------------------------------
+void OGroupUndo::Undo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ const OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReRemove();
+ break;
+
+ case Removed:
+ implReInsert();
+ break;
+ }
+
+}
+//----------------------------------------------------------------------------
+void OGroupUndo::Redo()
+{
+ OXUndoEnvironment& rEnv = static_cast< OReportModel& >( rMod ).GetUndoEnv();
+ const OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReInsert();
+ break;
+
+ case Removed:
+ implReRemove();
+ break;
+ }
+}
+//----------------------------------------------------------------------------
+//============================================================================
+} // rptui
+//============================================================================
+
+
diff --git a/reportdesign/source/ui/misc/makefile.mk b/reportdesign/source/ui/misc/makefile.mk
new file mode 100644
index 000000000000..bc909b1f3e49
--- /dev/null
+++ b/reportdesign/source/ui/misc/makefile.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=uimisc
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files -------------------------------------
+
+# ... resource files ............................
+
+# ... object files ............................
+
+EXCEPTIONSFILES= \
+ $(SLO)$/Undo.obj \
+ $(SLO)$/ColorListener.obj \
+ $(SLO)$/UITools.obj \
+ $(SLO)$/rptuiservices.obj \
+ $(SLO)$/toolboxcontroller.obj \
+ $(SLO)$/reportformula.obj
+
+
+SLOFILES= \
+ $(EXCEPTIONSFILES)
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/reportdesign/source/ui/misc/rptuiservices.cxx b/reportdesign/source/ui/misc/rptuiservices.cxx
new file mode 100644
index 000000000000..6f399389def5
--- /dev/null
+++ b/reportdesign/source/ui/misc/rptuiservices.cxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: rptuiservices.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _CPPUHELPER_IMPLEMENATIONENTRY_HXX_
+#include <cppuhelper/implementationentry.hxx>
+#endif
+
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#include "toolboxcontroller.hxx"
+#include "DefaultInspection.hxx"
+#include "ReportComponentHandler.hxx"
+#include "GeometryHandler.hxx"
+
+/********************************************************************************************/
+
+using namespace ::rtl;
+using namespace ::rptui;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::registry;
+
+//***************************************************************************************
+//
+// registry functions
+namespace
+{
+
+cppu::ImplementationEntry entries[] = {
+ { &OReportController::create, &OReportController::getImplementationName_Static, &OReportController::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &OToolboxController::create, &OToolboxController::getImplementationName_Static, &OToolboxController::getSupportedServiceNames_Static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &DefaultComponentInspectorModel::create, &DefaultComponentInspectorModel::getImplementationName_Static, &DefaultComponentInspectorModel::getSupportedServiceNames_static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ReportComponentHandler::create, &ReportComponentHandler::getImplementationName_Static, &ReportComponentHandler::getSupportedServiceNames_static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &GeometryHandler::create, &GeometryHandler::getImplementationName_Static, &GeometryHandler::getSupportedServiceNames_static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 }
+};
+}
+
+extern "C" void * SAL_CALL component_getFactory(
+ char const * implName, void * serviceManager, void * registryKey)
+{
+ return cppu::component_getFactoryHelper(
+ implName, serviceManager, registryKey, entries);
+}
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+ char const ** envTypeName, uno_Environment **)
+{
+ *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(
+ void * serviceManager, void * registryKey)
+{
+ return cppu::component_writeInfoHelper(
+ serviceManager, registryKey, entries);
+}
diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx
new file mode 100644
index 000000000000..1d2961fa3383
--- /dev/null
+++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx
@@ -0,0 +1,434 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: toolboxcontroller.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_TOOLBOXCONTROLLER_HXX
+#include "toolboxcontroller.hxx"
+#endif
+#ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
+#include <com/sun/star/ui/ImageType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef _SV_MENU_HXX
+#include <vcl/menu.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGER_HPP_
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XMODULEUICONFIGURATIONMANAGERSUPPLIER_HPP_
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XIMAGEMANAGER_HPP_
+#include <com/sun/star/ui/XImageManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_IMAGETYPE_HPP_
+#include <com/sun/star/ui/ImageType.hpp>
+#endif
+#ifndef _COM_SUN_STAR_GRAPHIC_XGRAPHIC_HPP_
+#include <com/sun/star/graphic/XGraphic.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_COLOR_HPP_
+#include <com/sun/star/util/Color.hpp>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_TOOLBOX_HXX
+#include <vcl/toolbox.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
+#include <svtools/miscopt.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+#include <svtools/moduleoptions.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_MENUOPTIONS_HXX
+#include <svtools/menuoptions.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+#ifndef _PASTEDLG_HXX
+#include <so3/pastedlg.hxx>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#define ITEMID_COLOR 1
+#define ITEMID_BRUSH 2
+#define ITEMID_FONT 3
+#define ITEMID_FONTHEIGHT 4
+#include <svx/fontitem.hxx>
+#include <svx/fhgtitem.hxx>
+#ifndef _SVX_TBCONTRL_HXX
+#include <svx/tbcontrl.hxx>
+#endif
+#ifndef _SVX_COLRITEM_HXX
+#include <svx/colritem.hxx>
+#endif
+#ifndef _SVX_TBXCUSTOMSHAPES_HXX
+#include <svx/tbxcustomshapes.hxx>
+#endif
+
+#include <comphelper/sequence.hxx>
+
+#include <memory>
+
+namespace rptui
+{
+ using namespace svt;
+ using namespace com::sun::star;
+ using namespace com::sun::star::uno;
+ using namespace com::sun::star::beans;
+ using namespace com::sun::star::lang;
+ using namespace frame;
+ using namespace util;
+ using namespace ui;
+
+::rtl::OUString SAL_CALL OToolboxController::getImplementationName() throw( RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------------
+::rtl::OUString OToolboxController::getImplementationName_Static() throw( RuntimeException )
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.comp.ReportToolboxController"));
+}
+//------------------------------------------------------------------------------
+Sequence< ::rtl::OUString> OToolboxController::getSupportedServiceNames_Static(void) throw( RuntimeException )
+{
+ Sequence< ::rtl::OUString> aSupported(1);
+ aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ReportToolboxController"));
+ return aSupported;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+//-------------------------------------------------------------------------
+Sequence< ::rtl::OUString> SAL_CALL OToolboxController::getSupportedServiceNames() throw(RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+// -------------------------------------------------------------------------
+Reference< XInterface > OToolboxController::create(Reference< XComponentContext > const & xContext)
+{
+ return *(new OToolboxController(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)));
+}
+// -----------------------------------------------------------------------------
+OToolboxController::OToolboxController(const Reference< XMultiServiceFactory >& _rxORB)
+ : m_pToolbarController(NULL)
+ ,m_nToolBoxId(1)
+ ,m_nSlotId(0)
+{
+ osl_incrementInterlockedCount(&m_refCount);
+ m_xServiceManager = _rxORB;
+ osl_decrementInterlockedCount(&m_refCount);
+
+}
+// -----------------------------------------------------------------------------
+OToolboxController::~OToolboxController()
+{
+}
+// -----------------------------------------------------------------------------
+// XInterface
+Any SAL_CALL OToolboxController::queryInterface( const Type& _rType ) throw (RuntimeException)
+{
+ Any aReturn = ToolboxController::queryInterface(_rType);
+ if (!aReturn.hasValue())
+ aReturn = TToolboxController_BASE::queryInterface(_rType);
+ return aReturn;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::acquire() throw ()
+{
+ ToolboxController::acquire();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::release() throw ()
+{
+ ToolboxController::release();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException)
+{
+ ToolboxController::initialize(_rArguments);
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
+ if ( pToolBox )
+ {
+ const USHORT nCount = pToolBox->GetItemCount();
+ for (USHORT nPos = 0; nPos < nCount; ++nPos)
+ {
+ const USHORT nItemId = pToolBox->GetItemId(nPos);
+ if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) )
+ {
+ m_nToolBoxId = nItemId;
+ break;
+ }
+ }
+ if ( m_aCommandURL.equalsAscii(".uno:BasicShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:BasicShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_BASIC,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:SymbolShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SymbolShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_SYMBOL,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:ArrowShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ArrowShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_ARROW,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:FlowChartShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FlowChartShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_FLOWCHART,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:CalloutShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CalloutShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_CALLOUT,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:StarShapes") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StarShapes")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_STAR,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:FontHeight") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FontHeight")),sal_True));
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CharFontName")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontHeightToolBoxControl(m_nSlotId = SID_ATTR_CHAR_FONTHEIGHT,m_nToolBoxId,*pToolBox));
+ addStatusListener( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CharFontName" )));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:CharFontName") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CharFontName")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox));
+ }
+ else if ( m_aCommandURL.equalsAscii(".uno:FontColor") || m_aCommandURL.equalsAscii(".uno:Color") )
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FontColor")),sal_True));
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Color")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontColorExtToolBoxControl/*SvxFontColorToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_COLOR2,m_nToolBoxId,*pToolBox));
+ }
+ else
+ {
+ m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:BackgroundColor")),sal_True));
+ m_pToolbarController = TToolbarHelper::createFromQuery(new SvxColorToolBoxControl(m_nSlotId = SID_BACKGROUND_COLOR,m_nToolBoxId,*pToolBox));
+ }
+
+ TCommandState::iterator aIter = m_aStates.begin();
+ for (; aIter != m_aStates.end(); ++aIter)
+ addStatusListener(aIter->first);
+
+ if ( m_pToolbarController.is() )
+ m_pToolbarController->initialize(_rArguments);
+ // check if paste special is allowed, when not don't add DROPDOWN
+ pToolBox->SetItemBits(m_nToolBoxId,pToolBox->GetItemBits(m_nToolBoxId) | TIB_DROPDOWN);
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event ) throw ( RuntimeException )
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ TCommandState::iterator aFind = m_aStates.find( Event.FeatureURL.Complete );
+ if ( aFind != m_aStates.end() )
+ {
+ aFind->second = Event.IsEnabled;
+ if ( m_pToolbarController.is() )
+ {
+ // All other status events will be processed here
+ sal_Bool bSetCheckmark = sal_False;
+ sal_Bool bCheckmark = sal_False;
+ //m_pToolbarController->GetToolBox().Enable(Event.IsEnabled);
+ ToolBox& rTb = m_pToolbarController->GetToolBox();
+ for ( USHORT i = 0; i < rTb.GetItemCount(); i++ )
+ {
+ USHORT nId = rTb.GetItemId( i );
+ if ( nId == 0 )
+ continue;
+
+ rtl::OUString aCmd = rTb.GetItemCommand( nId );
+ if ( aCmd == Event.FeatureURL.Complete )
+ {
+ // Enable/disable item
+ rTb.EnableItem( nId, Event.IsEnabled );
+
+ // Checkmark
+ if ( Event.State >>= bCheckmark )
+ bSetCheckmark = sal_True;
+
+ if ( bSetCheckmark )
+ rTb.CheckItem( nId, bCheckmark );
+ else
+ {
+ rtl::OUString aItemText;
+
+ if ( Event.State >>= aItemText )
+ rTb.SetItemText( nId, aItemText );
+ }
+ }
+ }
+
+ switch(m_nSlotId)
+ {
+ case SID_ATTR_CHAR_COLOR2:
+ case SID_BACKGROUND_COLOR:
+ {
+ util::Color nColor(COL_TRANSPARENT);
+ Event.State >>= nColor;
+ SvxColorItem aColorItem(::Color(nColor),1);
+ if ( SID_ATTR_CHAR_COLOR2 == m_nSlotId )
+ static_cast<SvxFontColorExtToolBoxControl*>(m_pToolbarController.get())->StateChanged(m_nSlotId,Event.IsEnabled ? SFX_ITEM_SET : SFX_ITEM_DISABLED,&aColorItem);
+ else
+ static_cast<SvxColorToolBoxControl*>(m_pToolbarController.get())->StateChanged(m_nSlotId,Event.IsEnabled ? SFX_ITEM_SET : SFX_ITEM_DISABLED,&aColorItem);
+ }
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ {
+ /*::std::auto_ptr<SfxPoolItem> pState;
+ if ( Event.FeatureURL.Complete == m_aCommandURL )
+ pState.reset(new SvxFontHeightItem());
+ else
+ pState.reset(new SvxFontItem());
+ pState->PutValue(Event.State);*/
+ //static_cast<SvxFontHeightToolBoxControl*>(m_pToolbarController.get())->StateChanged(m_nSlotId,Event.IsEnabled ? SFX_ITEM_AVAILABLE : SFX_ITEM_DISABLED,pState.get());
+ static_cast<SvxFontHeightToolBoxControl*>(m_pToolbarController.get())->statusChanged(Event);
+ }
+ break;
+ case SID_ATTR_CHAR_FONT:
+ {
+ SvxFontItem aItem(ITEMID_FONT);
+ aItem.PutValue(Event.State);
+ static_cast<SvxFontNameToolBoxControl*>(m_pToolbarController.get())->StateChanged(m_nSlotId,Event.IsEnabled ? SFX_ITEM_AVAILABLE : SFX_ITEM_DISABLED,&aItem);
+ }
+ break;
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() throw (RuntimeException)
+{
+ // execute the menu
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ Reference< awt::XWindow > xRet;
+ if ( m_pToolbarController.is() )
+ xRet = m_pToolbarController.getRef()->createPopupWindow();
+
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OToolboxController::opensSubToolbar() throw (uno::RuntimeException)
+{
+ return m_nSlotId == SID_DRAWTBX_CS_BASIC;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OToolboxController::getSubToolbarName() throw (uno::RuntimeException)
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY);
+ if ( xSub.is() )
+ return xSub->getSubToolbarName();
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::functionSelected( const ::rtl::OUString& rCommand ) throw (uno::RuntimeException)
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY);
+ if ( xSub.is() )
+ {
+ xSub->functionSelected(m_aCommandURL = rCommand);
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OToolboxController::updateImage( ) throw (uno::RuntimeException)
+{
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ uno::Reference< frame::XSubToolbarController> xSub(m_pToolbarController.getRef(),uno::UNO_QUERY);
+ if ( xSub.is() )
+ xSub->updateImage();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< awt::XWindow > SAL_CALL OToolboxController::createItemWindow( const uno::Reference< awt::XWindow >& _xParent)
+throw (uno::RuntimeException)
+{
+ uno::Reference< awt::XWindow > xWindow;
+ if ( m_pToolbarController.is() )
+ {
+ switch(m_nSlotId)
+ {
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ xWindow = VCLUnoHelper::GetInterface(static_cast<SvxFontHeightToolBoxControl*>(m_pToolbarController.get())->CreateItemWindow(VCLUnoHelper::GetWindow(_xParent)));
+ break;
+ case SID_ATTR_CHAR_FONT:
+ xWindow = VCLUnoHelper::GetInterface(static_cast<SvxFontNameToolBoxControl*>(m_pToolbarController.get())->CreateItemWindow(VCLUnoHelper::GetWindow(_xParent)));
+ break;
+ default:
+ ;
+ }
+ }
+ return xWindow;
+}
+// -----------------------------------------------------------------------------
+//..........................................................................
+} // rptui
+//..........................................................................
+
+
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
new file mode 100644
index 000000000000..083b1528498c
--- /dev/null
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -0,0 +1,740 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: DesignView.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef DBUI_TABLECONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
+#include <svtools/syslocale.hxx>
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#include "UITools.hxx"
+#include "RptObject.hxx"
+#ifndef _REPORT_PROPBRW_HXX
+#include "propbrw.hxx"
+#endif
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include <toolkit/helper/convert.hxx>
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef RPTUI_ADDFIELDWINDOW_HXX
+#include "AddField.hxx"
+#endif
+#ifndef RPTUI_SCROLLHELPER_HXX
+#include "ScrollHelper.hxx"
+#endif
+#ifndef INCLUDED_RPTUI_NAVIGATOR_HXX
+#include "Navigator.hxx"
+#endif
+#include <vcl/svapp.hxx>
+
+namespace rptui
+{
+using namespace ::dbaui;
+using namespace ::utl;
+using namespace ::com::sun::star;
+using namespace uno;
+using namespace lang;
+using namespace beans;
+using namespace container;
+
+#define LINE_SIZE 50
+//==================================================================
+// class ODesignView
+//==================================================================
+DBG_NAME( rpt_ODesignView )
+//------------------------------------------------------------------------------
+ODesignView::ODesignView( Window* pParent,
+ const Reference< XMultiServiceFactory >& _rxOrb,
+ OReportController* _pController) :
+ ODataView( pParent,_pController,_rxOrb,WB_DIALOGCONTROL )
+ ,m_aSplitter(this,WB_HSCROLL)
+ ,m_pReportController( _pController )
+ ,m_pPropWin(NULL)
+ ,m_pAddField(NULL)
+ ,m_pCurrentView(NULL)
+ ,m_pReportExplorer(NULL)
+ ,m_eMode( RPTUI_SELECT )
+ ,m_nCurrentPosition(USHRT_MAX)
+ ,m_eActObj( OBJ_NONE )
+ ,m_bFirstDraw(FALSE)
+ ,m_aGridSize( 250, 250 ) // 100TH_MM
+ ,m_bGridVisible(TRUE)
+ ,m_bGridSnap(TRUE)
+ ,m_bInSplitHandler( FALSE )
+{
+ DBG_CTOR( rpt_ODesignView,NULL);
+ SetUniqueId(UID_RPT_APP_VIEW);
+ ImplInitSettings();
+
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ m_pScrollWindow = new OScrollWindowHelper(this);
+ m_pScrollWindow->Show();
+
+ // now create the task pane on the right side :-)
+ m_pTaskPane = new Window(this);
+ m_pTaskPane->Show();
+
+ // Splitter einrichten
+ m_aSplitter.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
+ //m_aSplitter.Show();
+
+ m_aMarkTimer.SetTimeout( 100 );
+ m_aMarkTimer.SetTimeoutHdl( LINK( this, ODesignView, MarkTimeout ) );
+}
+
+//------------------------------------------------------------------------------
+ODesignView::~ODesignView()
+{
+ DBG_DTOR( rpt_ODesignView,NULL);
+ m_aMarkTimer.Stop();
+ if ( m_pPropWin )
+ {
+ notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ ::std::auto_ptr<Window> aTemp2(m_pPropWin);
+ m_pPropWin = NULL;
+ }
+ if ( m_pAddField )
+ {
+ notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ ::std::auto_ptr<Window> aTemp2(m_pAddField);
+ m_pAddField = NULL;
+ }
+ if ( m_pReportExplorer )
+ {
+ notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ ::std::auto_ptr<Window> aTemp2(m_pReportExplorer);
+ m_pReportExplorer = NULL;
+ }
+ {
+ ::std::auto_ptr<Window> aT3(m_pScrollWindow);
+ m_pScrollWindow = NULL;
+ }
+ {
+ ::std::auto_ptr<Window> aTemp2(m_pTaskPane);
+ m_pTaskPane = NULL;
+ }
+}
+// -----------------------------------------------------------------------------
+void ODesignView::initialize()
+{
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_pScrollWindow->initialize();
+ m_pScrollWindow->Show();
+}
+//-----------------------------------------------------------------------------
+void ODesignView::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ ODataView::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+long ODesignView::PreNotify( NotifyEvent& rNEvt )
+{
+ long nRet = ODataView::PreNotify(rNEvt); // 1 := has to be handled here
+ switch(rNEvt.GetType())
+ {
+ case EVENT_KEYINPUT:
+ //if ( nRet != 1L )
+ {
+ const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
+ if ( handleKeyEvent(*pKeyEvent) )
+ nRet = 1L;
+ else if ( nRet == 1L && m_pAccel.get() && m_pController )
+ {
+ const KeyCode& rCode = pKeyEvent->GetKeyCode();
+ util::URL aUrl;
+ aUrl.Complete = m_pAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rCode));
+ if ( !aUrl.Complete.getLength() || !m_pController->isCommandEnabled( aUrl.Complete ) )
+ nRet = 0L;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ return nRet;
+}
+//------------------------------------------------------------------------------
+void ODesignView::resizeDocumentView(Rectangle& _rPlayground)
+{
+ if ( !_rPlayground.IsEmpty() )
+ {
+ const Size aPlaygroundSize( _rPlayground.GetSize() );
+
+ // calc the split pos, and forward it to the controller
+ sal_Int32 nSplitPos = getController()->getSplitPos();
+ if ( 0 != aPlaygroundSize.Width() )
+ {
+ if ( ( -1 == nSplitPos )
+ || ( nSplitPos >= aPlaygroundSize.Width() )
+ )
+ {
+ long nMinWidth = static_cast<long>(0.1*aPlaygroundSize.Width());
+ if ( m_pPropWin && m_pPropWin->IsVisible() )
+ nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
+ nSplitPos = static_cast<sal_Int32>(_rPlayground.Right() - nMinWidth);
+ getController()->setSplitPos(nSplitPos);
+ }
+ } // if ( 0 != _rPlaygroundSize.Width() )
+
+ Size aReportWindowSize(aPlaygroundSize);
+ if ( m_aSplitter.IsVisible() )
+ {
+ // normalize the split pos
+ Size aSplitSize( m_aSplitter.GetSizePixel().Width(),_rPlayground.GetHeight());
+
+ Point aTaskPanePos(nSplitPos + aSplitSize.Width(), _rPlayground.Top());
+ //long nTest = m_pPropWin->GetMinOutputSizePixel().Width();
+ if ( m_pTaskPane && m_pTaskPane->IsVisible() )
+ {
+ aTaskPanePos.X() = aPlaygroundSize.Width() - m_pTaskPane->GetSizePixel().Width();
+ sal_Int32 nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
+ if ( nMinWidth > (aPlaygroundSize.Width() - aTaskPanePos.X()) )
+ {
+ aTaskPanePos.X() = aPlaygroundSize.Width() - nMinWidth;
+ }
+ nSplitPos = aTaskPanePos.X() - aSplitSize.Width();
+ getController()->setSplitPos(nSplitPos);
+ }
+ Point aSplitPos( nSplitPos,_rPlayground.Top() );
+ // set the size of the splitter
+ m_aSplitter.SetPosSizePixel( aSplitPos, aSplitSize );
+ m_aSplitter.SetDragRectPixel( _rPlayground );
+
+ aReportWindowSize = Size(aSplitPos.X() - _rPlayground.Left() - aSplitSize.Width(),_rPlayground.GetHeight());
+ Size aTaskPaneSize(aPlaygroundSize.Width() - aTaskPanePos.X(),aPlaygroundSize.Height() );
+
+ // set the size of the task pane
+
+ m_pTaskPane->SetPosSizePixel(aTaskPanePos,aTaskPaneSize);
+ if ( m_pPropWin )
+ m_pPropWin->SetSizePixel(aTaskPaneSize);
+ }
+
+ // set the size of the report window
+ m_pScrollWindow->SetPosSizePixel(
+ _rPlayground.TopLeft()
+ ,aReportWindowSize
+ );
+ }
+ // just for completeness: there is no space left, we occupied it all ...
+ _rPlayground.SetPos( _rPlayground.BottomRight() );
+ _rPlayground.SetSize( Size( 0, 0 ) );
+
+}
+// -----------------------------------------------------------------------------
+// set the view readonly or not
+void ODesignView::setReadOnly(sal_Bool /*_bReadOnly*/)
+{
+}
+//----------------------------------------------------------------------------
+IMPL_LINK( ODesignView, MarkTimeout, Timer *, EMPTYARG )
+{
+ if ( m_pPropWin && m_pPropWin->IsVisible() )
+ {
+ m_pPropWin->Update(m_pCurrentView);
+ uno::Reference<beans::XPropertySet> xProp(m_xReportComponent,uno::UNO_QUERY);
+ if ( xProp.is() )
+ m_pPropWin->Update(xProp);
+ Resize();
+ }
+
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::SetMode( DlgEdMode _eNewMode )
+{
+ m_eMode = _eNewMode;
+ if ( m_eMode == RPTUI_SELECT )
+ m_eActObj = OBJ_NONE;
+ if ( m_pScrollWindow )
+ m_pScrollWindow->SetMode(_eNewMode);
+}
+//----------------------------------------------------------------------------
+void ODesignView::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ m_eActObj = eObj;
+ if ( m_pScrollWindow )
+ m_pScrollWindow->SetInsertObj( eObj,_sShapeType );
+}
+
+//----------------------------------------------------------------------------
+
+USHORT ODesignView::GetInsertObj() const
+{
+ return m_eActObj;
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::Cut()
+{
+ Copy();
+ Delete();
+}
+
+//----------------------------------------------------------------------------
+
+void ODesignView::Copy()
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->Copy();
+}
+
+//----------------------------------------------------------------------------
+
+void ODesignView::Paste()
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->Paste();
+}
+//----------------------------------------------------------------------------
+void ODesignView::Delete()
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->Delete();
+}
+//----------------------------------------------------------------------------
+BOOL ODesignView::HasSelection()
+{
+ return m_pScrollWindow && m_pScrollWindow->HasSelection();
+}
+//----------------------------------------------------------------------------
+
+BOOL ODesignView::IsPasteAllowed()
+{
+ return m_pScrollWindow && m_pScrollWindow->IsPasteAllowed();
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::UpdatePropertyBrowserDelayed(OSectionView* _pView)
+{
+ if ( m_pCurrentView != _pView )
+ {
+ if ( m_pCurrentView && m_pScrollWindow )
+ m_pScrollWindow->setMarked(m_pCurrentView,sal_False);
+ m_pCurrentView = _pView;
+ if ( m_pCurrentView && m_pScrollWindow )
+ m_pScrollWindow->setMarked(m_pCurrentView,sal_True);
+ m_xReportComponent.clear();
+ DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED );
+ Broadcast( aHint );
+ }
+ m_aMarkTimer.Start();
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::toggleGrid(sal_Bool _bGridVisible)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->toggleGrid(_bGridVisible);
+}
+//----------------------------------------------------------------------------
+USHORT ODesignView::getSectionCount() const
+{
+ USHORT nRet = 0;
+ if ( m_pScrollWindow )
+ nRet = m_pScrollWindow->getSectionCount();
+ return nRet;
+}
+//----------------------------------------------------------------------------
+void ODesignView::showRuler(sal_Bool _bShow)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->showRuler(_bShow);
+}
+//----------------------------------------------------------------------------
+void ODesignView::removeSection(USHORT _nPosition)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->removeSection(_nPosition);
+}
+//----------------------------------------------------------------------------
+void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->addSection(_xSection,_sColorEntry,_nPosition);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::GetFocus()
+{
+ Window::GetFocus();
+ if ( m_pScrollWindow )
+ {
+ ::boost::shared_ptr<OReportSection> pSection = m_pScrollWindow->getMarkedSection();
+ if ( pSection )
+ pSection->GrabFocus();
+ }
+}
+// -----------------------------------------------------------------------------
+void ODesignView::ImplInitSettings()
+{
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+ SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( ODesignView, SplitHdl, void*, )
+{
+ m_bInSplitHandler = sal_True;
+ const long nTest = m_aSplitter.GetSplitPosPixel();
+ const Size aOutputSize = GetOutputSizePixel();
+ long nMinWidth = static_cast<long>(0.1*aOutputSize.Width());
+ if ( m_pPropWin && m_pPropWin->IsVisible() )
+ nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
+
+ if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_pScrollWindow->getMaxMarkerWidth(sal_False) )
+ {
+ m_aSplitter.SetPosPixel( Point( nTest,m_aSplitter.GetPosPixel().Y() ) );
+ getController()->setSplitPos(nTest);
+ if ( m_pTaskPane && m_pTaskPane->IsVisible() )
+ {
+ Point aTaskPanePos(nTest + m_aSplitter.GetSizePixel().Width(), 0);
+ Size aTaskPaneSize(aOutputSize.Width() - aTaskPanePos.X(),aOutputSize.Height() );
+ m_pTaskPane->SetPosSizePixel(aTaskPanePos,aTaskPaneSize);
+ if ( m_pPropWin )
+ m_pPropWin->SetSizePixel(aTaskPaneSize);
+ // set the size of the report window
+ m_pScrollWindow->SetSizePixel(Size(nTest,aOutputSize.Height()));
+ }
+ }
+
+ m_bInSplitHandler = sal_False;
+
+ return 0L;
+}
+//-----------------------------------------------------------------------------
+void ODesignView::SelectAll()
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->SelectAll();
+}
+//-----------------------------------------------------------------------------
+void ODesignView::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->unmarkAllObjects(_pSectionView);
+}
+//-----------------------------------------------------------------------------
+void ODesignView::togglePropertyBrowser(sal_Bool _bToogleOn)
+{
+ if ( !m_pPropWin && _bToogleOn )
+ {
+ m_pPropWin = new PropBrw(getController()->getORB(),m_pTaskPane,this);
+ notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::AddWindow));
+ }
+ if ( m_pPropWin && _bToogleOn != m_pPropWin->IsVisible() )
+ {
+ if ( !m_pCurrentView && !m_xReportComponent.is() )
+ m_xReportComponent = getController()->getReportDefinition();
+
+ const sal_Bool bWillBeVisible = _bToogleOn;
+ m_pPropWin->Show(bWillBeVisible);
+ m_aSplitter.Show(bWillBeVisible);
+ m_pTaskPane->Show(bWillBeVisible);
+ Resize();
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ if ( bWillBeVisible )
+ m_aMarkTimer.Start();
+ }
+}
+//-----------------------------------------------------------------------------
+void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xReportComponent)
+{
+ if ( m_xReportComponent != _xReportComponent )
+ {
+ m_xReportComponent = _xReportComponent;
+ if ( m_pCurrentView )
+ m_pScrollWindow->setMarked(m_pCurrentView,sal_False);
+ m_pCurrentView = NULL;
+ m_aMarkTimer.Start();
+ }
+}
+//-----------------------------------------------------------------------------
+BOOL ODesignView::isReportExplorerVisible() const
+{
+ return m_pReportExplorer && m_pReportExplorer->IsVisible();
+}
+//-----------------------------------------------------------------------------
+void ODesignView::toggleReportExplorer()
+{
+ if ( !m_pReportExplorer )
+ {
+ OReportController* pReportController = getController();
+ m_pReportExplorer = new ONavigator(this,pReportController);
+ m_pReportExplorer->AddEventListener(LINK(pReportController,OReportController,EventLstHdl));
+ notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::AddWindow));
+ }
+ else
+ m_pReportExplorer->Show(!m_pReportExplorer->IsVisible());
+}
+//-----------------------------------------------------------------------------
+BOOL ODesignView::isAddFieldVisible() const
+{
+ return m_pAddField && m_pAddField->IsVisible();
+}
+//-----------------------------------------------------------------------------
+void ODesignView::toggleAddField()
+{
+ if ( !m_pAddField )
+ {
+ uno::Reference< report::XReportDefinition > xReport(m_xReportComponent,uno::UNO_QUERY);
+ uno::Reference< report::XReportComponent > xReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ OReportController* pReportController = getController();
+ if ( !m_pCurrentView && !xReport.is() )
+ {
+ if ( xReportComponent.is() )
+ xReport = xReportComponent->getSection()->getReportDefinition();
+ else
+ xReport = pReportController->getReportDefinition().get();
+ }
+ else if ( m_pCurrentView )
+ {
+ uno::Reference< report::XSection > xSection = m_pCurrentView->getSectionWindow()->getSection();
+ xReport = xSection->getReportDefinition();
+ }
+ m_pAddField = new OAddFieldWindow(*pReportController,this);
+ m_pAddField->Update();
+ m_pAddField->AddEventListener(LINK(pReportController,OReportController,EventLstHdl));
+ notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::AddWindow));
+ }
+ else
+ m_pAddField->Show(!m_pAddField->IsVisible());
+}
+// -------------------------------------------------------------------------
+uno::Reference< report::XSection > ODesignView::getCurrentSection() const
+{
+ uno::Reference< report::XSection > xSection;
+ if ( m_pCurrentView )
+ xSection = m_pCurrentView->getSectionWindow()->getSection();
+
+ // why do we need the code below?
+ //else
+ // {
+ // OReportController* pReportController = getController();
+ // if ( pReportController )
+ // xSection = pReportController->getReportDefinition()->getDetail();
+ // }
+ return xSection;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel() const
+{
+ uno::Reference< report::XReportComponent > xModel;
+ if ( m_pCurrentView )
+ {
+ xModel = m_pCurrentView->getSectionWindow()->getCurrentControlModel();
+ }
+ return xModel;
+}
+// -------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> ODesignView::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_pScrollWindow ? m_pScrollWindow->getMarkedSection(nsa) : ::boost::shared_ptr<OReportSection>();
+}
+// -------------------------------------------------------------------------
+void ODesignView::markSection(const sal_uInt16 _nPos)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->collapseSections(_aCollpasedSections);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ODesignView::getCurrentPage() const
+{
+ return m_pPropWin ? m_pPropWin->getCurrentPage() : ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+void ODesignView::setCurrentPage(const ::rtl::OUString& _sLastActivePage)
+{
+ if ( m_pPropWin )
+ m_pPropWin->setCurrentPage(_sLastActivePage);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects);
+}
+// -----------------------------------------------------------------------------
+sal_Bool ODesignView::isAlignPossible() const
+{
+ ::boost::shared_ptr<OReportSection> pMarkedSection = getMarkedSection();
+ return pMarkedSection.get() && pMarkedSection->getView()->IsAlignPossible();
+}
+// -------------------------------------------------------------------------
+sal_Int32 ODesignView::getMaxMarkerWidth(sal_Bool _bWithEnd) const
+{
+ return m_pScrollWindow->getMaxMarkerWidth(_bWithEnd);
+}
+//------------------------------------------------------------------------------
+sal_Bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ if ( (m_pPropWin && m_pPropWin->HasChildPathFocus()) )
+ return sal_False;
+ return m_pScrollWindow && m_pScrollWindow->handleKeyEvent(_rEvent);
+}
+//------------------------------------------------------------------------
+void ODesignView::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->setMarked(_pSectionView,_bMark);
+}
+//------------------------------------------------------------------------
+void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ if ( m_pScrollWindow )
+ {
+ m_pScrollWindow->setMarked(_xSection,_bMark);
+ if ( _bMark )
+ UpdatePropertyBrowserDelayed(getMarkedSection()->getView());
+ else
+ m_pCurrentView = NULL;
+ }
+}
+//------------------------------------------------------------------------
+void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,sal_Bool _bMark)
+{
+ if ( m_pScrollWindow )
+ {
+ m_pScrollWindow->setMarked(_aShapes,_bMark);
+ if ( _aShapes.hasElements() && _bMark )
+ showProperties(_aShapes[0]);
+ else
+ m_xReportComponent.clear();
+ }
+}
+//------------------------------------------------------------------------------
+void ODesignView::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() )
+ {
+ const uno::Sequence< beans::PropertyValue> aArgs;
+ getController()->executeChecked(SID_SELECT_REPORT,aArgs);
+ }
+ ODataView::MouseButtonDown(rMEvt);
+}
+// -----------------------------------------------------------------------------
+uno::Any ODesignView::getCurrentlyShownProperty() const
+{
+ uno::Any aRet;
+ ::boost::shared_ptr<OReportSection> pSection = getMarkedSection();
+ if ( pSection )
+ {
+ ::std::vector< uno::Reference< report::XReportComponent > > aSelection;
+ pSection->fillControlModelSelection(aSelection);
+ if ( !aSelection.empty() )
+ aRet <<= uno::Sequence< uno::Reference< report::XReportComponent > >(&(*aSelection.begin()),aSelection.size());
+
+ }
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+void ODesignView::setGridSnap(BOOL bOn)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->setGridSnap(bOn);
+
+}
+// -----------------------------------------------------------------------------
+void ODesignView::setDragStripes(BOOL bOn)
+{
+ if ( m_pScrollWindow )
+ m_pScrollWindow->setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+BOOL ODesignView::isDragStripes() const
+{
+ return m_pScrollWindow ? m_pScrollWindow->isDragStripes() : FALSE;
+}
+// -----------------------------------------------------------------------------
+sal_Bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
+{
+ return m_pPropWin && m_pPropWin->HasChildPathFocus();
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 ODesignView::getMarkedObjectCount() const
+{
+ return m_pScrollWindow ? m_pScrollWindow->getMarkedObjectCount() : 0;
+}
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
new file mode 100644
index 000000000000..26e0e10fb98f
--- /dev/null
+++ b/reportdesign/source/ui/report/EndMarker.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: EndMarker.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_ENDMARKER_HXX
+#include "EndMarker.hxx"
+#endif
+#ifndef RPTUI_COLORCHANGER_HXX
+#include "ColorChanger.hxx"
+#endif
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#include "ViewsWindow.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#include <vcl/svapp.hxx>
+#include <vcl/gradient.hxx>
+#include <vcl/lineinfo.hxx>
+
+
+#define CORNER_SPACE 5
+//=====================================================================
+namespace rptui
+{
+//=====================================================================
+ DBG_NAME( rpt_OEndMarker )
+OEndMarker::OEndMarker(Window* _pParent ,const ::rtl::OUString& _sColorEntry)
+: OColorListener(_pParent,_sColorEntry)
+{
+ DBG_CTOR( rpt_OEndMarker,NULL);
+ SetUniqueId(HID_ENDMARKER);
+ ImplInitSettings();
+}
+// -----------------------------------------------------------------------------
+OEndMarker::~OEndMarker()
+{
+ DBG_DTOR( rpt_OEndMarker,NULL);
+}
+// -----------------------------------------------------------------------------
+void OEndMarker::Paint( const Rectangle& /*rRect*/ )
+{
+ Size aSize = GetSizePixel();
+ aSize.Width() += CORNER_SPACE;
+ Rectangle aWholeRect(Point(-CORNER_SPACE,0),aSize);
+ PolyPolygon aPoly;
+ aPoly.Insert(Polygon(aWholeRect,CORNER_SPACE,CORNER_SPACE));
+
+ Color aStartColor(m_nColor);
+ aStartColor.IncreaseLuminance(10);
+ USHORT nHue = 0;
+ USHORT nSat = 0;
+ USHORT nBri = 0;
+ aStartColor.RGBtoHSB(nHue, nSat, nBri);
+ nSat += 40;
+ Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri));
+ Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor);
+ aGradient.SetSteps(static_cast<USHORT>(aSize.Height()));
+
+ DrawGradient(aPoly ,aGradient);
+ if ( m_bMarked )
+ {
+ Rectangle aRect( Point(-CORNER_SPACE,CORNER_SPACE),
+ Size(aSize.Width()- CORNER_SPACE,aSize.Height() - CORNER_SPACE- CORNER_SPACE));
+ ColorChanger aColors( this, COL_WHITE, COL_WHITE );
+ DrawPolyLine(Polygon(aRect),LineInfo(LINE_SOLID,2));
+ }
+}
+// -----------------------------------------------------------------------
+void OEndMarker::ImplInitSettings()
+{
+ //SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
+ SetBackground( );
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() );
+ //SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDarkShadowColor() );
+}
+// -----------------------------------------------------------------------
+void OEndMarker::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
+ return;
+ static_cast<OViewsWindow*>(GetParent())->showProperties(this);
+}
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
new file mode 100644
index 000000000000..51801605e208
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -0,0 +1,3851 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportController.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#define RPTUI_ID_LRSPACE 1
+#define RPTUI_ID_ULSPACE 2
+#define RPTUI_ID_PAGE 3
+#define RPTUI_ID_SIZE 4
+#define RPTUI_ID_PAGE_MODE 5
+#define RPTUI_ID_START 6
+#define RPTUI_ID_END 7
+#define RPTUI_ID_BRUSH 8
+#define RPTUI_ID_METRIC 9
+
+#define ITEMID_LRSPACE RPTUI_ID_LRSPACE
+#define ITEMID_ULSPACE RPTUI_ID_ULSPACE
+#define ITEMID_SIZE RPTUI_ID_SIZE
+#define ITEMID_PAGE RPTUI_ID_PAGE
+#define ITEMID_BRUSH RPTUI_ID_BRUSH
+
+
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#include "ReportDefinition.hxx"
+#endif
+#ifndef RPTUI_CONDFORMAT_HXX
+#include "CondFormat.hxx"
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#ifndef RPTUI_DATETIME_HXX
+#include "DateTime.hxx"
+#endif
+#ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX
+#include <svtools/syslocale.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _FILEDLGHELPER_HXX
+#include <sfx2/filedlghelper.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef TOOLS_DIAGNOSE_EX_H
+#include <tools/diagnose_ex.h>
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#include "reportformula.hxx"
+#ifndef _COMPHELPER_DOCUMENTCONSTANTS_HXX
+#include <comphelper/documentconstants.hxx>
+#endif
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#ifndef _SVX_FMVIEW_HXX
+#include <svx/fmview.hxx>
+#endif
+#ifndef _SVX_PAPERINF_HXX
+#include <svx/paperinf.hxx>
+#endif
+#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_
+#include <comphelper/sequenceashashmap.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _COM_SUN_STAR_VIEW_PAPERFORMAT_HPP_
+#include <com/sun/star/view/PaperFormat.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_GRAPHICLOCATION_HPP_
+#include <com/sun/star/style/GraphicLocation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_
+#include <com/sun/star/style/XStyle.hpp>
+#endif
+#ifndef _COM_SUN_STAR_STYLE_PAGESTYLELAYOUT_HPP_
+#include <com/sun/star/style/PageStyleLayout.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_EXTENDEDFILEPICKERELEMENTIDS_HPP_
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HPP_
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
+#include <com/sun/star/container/XChild.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XImageControl_HPP_
+#include <com/sun/star/report/XImageControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_FUNCTION_HPP_
+#include <com/sun/star/report/Function.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_XSHAPE_HPP_
+#include <com/sun/star/report/XShape.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTDESCRIPTOR_HPP_
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XDOCUMENTDATASOURCE_HPP_
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#endif
+#ifndef _COM_SUN_STAR_EMBED_ELEMENTMODES_HPP_
+#include <com/sun/star/embed/ElementModes.hpp>
+#endif
+#ifndef _COMPHELPER_STREAMSECTION_HXX_
+#include <comphelper/streamsection.hxx>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTWEIGHT_HPP_
+#include <com/sun/star/awt/FontWeight.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_FONTUNDERLINE_HPP_
+#include <com/sun/star/awt/FontUnderline.hpp>
+#endif
+#include <com/sun/star/awt/TextAlign.hpp>
+#ifndef _COM_SUN_STAR_AWT_FONTSLANT_HPP_
+#include <com/sun/star/awt/FontSlant.hpp>
+#endif
+#include <com/sun/star/frame/status/FontHeight.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+
+#include "DesignView.hxx"
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef RPTUI_UNDO_HXX
+#include "Undo.hxx"
+#endif
+#ifndef _SVX_DATACCESSDESCRIPTOR_HXX_
+#include <svx/dataaccessdescriptor.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SV_WAITOBJ_HXX
+#include <vcl/waitobj.hxx>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef _SVDOBJ_HXX
+#include <svx/svdobj.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _CLIPLISTENER_HXX
+#include <svtools/cliplistener.hxx>
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef RPTUI_UNDOACTIONS_HXX
+#include "UndoActions.hxx"
+#endif
+#ifndef RPTUI_DLGPAGE_HXX
+#include "dlgpage.hxx"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _SVX_SVXENUM_HXX
+#include <svx/svxenum.hxx>
+#endif
+#ifndef _SVX_PAGEITEM_HXX
+#include <svx/pageitem.hxx>
+#endif
+#ifndef _SVX_LRSPITEM_HXX
+#include <svx/lrspitem.hxx>
+#endif
+#ifndef _SVX_ULSPITEM_HXX
+#include <svx/ulspitem.hxx>
+#endif
+#ifndef _SVX_SIZEITEM_HXX
+#include <svx/sizeitem.hxx>
+#endif
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMSET_HXX //autogen wg. SfxItemSet
+#include <svtools/itemset.hxx>
+#endif
+#ifndef RPTUI_PROPERTYSETFORWARD_HXX
+#include "PropertyForward.hxx"
+#endif
+#ifndef _AEITEM_HXX //CHINA001
+#include <svtools/aeitem.hxx> //CHINA001
+#endif //CHINA001
+#ifndef _SVX_BRSHITEM_HXX
+#include <svx/brshitem.hxx>
+#endif
+#ifndef _SVX_FLAGSDEF_HXX
+#include <svx/flagsdef.hxx> //CHINA001
+#endif
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include <toolkit/helper/convert.hxx>
+#endif
+#ifndef RPTUI_GROUPS_SORTING_HXX
+#include "GroupsSorting.hxx"
+#endif
+#ifndef RPTUI_PAGENUMBER_HXX
+#include "PageNumber.hxx"
+#endif
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/helper/vclunohelper.hxx>
+#endif
+#include "UndoEnv.hxx"
+#include <svx/svdpagv.hxx>
+#include <boost/mem_fn.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+
+#include <com/sun/star/sdb/SQLContext.hpp>
+#include <com/sun/star/sdbc/SQLWarning.hpp>
+
+#include <cppuhelper/exc_hlp.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::sdbcx;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::sdb;
+using namespace ::com::sun::star::ui;
+using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::util;
+using namespace ::dbtools;
+using namespace ::rptui;
+using namespace ::dbaui;
+using namespace ::comphelper;
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ class UndoManagerListAction
+ {
+ private:
+ SfxUndoManager& m_rManager;
+
+ public:
+ UndoManagerListAction( SfxUndoManager& _rManager, const String& _rListActionComment )
+ :m_rManager( _rManager )
+ {
+ m_rManager.EnterListAction( _rListActionComment, String() );
+ }
+ ~UndoManagerListAction()
+ {
+ m_rManager.LeaveListAction();
+ }
+ };
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportControlFormat> lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,ODesignView* _pView,uno::Reference< awt::XWindow>& _xWindow)
+{
+ uno::Reference< report::XReportControlFormat> xReportControlFormat;
+ if ( aArgs.getLength() )
+ {
+ SequenceAsHashMap aMap(aArgs);
+ xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>());
+ _xWindow = aMap.getUnpackedValueOrDefault(CURRENT_WINDOW,uno::Reference< awt::XWindow>());
+ } // if ( aArgs.getLength() )
+ if ( !xReportControlFormat.is() )
+ xReportControlFormat.set( _pView->getCurrentControlModel(),uno::UNO_QUERY);
+ if ( !_xWindow.is() )
+ _xWindow = VCLUnoHelper::GetInterface(_pView);
+ return xReportControlFormat;
+}
+// -----------------------------------------------------------------------------
+// check overlapping
+void lcl_correctOverlapping(SdrUnoObj* pControl,::boost::shared_ptr<OReportSection> _pReportSection)
+{
+ OSectionView* pSectionView = _pReportSection->getView();
+ uno::Reference< report::XReportComponent> xComponent(pControl->getUnoShape(),uno::UNO_QUERY);
+ Rectangle aRet(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize()));
+ aRet.setHeight(aRet.getHeight() + 1);
+ aRet.setWidth(aRet.getWidth() + 1);
+ bool bOverlapping = true;
+ while ( bOverlapping )
+ {
+ bOverlapping = isOver(aRet,*_pReportSection->getPage(),*pSectionView,true,pControl);
+ if ( bOverlapping )
+ {
+ aRet.Move(0,aRet.getHeight());
+ xComponent->setPositionY(aRet.Top());
+ }
+ }
+ if ( !bOverlapping ) // now insert objects
+ pSectionView->InsertObjectAtView(pControl,*pSectionView->GetSdrPageView(),SDRINSERT_ADDMARK);
+}
+//------------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportController::getImplementationName() throw( RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------------
+::rtl::OUString OReportController::getImplementationName_Static() throw( RuntimeException )
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.comp.ReportDesign"));
+}
+//------------------------------------------------------------------------------
+Sequence< ::rtl::OUString> OReportController::getSupportedServiceNames_Static(void) throw( RuntimeException )
+{
+ Sequence< ::rtl::OUString> aSupported(1);
+ aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ReportDesign"));
+ return aSupported;
+}
+//-------------------------------------------------------------------------
+Sequence< ::rtl::OUString> SAL_CALL OReportController::getSupportedServiceNames() throw(RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+// -------------------------------------------------------------------------
+Reference< XInterface > OReportController::create(Reference< XComponentContext > const & xContext)
+{
+ return *(new OReportController(xContext));
+}
+DBG_NAME( rpt_OReportController )
+// -----------------------------------------------------------------------------
+OReportController::OReportController(Reference< XComponentContext > const & xContext)
+: OReportController_BASE(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY))
+,m_pMyOwnView(NULL)
+,m_pClipbordNotifier(NULL)
+,m_pGroupsFloater(NULL)
+,m_xContext(xContext)
+,m_nSplitPos(-1)
+,m_nPageNum(-1)
+//,m_nExecuteReportEvent(0)
+,m_bShowRuler(sal_True)
+,m_bGridVisible(sal_True)
+,m_bGridUse(sal_True)
+,m_bShowProperties(sal_True)
+,m_bGroupFloaterWasVisible(sal_False)
+,m_bHelplinesMove(sal_True)
+{
+ DBG_CTOR( rpt_OReportController,NULL);
+}
+// -----------------------------------------------------------------------------
+OReportController::~OReportController()
+{
+ DBG_DTOR( rpt_OReportController,NULL);
+}
+// -----------------------------------------------------------------------------
+IMPLEMENT_FORWARD_XTYPEPROVIDER2(OReportController,OReportController_BASE,OReportController_Listener)
+IMPLEMENT_FORWARD_XINTERFACE2(OReportController,OReportController_BASE,OReportController_Listener)
+// -----------------------------------------------------------------------------
+void OReportController::disposing()
+{
+ OReportController_BASE::disposing();
+
+ if ( getView() && m_pClipbordNotifier )
+ {
+ m_pClipbordNotifier->ClearCallbackLink();
+ m_pClipbordNotifier->AddRemoveListener( getView(), sal_False );
+ m_pClipbordNotifier->release();
+ m_pClipbordNotifier = NULL;
+ }
+ {
+ ::std::auto_ptr<FloatingWindow> aTemp(m_pGroupsFloater);
+ m_pGroupsFloater = NULL;
+ }
+
+ try
+ {
+ ::comphelper::disposeComponent( m_xRowSet );
+ ::comphelper::disposeComponent( m_xRowSetMediator );
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught while disposing row sets.");
+ }
+ m_xRowSet.clear();
+ m_xRowSetMediator.clear();
+
+ if ( m_xReportDefinition.is() )
+ {
+ try
+ {
+ getUndoMgr()->Clear(); // clear all undo redo things
+ listen(false);
+ }
+ catch(uno::Exception&)
+ {
+ }
+ }
+ disconnect();
+ try
+ {
+ m_xReportDefinition.clear();
+ m_aReportModel.reset();
+ m_xFrameLoader.clear();
+ m_xReportEngine.clear();
+ }
+ catch(uno::Exception&)
+ {
+ }
+ if ( m_pMyOwnView )
+ EndListening(*(m_pMyOwnView));
+ m_pView = NULL;
+ m_pMyOwnView = NULL;
+}
+// -----------------------------------------------------------------------------
+FeatureState OReportController::GetState(sal_uInt16 _nId) const
+{
+ FeatureState aReturn;
+ // (disabled automatically)
+ aReturn.bEnabled = sal_False;
+ // check this first
+ if ( !getView() )
+ return aReturn;
+
+ switch (_nId)
+ {
+ case SID_RPT_TEXTDOCUMENT:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = (m_xReportDefinition.is() && m_xReportDefinition->getMimeType() == MIMETYPE_OASIS_OPENDOCUMENT_TEXT);
+ break;
+ case SID_RPT_SPREADSHEET:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = (m_xReportDefinition.is() && m_xReportDefinition->getMimeType() == MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET);
+ break;
+ case SID_REPORTHEADER_WITHOUT_UNDO:
+ case SID_REPORTFOOTER_WITHOUT_UNDO:
+ case SID_REPORTHEADERFOOTER:
+ {
+ aReturn.bEnabled = isEditable();
+ ::rtl::OUString sText = String(ModuleRes((m_xReportDefinition.is() && m_xReportDefinition->getReportHeaderOn()) ? RID_STR_REPORTHEADERFOOTER_DELETE : RID_STR_REPORTHEADERFOOTER_INSERT));
+ aReturn.sTitle = sText;
+ }
+ break;
+ case SID_PAGEHEADER_WITHOUT_UNDO:
+ case SID_PAGEFOOTER_WITHOUT_UNDO:
+ case SID_PAGEHEADERFOOTER:
+ {
+ aReturn.bEnabled = isEditable();
+ ::rtl::OUString sText = String(ModuleRes((m_xReportDefinition.is() && m_xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT));
+ aReturn.sTitle = sText;
+ }
+ break;
+ case SID_GROUP_APPEND:
+ case SID_GROUP_REMOVE:
+ case SID_GROUPHEADER_WITHOUT_UNDO:
+ case SID_GROUPHEADER:
+ case SID_GROUPFOOTER_WITHOUT_UNDO:
+ case SID_GROUPFOOTER:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_ADD_CONTROL_PAIR:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->getMarkedSection().get() != NULL;
+ break;
+ case SID_REDO:
+ case SID_UNDO:
+ aReturn = OReportController_BASE::GetState(_nId);
+ aReturn.bEnabled = aReturn.bEnabled;
+ break;
+ case SID_OBJECT_RESIZING:
+ case SID_OBJECT_SMALLESTWIDTH:
+ case SID_OBJECT_SMALLESTHEIGHT:
+ case SID_OBJECT_GREATESTWIDTH:
+ case SID_OBJECT_GREATESTHEIGHT:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && m_pMyOwnView->isAlignPossible();
+ if ( aReturn.bEnabled )
+ aReturn.bEnabled = m_pMyOwnView->getMarkedObjectCount() > 1;
+ break;
+
+ case SID_DISTRIBUTION:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();
+ if ( aReturn.bEnabled )
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ aReturn.bEnabled = pSectionView && pSectionView->GetMarkedObjectCount() > 2;
+ }
+ break;
+ case SID_FRAME_DOWN:
+ case SID_FRAME_UP:
+ aReturn.bEnabled = sal_False;
+ break;
+ case SID_ARRANGEMENU:
+ case SID_FRAME_TO_TOP:
+ case SID_FRAME_TO_BOTTOM:
+ case SID_OBJECT_HEAVEN:
+ case SID_OBJECT_HELL:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();
+ if ( aReturn.bEnabled )
+ {
+ uno::Reference< report::XShape> xShape(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xShape.is();
+ if ( aReturn.bEnabled )
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ {
+ switch(_nId)
+ {
+ case SID_OBJECT_HEAVEN:
+ aReturn.bEnabled = pSectionView->IsToTopPossible();
+ break;
+ case SID_OBJECT_HELL:
+ aReturn.bEnabled = pSectionView->IsToBtmPossible();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ break;
+
+ case SID_OBJECT_ALIGN:
+ case SID_OBJECT_ALIGN_LEFT:
+ case SID_OBJECT_ALIGN_CENTER:
+ case SID_OBJECT_ALIGN_RIGHT:
+ case SID_OBJECT_ALIGN_UP:
+ case SID_OBJECT_ALIGN_MIDDLE:
+ case SID_OBJECT_ALIGN_DOWN:
+ case SID_SECTION_ALIGN:
+ case SID_SECTION_ALIGN_LEFT:
+ case SID_SECTION_ALIGN_CENTER:
+ case SID_SECTION_ALIGN_RIGHT:
+ case SID_SECTION_ALIGN_UP:
+ case SID_SECTION_ALIGN_MIDDLE:
+ case SID_SECTION_ALIGN_DOWN:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && m_pMyOwnView->isAlignPossible();
+ break;
+ case SID_CUT:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ break;
+ case SID_COPY:
+ aReturn.bEnabled = m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ break;
+ case SID_PASTE:
+ aReturn.bEnabled = isEditable() && !m_pMyOwnView->isHandleEvent(_nId) && m_pMyOwnView->IsPasteAllowed();
+ break;
+ case SID_SELECTALL:
+ aReturn.bEnabled = !m_pMyOwnView->isHandleEvent(_nId);
+ break;
+ case SID_SELECTALL_IN_SECTION:
+ aReturn.bEnabled = !m_pMyOwnView->isHandleEvent(_nId);
+ if ( aReturn.bEnabled )
+ aReturn.bEnabled = getCurrentSectionView() != NULL;
+ break;
+ case SID_ESCAPE:
+ aReturn.bEnabled = m_pMyOwnView->GetMode() == RPTUI_INSERT;
+ break;
+ case SID_RPT_NEW_FUNCTION:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_NEXT_MARK:
+ case SID_PREV_MARK:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_SELECT:
+ case SID_SELECT_REPORT:
+ aReturn.bEnabled = sal_True;
+ break;
+ case SID_EXECUTE_REPORT:
+ aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
+ && m_xReportDefinition->getCommand().getLength();
+ break;
+ case SID_DELETE:
+ aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId);
+ {
+ ::rtl::OUString sText = String(ModuleRes(RID_STR_DELETE));
+ aReturn.sTitle = sText;
+ }
+ break;
+ case SID_GRID_VISIBLE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_bGridVisible;
+ break;
+ case SID_GRID_USE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_bGridUse;
+ break;
+ case SID_HELPLINES_MOVE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_bHelplinesMove;
+ break;
+ case SID_RULER:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_bShowRuler;
+ break;
+ case SID_OBJECT_SELECT:
+ aReturn.bEnabled = sal_True;
+ aReturn.bChecked = m_pMyOwnView->GetMode() == RPTUI_SELECT;
+ break;
+ case SID_FM_FIXEDTEXT:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_FIXEDTEXT;
+ break;
+ case SID_INSERT_HFIXEDLINE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_HFIXEDLINE;
+ break;
+ case SID_INSERT_VFIXEDLINE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_VFIXEDLINE;
+ break;
+ case SID_FM_EDIT:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD;
+ break;
+ case SID_FM_IMAGECONTROL:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_DLG_IMAGECONTROL;
+ break;
+ case SID_DRAWTBX_CS_BASIC:
+ case SID_DRAWTBX_CS_BASIC1:
+ case SID_DRAWTBX_CS_BASIC2:
+ case SID_DRAWTBX_CS_BASIC3:
+ case SID_DRAWTBX_CS_BASIC4:
+ case SID_DRAWTBX_CS_BASIC5:
+ case SID_DRAWTBX_CS_BASIC6:
+ case SID_DRAWTBX_CS_BASIC7:
+ case SID_DRAWTBX_CS_BASIC8:
+ case SID_DRAWTBX_CS_BASIC9:
+ case SID_DRAWTBX_CS_BASIC10:
+ case SID_DRAWTBX_CS_BASIC11:
+ case SID_DRAWTBX_CS_BASIC12:
+ case SID_DRAWTBX_CS_BASIC13:
+ case SID_DRAWTBX_CS_BASIC14:
+ case SID_DRAWTBX_CS_BASIC15:
+ case SID_DRAWTBX_CS_BASIC16:
+ case SID_DRAWTBX_CS_BASIC17:
+ case SID_DRAWTBX_CS_BASIC18:
+ case SID_DRAWTBX_CS_BASIC19:
+ case SID_DRAWTBX_CS_BASIC20:
+ case SID_DRAWTBX_CS_BASIC21:
+ case SID_DRAWTBX_CS_BASIC22:
+ case SID_DRAWTBX_CS_SYMBOL:
+ case SID_DRAWTBX_CS_ARROW:
+ case SID_DRAWTBX_CS_FLOWCHART:
+ case SID_DRAWTBX_CS_CALLOUT:
+ case SID_DRAWTBX_CS_STAR:
+ case SID_DRAWTBX_CS_SYMBOL1:
+ case SID_DRAWTBX_CS_SYMBOL2:
+ case SID_DRAWTBX_CS_SYMBOL3:
+ case SID_DRAWTBX_CS_SYMBOL4:
+ case SID_DRAWTBX_CS_SYMBOL5:
+ case SID_DRAWTBX_CS_SYMBOL6:
+ case SID_DRAWTBX_CS_SYMBOL7:
+ case SID_DRAWTBX_CS_SYMBOL8:
+ case SID_DRAWTBX_CS_SYMBOL9:
+ case SID_DRAWTBX_CS_SYMBOL10:
+ case SID_DRAWTBX_CS_SYMBOL11:
+ case SID_DRAWTBX_CS_SYMBOL12:
+ case SID_DRAWTBX_CS_SYMBOL13:
+ case SID_DRAWTBX_CS_SYMBOL14:
+ case SID_DRAWTBX_CS_SYMBOL15:
+ case SID_DRAWTBX_CS_SYMBOL16:
+ case SID_DRAWTBX_CS_SYMBOL17:
+ case SID_DRAWTBX_CS_SYMBOL18:
+ case SID_DRAWTBX_CS_ARROW1:
+ case SID_DRAWTBX_CS_ARROW2:
+ case SID_DRAWTBX_CS_ARROW3:
+ case SID_DRAWTBX_CS_ARROW4:
+ case SID_DRAWTBX_CS_ARROW5:
+ case SID_DRAWTBX_CS_ARROW6:
+ case SID_DRAWTBX_CS_ARROW7:
+ case SID_DRAWTBX_CS_ARROW8:
+ case SID_DRAWTBX_CS_ARROW9:
+ case SID_DRAWTBX_CS_ARROW10:
+ case SID_DRAWTBX_CS_ARROW11:
+ case SID_DRAWTBX_CS_ARROW12:
+ case SID_DRAWTBX_CS_ARROW13:
+ case SID_DRAWTBX_CS_ARROW14:
+ case SID_DRAWTBX_CS_ARROW15:
+ case SID_DRAWTBX_CS_ARROW16:
+ case SID_DRAWTBX_CS_ARROW17:
+ case SID_DRAWTBX_CS_ARROW18:
+ case SID_DRAWTBX_CS_ARROW19:
+ case SID_DRAWTBX_CS_ARROW20:
+ case SID_DRAWTBX_CS_ARROW21:
+ case SID_DRAWTBX_CS_ARROW22:
+ case SID_DRAWTBX_CS_ARROW23:
+ case SID_DRAWTBX_CS_ARROW24:
+ case SID_DRAWTBX_CS_ARROW25:
+ case SID_DRAWTBX_CS_ARROW26:
+ case SID_DRAWTBX_CS_STAR1:
+ case SID_DRAWTBX_CS_STAR2:
+ case SID_DRAWTBX_CS_STAR3:
+ case SID_DRAWTBX_CS_STAR4:
+ case SID_DRAWTBX_CS_STAR5:
+ case SID_DRAWTBX_CS_STAR6:
+ case SID_DRAWTBX_CS_STAR7:
+ case SID_DRAWTBX_CS_STAR8:
+ case SID_DRAWTBX_CS_STAR9:
+ case SID_DRAWTBX_CS_STAR10:
+ case SID_DRAWTBX_CS_STAR11:
+ case SID_DRAWTBX_CS_STAR12:
+ case SID_DRAWTBX_CS_FLOWCHART1:
+ case SID_DRAWTBX_CS_FLOWCHART2:
+ case SID_DRAWTBX_CS_FLOWCHART3:
+ case SID_DRAWTBX_CS_FLOWCHART4:
+ case SID_DRAWTBX_CS_FLOWCHART5:
+ case SID_DRAWTBX_CS_FLOWCHART6:
+ case SID_DRAWTBX_CS_FLOWCHART7:
+ case SID_DRAWTBX_CS_FLOWCHART8:
+ case SID_DRAWTBX_CS_FLOWCHART9:
+ case SID_DRAWTBX_CS_FLOWCHART10:
+ case SID_DRAWTBX_CS_FLOWCHART11:
+ case SID_DRAWTBX_CS_FLOWCHART12:
+ case SID_DRAWTBX_CS_FLOWCHART13:
+ case SID_DRAWTBX_CS_FLOWCHART14:
+ case SID_DRAWTBX_CS_FLOWCHART15:
+ case SID_DRAWTBX_CS_FLOWCHART16:
+ case SID_DRAWTBX_CS_FLOWCHART17:
+ case SID_DRAWTBX_CS_FLOWCHART18:
+ case SID_DRAWTBX_CS_FLOWCHART19:
+ case SID_DRAWTBX_CS_FLOWCHART20:
+ case SID_DRAWTBX_CS_FLOWCHART21:
+ case SID_DRAWTBX_CS_FLOWCHART22:
+ case SID_DRAWTBX_CS_FLOWCHART23:
+ case SID_DRAWTBX_CS_FLOWCHART24:
+ case SID_DRAWTBX_CS_FLOWCHART25:
+ case SID_DRAWTBX_CS_FLOWCHART26:
+ case SID_DRAWTBX_CS_FLOWCHART27:
+ case SID_DRAWTBX_CS_FLOWCHART28:
+ case SID_DRAWTBX_CS_CALLOUT1:
+ case SID_DRAWTBX_CS_CALLOUT2:
+ case SID_DRAWTBX_CS_CALLOUT3:
+ case SID_DRAWTBX_CS_CALLOUT4:
+ case SID_DRAWTBX_CS_CALLOUT5:
+ case SID_DRAWTBX_CS_CALLOUT6:
+ case SID_DRAWTBX_CS_CALLOUT7:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE;
+ break;
+ case SID_RPT_SHOWREPORTEXPLORER:
+ aReturn.bEnabled = m_xReportDefinition.is();
+ aReturn.bChecked = m_pMyOwnView && m_pMyOwnView->isReportExplorerVisible();
+ break;
+ case SID_FM_ADD_FIELD:
+ aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
+ && m_xReportDefinition->getCommand().getLength();
+ aReturn.bChecked = m_pMyOwnView && m_pMyOwnView->isAddFieldVisible();
+ break;
+ case SID_SHOW_PROPERTYBROWSER:
+ aReturn.bEnabled = sal_True;
+ aReturn.bChecked = m_bShowProperties;
+ break;
+ case SID_PROPERTYBROWSER_LAST_PAGE:
+ aReturn.bEnabled = sal_True;
+ aReturn.aValue <<= m_sLastActivePage;
+ break;
+ case SID_SPLIT_POSITION:
+ aReturn.bEnabled = sal_True;
+ aReturn.aValue <<= getSplitPos();
+ break;
+ case SID_SAVEDOC:
+ aReturn.bEnabled = isModified() && isEditable();
+ break;
+ case SID_SAVEASDOC:
+ aReturn.bEnabled = isConnected() && isEditable();
+ break;
+ case SID_EDITDOC:
+ aReturn.bChecked = isEditable();
+ break;
+ case SID_PAGEDIALOG:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_BACKGROUND_COLOR:
+ aReturn.bEnabled = isEditable();
+ {
+ uno::Reference< report::XReportComponent > xReportComponent(m_pMyOwnView->getCurrentControlModel());
+ uno::Reference< report::XReportControlFormat> xReportControlFormat(xReportComponent,uno::UNO_QUERY);
+ if ( xReportControlFormat.is() )
+ {
+ aReturn.bEnabled = xReportComponent->getPropertySetInfo()->hasPropertyByName(PROPERTY_CONTROLBACKGROUND);
+ if ( aReturn.bEnabled )
+ aReturn.aValue <<= xReportControlFormat->getControlBackground();
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_COLOR_BACKGROUND:
+ aReturn.bEnabled = isEditable();
+ {
+ uno::Reference<report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ if ( xSection.is() )
+ try
+ {
+ aReturn.aValue <<= xSection->getBackColor();
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = !xControlModel.is();
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ }
+ else
+ aReturn.bEnabled = sal_False;
+ }
+ break;
+ case SID_SORTINGANDGROUPING:
+ aReturn.bEnabled = sal_True;
+ aReturn.bChecked = m_pGroupsFloater && m_pGroupsFloater->IsVisible();
+ break;
+ case SID_ATTR_CHAR_WEIGHT:
+ case SID_ATTR_CHAR_POSTURE:
+ case SID_ATTR_CHAR_UNDERLINE:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentControlModel().is();
+ aReturn.bChecked = isFormatCommandEnabled(_nId,uno::Reference< report::XReportControlFormat>(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY));
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ case SID_ATTR_CHAR_COLOR2:
+ {
+ uno::Reference< report::XReportControlFormat> xReportControlFormat(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = isEditable() && xReportControlFormat.is();
+ if ( aReturn.bEnabled )
+ {
+ try
+ {
+ aReturn.aValue <<= xReportControlFormat->getCharColor();
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ aReturn.bEnabled = sal_False;
+ }
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_FONT:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable();
+ if ( aReturn.bEnabled )
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xControlModel.is();
+ if ( aReturn.bEnabled )
+ {
+ try
+ {
+ aReturn.aValue <<= xControlModel->getFontDescriptor();
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ aReturn.bEnabled = sal_False;
+ }
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable();
+ if ( aReturn.bEnabled )
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xControlModel.is();
+ if ( aReturn.bEnabled )
+ {
+ try
+ {
+ frame::status::FontHeight aFontHeight;
+ aFontHeight.Height = xControlModel->getCharHeight();
+ aReturn.aValue <<= aFontHeight;
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ aReturn.bEnabled = sal_False;
+ }
+ }
+ }
+ break;
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable();
+ if ( aReturn.bEnabled )
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xControlModel.is();
+ if ( aReturn.bEnabled )
+ {
+ ::sal_Int16 nParaAdjust = xControlModel->getParaAdjust();
+ switch(nParaAdjust)
+ {
+ case awt::TextAlign::LEFT:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_LEFT;
+ break;
+ case awt::TextAlign::CENTER:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_CENTER;
+ break;
+ case awt::TextAlign::RIGHT:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_RIGHT;
+ break;
+ }
+ }
+ }
+ break;
+
+ case SID_INSERT_GRAPHIC:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentSection().is();
+ break;
+ case SID_CHAR_DLG:
+ case SID_SETCONTROLDEFAULTS:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentControlModel().is();
+ break;
+ case SID_CONDITIONALFORMATTING:
+ {
+ uno::Reference< report::XFormattedField> xFormattedField(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xFormattedField.is();
+ }
+ break;
+ case SID_INSERT_FLD_PGNUMBER:
+ case SID_DATETIME:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && m_pMyOwnView->getCurrentSection().is();
+ break;
+ case SID_INSERT_DIAGRAM:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_EXPORTDOC:
+ case SID_EXPORTDOCASPDF:
+ aReturn.bEnabled = m_xReportDefinition.is();
+ break;
+ case SID_PRINTPREVIEW:
+ aReturn.bEnabled = sal_False;
+ break;
+ default:
+ aReturn = OReportController_BASE::GetState(_nId);
+ }
+ return aReturn;
+}
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ /** extracts a background color from a dispatched SID_BACKGROUND_COLOR call
+
+ The dispatch might originate from either the toolbar, or the conditional
+ formatting dialog. In both cases, argument formats are different.
+ */
+ util::Color lcl_extractBackgroundColor( const Sequence< PropertyValue >& _rDispatchArgs )
+ {
+ util::Color aColor( COL_TRANSPARENT );
+ if ( _rDispatchArgs.getLength() == 1 )
+ {
+ OSL_VERIFY( _rDispatchArgs[0].Value >>= aColor );
+ }
+ else
+ {
+ SequenceAsHashMap aMap( _rDispatchArgs );
+ aColor = aMap.getUnpackedValueOrDefault( PROPERTY_FONTCOLOR, aColor );
+ }
+ return aColor;
+ }
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& aArgs)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( !getView() )
+ {
+ switch(_nId)
+ {
+ case SID_RULER:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_bShowRuler;
+ break;
+ case SID_HELPLINES_MOVE:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_bHelplinesMove;
+ break;
+ case SID_GRID_VISIBLE:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_bGridVisible;
+ break;
+ case SID_SHOW_PROPERTYBROWSER:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_bShowProperties;
+ break;
+ case SID_PROPERTYBROWSER_LAST_PAGE:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_sLastActivePage;
+ break;
+ case SID_SPLIT_POSITION:
+ OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!");
+ aArgs[0].Value >>= m_nSplitPos;
+ break;
+ }
+ return; // return without execution
+ }
+ sal_Bool bForceBroadcast = sal_False;
+ switch(_nId)
+ {
+ case SID_RPT_TEXTDOCUMENT:
+ if ( m_xReportDefinition.is() )
+ m_xReportDefinition->setMimeType( MIMETYPE_OASIS_OPENDOCUMENT_TEXT );
+ break;
+ case SID_RPT_SPREADSHEET:
+ if (m_xReportDefinition.is() )
+ m_xReportDefinition->setMimeType( MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET );
+ break;
+ case SID_REPORTHEADER_WITHOUT_UNDO:
+ case SID_REPORTFOOTER_WITHOUT_UNDO:
+ case SID_REPORTHEADERFOOTER:
+ switchReportSection(_nId);
+ break;
+ case SID_PAGEHEADER_WITHOUT_UNDO:
+ case SID_PAGEFOOTER_WITHOUT_UNDO:
+ case SID_PAGEHEADERFOOTER:
+ switchPageSection(_nId);
+ break;
+ case SID_GROUP_APPEND:
+ case SID_GROUP_REMOVE:
+ modifyGroup(_nId == SID_GROUP_APPEND,aArgs);
+ break;
+ case SID_GROUPHEADER_WITHOUT_UNDO:
+ case SID_GROUPHEADER:
+ createGroupSection(SID_GROUPHEADER == _nId,true,aArgs);
+ break;
+ case SID_GROUPFOOTER_WITHOUT_UNDO:
+ case SID_GROUPFOOTER:
+ createGroupSection(SID_GROUPFOOTER == _nId,false,aArgs);
+ break;
+ case SID_ADD_CONTROL_PAIR:
+ addPairControls(aArgs);
+ break;
+ case SID_REDO:
+ OReportController_BASE::Execute(_nId,aArgs);
+ InvalidateFeature( SID_UNDO );
+ updateFloater();
+ break;
+ case SID_UNDO:
+ OReportController_BASE::Execute(_nId,aArgs);
+ InvalidateFeature( SID_REDO );
+ updateFloater();
+ break;
+ case SID_CUT:
+ executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fun(&ODesignView::Cut));
+ break;
+ case SID_COPY:
+ m_pMyOwnView->Copy();
+ break;
+ case SID_PASTE:
+ executeMethodWithUndo(RID_STR_UNDO_PASTE,::std::mem_fun(&ODesignView::Paste));
+ break;
+
+ case SID_FRAME_TO_TOP:
+ case SID_FRAME_DOWN:
+ case SID_FRAME_UP:
+ case SID_FRAME_TO_BOTTOM:
+ case SID_OBJECT_HEAVEN:
+ case SID_OBJECT_HELL:
+ changeZOrder(_nId);
+ break;
+ case SID_DISTRIBUTION:
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ pSectionView->DistributeMarkedObjects();
+ }
+ break;
+ case SID_OBJECT_SMALLESTWIDTH:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::WIDTH_SMALLEST);
+ break;
+ case SID_OBJECT_SMALLESTHEIGHT:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::HEIGHT_SMALLEST);
+ break;
+ case SID_OBJECT_GREATESTWIDTH:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::WIDTH_GREATEST);
+ break;
+ case SID_OBJECT_GREATESTHEIGHT:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::HEIGHT_GREATEST);
+ break;
+ case SID_SECTION_ALIGN_LEFT:
+ case SID_OBJECT_ALIGN_LEFT:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::LEFT,SID_SECTION_ALIGN_LEFT == _nId);
+ break;
+ case SID_SECTION_ALIGN_CENTER:
+ case SID_OBJECT_ALIGN_CENTER:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::CENTER_HORIZONTAL,SID_SECTION_ALIGN_CENTER == _nId);
+ break;
+ case SID_SECTION_ALIGN_RIGHT:
+ case SID_OBJECT_ALIGN_RIGHT:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::RIGHT,SID_SECTION_ALIGN_RIGHT == _nId);
+ break;
+ case SID_SECTION_ALIGN_UP:
+ case SID_OBJECT_ALIGN_UP:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::TOP,SID_SECTION_ALIGN_UP == _nId);
+ break;
+ case SID_SECTION_ALIGN_MIDDLE:
+ case SID_OBJECT_ALIGN_MIDDLE:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::CENTER_VERTICAL,SID_SECTION_ALIGN_MIDDLE == _nId);
+ break;
+ case SID_SECTION_ALIGN_DOWN:
+ case SID_OBJECT_ALIGN_DOWN:
+ alignControlsWithUndo(RID_STR_UNDO_ALIGNMENT,ControlModification::BOTTOM,SID_SECTION_ALIGN_DOWN == _nId);
+ break;
+ case SID_SELECTALL:
+ m_pMyOwnView->SelectAll();
+ break;
+ case SID_SELECTALL_IN_SECTION:
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ pSectionView->MarkAll();
+ }
+ break;
+ case SID_ESCAPE:
+ m_pMyOwnView->SetMode(RPTUI_SELECT);
+ InvalidateFeature( SID_OBJECT_SELECT );
+ break;
+ case SID_SELECT:
+ if ( aArgs.getLength() == 1 )
+ select(aArgs[0].Value);
+ break;
+ case SID_SELECT_REPORT:
+ select(uno::makeAny(m_xReportDefinition));
+ break;
+ case SID_EXECUTE_REPORT:
+ /*m_nExecuteReportEvent = */getView()->PostUserEvent(LINK(this, OReportController,OnExecuteReport));
+ break;
+ case SID_RPT_NEW_FUNCTION:
+ createNewFunction(aArgs[0].Value);
+ break;
+ case SID_NEXT_MARK:
+ markSection(true);
+ break;
+ case SID_PREV_MARK:
+ markSection(false);
+ break;
+ case SID_DELETE:
+ if ( aArgs.getLength() == 1 )
+ {
+ uno::Reference< report::XFunction> xFunction;
+ aArgs[0].Value >>= xFunction;
+ if ( xFunction.is() )
+ {
+ uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW);
+ sal_Int32 nIndex = getPositionInIndexAccess(xFunctions.get(),xFunction);
+ String sComment = String((ModuleRes(RID_STR_UNDO_REMOVE_FUNCTION)));
+ m_aUndoManager.EnterListAction(sComment,String());
+ xFunctions->removeByIndex(nIndex);
+ m_aUndoManager.LeaveListAction();
+ select(uno::makeAny(xFunctions->getParent()));
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+ }
+ }
+ else
+ executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fun(&ODesignView::Delete));
+ break;
+ case SID_GRID_USE:
+ m_pMyOwnView->setGridSnap(m_bGridUse = !m_bGridUse);
+ break;
+ case SID_HELPLINES_MOVE:
+ m_pMyOwnView->setDragStripes(m_bHelplinesMove = !m_bHelplinesMove);
+ break;
+ case SID_GRID_VISIBLE:
+ m_pMyOwnView->toggleGrid(m_bGridVisible = !m_bGridVisible);
+ break;
+ case SID_RULER:
+ m_pMyOwnView->showRuler(m_bShowRuler = !m_bShowRuler);
+ break;
+ case SID_OBJECT_SELECT:
+ m_pMyOwnView->SetMode(RPTUI_SELECT);
+ InvalidateAll();
+ break;
+ case SID_FM_FIXEDTEXT:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ m_pMyOwnView->SetInsertObj( OBJ_DLG_FIXEDTEXT );
+ InvalidateAll();
+ break;
+ case SID_INSERT_HFIXEDLINE:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ m_pMyOwnView->SetInsertObj( OBJ_DLG_HFIXEDLINE );
+ InvalidateAll();
+ break;
+ case SID_INSERT_VFIXEDLINE:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ m_pMyOwnView->SetInsertObj( OBJ_DLG_VFIXEDLINE );
+ InvalidateAll();
+ break;
+ case SID_FM_EDIT:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ m_pMyOwnView->SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
+ InvalidateAll();
+ break;
+ case SID_FM_IMAGECONTROL:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ m_pMyOwnView->SetInsertObj( OBJ_DLG_IMAGECONTROL );
+ InvalidateAll();
+ break;
+ case SID_DRAWTBX_CS_BASIC:
+ case SID_DRAWTBX_CS_BASIC1:
+ case SID_DRAWTBX_CS_BASIC2:
+ case SID_DRAWTBX_CS_BASIC3:
+ case SID_DRAWTBX_CS_BASIC4:
+ case SID_DRAWTBX_CS_BASIC5:
+ case SID_DRAWTBX_CS_BASIC6:
+ case SID_DRAWTBX_CS_BASIC7:
+ case SID_DRAWTBX_CS_BASIC8:
+ case SID_DRAWTBX_CS_BASIC9:
+ case SID_DRAWTBX_CS_BASIC10:
+ case SID_DRAWTBX_CS_BASIC11:
+ case SID_DRAWTBX_CS_BASIC12:
+ case SID_DRAWTBX_CS_BASIC13:
+ case SID_DRAWTBX_CS_BASIC14:
+ case SID_DRAWTBX_CS_BASIC15:
+ case SID_DRAWTBX_CS_BASIC16:
+ case SID_DRAWTBX_CS_BASIC17:
+ case SID_DRAWTBX_CS_BASIC18:
+ case SID_DRAWTBX_CS_BASIC19:
+ case SID_DRAWTBX_CS_BASIC20:
+ case SID_DRAWTBX_CS_BASIC21:
+ case SID_DRAWTBX_CS_BASIC22:
+ case SID_DRAWTBX_CS_SYMBOL1:
+ case SID_DRAWTBX_CS_SYMBOL2:
+ case SID_DRAWTBX_CS_SYMBOL3:
+ case SID_DRAWTBX_CS_SYMBOL4:
+ case SID_DRAWTBX_CS_SYMBOL5:
+ case SID_DRAWTBX_CS_SYMBOL6:
+ case SID_DRAWTBX_CS_SYMBOL7:
+ case SID_DRAWTBX_CS_SYMBOL8:
+ case SID_DRAWTBX_CS_SYMBOL9:
+ case SID_DRAWTBX_CS_SYMBOL10:
+ case SID_DRAWTBX_CS_SYMBOL11:
+ case SID_DRAWTBX_CS_SYMBOL12:
+ case SID_DRAWTBX_CS_SYMBOL13:
+ case SID_DRAWTBX_CS_SYMBOL14:
+ case SID_DRAWTBX_CS_SYMBOL15:
+ case SID_DRAWTBX_CS_SYMBOL16:
+ case SID_DRAWTBX_CS_SYMBOL17:
+ case SID_DRAWTBX_CS_SYMBOL18:
+ case SID_DRAWTBX_CS_ARROW1:
+ case SID_DRAWTBX_CS_ARROW2:
+ case SID_DRAWTBX_CS_ARROW3:
+ case SID_DRAWTBX_CS_ARROW4:
+ case SID_DRAWTBX_CS_ARROW5:
+ case SID_DRAWTBX_CS_ARROW6:
+ case SID_DRAWTBX_CS_ARROW7:
+ case SID_DRAWTBX_CS_ARROW8:
+ case SID_DRAWTBX_CS_ARROW9:
+ case SID_DRAWTBX_CS_ARROW10:
+ case SID_DRAWTBX_CS_ARROW11:
+ case SID_DRAWTBX_CS_ARROW12:
+ case SID_DRAWTBX_CS_ARROW13:
+ case SID_DRAWTBX_CS_ARROW14:
+ case SID_DRAWTBX_CS_ARROW15:
+ case SID_DRAWTBX_CS_ARROW16:
+ case SID_DRAWTBX_CS_ARROW17:
+ case SID_DRAWTBX_CS_ARROW18:
+ case SID_DRAWTBX_CS_ARROW19:
+ case SID_DRAWTBX_CS_ARROW20:
+ case SID_DRAWTBX_CS_ARROW21:
+ case SID_DRAWTBX_CS_ARROW22:
+ case SID_DRAWTBX_CS_ARROW23:
+ case SID_DRAWTBX_CS_ARROW24:
+ case SID_DRAWTBX_CS_ARROW25:
+ case SID_DRAWTBX_CS_ARROW26:
+ case SID_DRAWTBX_CS_STAR1:
+ case SID_DRAWTBX_CS_STAR2:
+ case SID_DRAWTBX_CS_STAR3:
+ case SID_DRAWTBX_CS_STAR4:
+ case SID_DRAWTBX_CS_STAR5:
+ case SID_DRAWTBX_CS_STAR6:
+ case SID_DRAWTBX_CS_STAR7:
+ case SID_DRAWTBX_CS_STAR8:
+ case SID_DRAWTBX_CS_STAR9:
+ case SID_DRAWTBX_CS_STAR10:
+ case SID_DRAWTBX_CS_STAR11:
+ case SID_DRAWTBX_CS_STAR12:
+ case SID_DRAWTBX_CS_FLOWCHART1:
+ case SID_DRAWTBX_CS_FLOWCHART2:
+ case SID_DRAWTBX_CS_FLOWCHART3:
+ case SID_DRAWTBX_CS_FLOWCHART4:
+ case SID_DRAWTBX_CS_FLOWCHART5:
+ case SID_DRAWTBX_CS_FLOWCHART6:
+ case SID_DRAWTBX_CS_FLOWCHART7:
+ case SID_DRAWTBX_CS_FLOWCHART8:
+ case SID_DRAWTBX_CS_FLOWCHART9:
+ case SID_DRAWTBX_CS_FLOWCHART10:
+ case SID_DRAWTBX_CS_FLOWCHART11:
+ case SID_DRAWTBX_CS_FLOWCHART12:
+ case SID_DRAWTBX_CS_FLOWCHART13:
+ case SID_DRAWTBX_CS_FLOWCHART14:
+ case SID_DRAWTBX_CS_FLOWCHART15:
+ case SID_DRAWTBX_CS_FLOWCHART16:
+ case SID_DRAWTBX_CS_FLOWCHART17:
+ case SID_DRAWTBX_CS_FLOWCHART18:
+ case SID_DRAWTBX_CS_FLOWCHART19:
+ case SID_DRAWTBX_CS_FLOWCHART20:
+ case SID_DRAWTBX_CS_FLOWCHART21:
+ case SID_DRAWTBX_CS_FLOWCHART22:
+ case SID_DRAWTBX_CS_FLOWCHART23:
+ case SID_DRAWTBX_CS_FLOWCHART24:
+ case SID_DRAWTBX_CS_FLOWCHART25:
+ case SID_DRAWTBX_CS_FLOWCHART26:
+ case SID_DRAWTBX_CS_FLOWCHART27:
+ case SID_DRAWTBX_CS_FLOWCHART28:
+ case SID_DRAWTBX_CS_CALLOUT1:
+ case SID_DRAWTBX_CS_CALLOUT2:
+ case SID_DRAWTBX_CS_CALLOUT3:
+ case SID_DRAWTBX_CS_CALLOUT4:
+ case SID_DRAWTBX_CS_CALLOUT5:
+ case SID_DRAWTBX_CS_CALLOUT6:
+ case SID_DRAWTBX_CS_CALLOUT7:
+ case SID_DRAWTBX_CS_SYMBOL:
+ case SID_DRAWTBX_CS_ARROW:
+ case SID_DRAWTBX_CS_FLOWCHART:
+ case SID_DRAWTBX_CS_CALLOUT:
+ case SID_DRAWTBX_CS_STAR:
+ m_pMyOwnView->SetMode( RPTUI_INSERT );
+ {
+ URL aUrl = getURLForId(_nId);
+ sal_Int32 nIndex = 1;
+ ::rtl::OUString sType = aUrl.Complete.getToken(0,'.',nIndex);
+ if ( nIndex == -1 || !sType.getLength() )
+ {
+ switch(_nId)
+ {
+ case SID_DRAWTBX_CS_SYMBOL:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("smiley"));
+ break;
+ case SID_DRAWTBX_CS_ARROW:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("left-right-arrow"));
+ break;
+ case SID_DRAWTBX_CS_FLOWCHART:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("flowchart-internal-storage"));
+ break;
+ case SID_DRAWTBX_CS_CALLOUT:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("round-rectangular-callout"));
+ break;
+ case SID_DRAWTBX_CS_STAR:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("star5"));
+ break;
+ case SID_DRAWTBX_CS_BASIC:
+ default:
+ sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond"));
+ }
+ }
+ else
+ sType = aUrl.Complete.getToken(0,'.',nIndex);
+
+ m_pMyOwnView->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
+ }
+ InvalidateAll();
+ break;
+ case SID_RPT_SHOWREPORTEXPLORER:
+ m_pMyOwnView->toggleReportExplorer();
+ break;
+ case SID_FM_ADD_FIELD:
+ m_pMyOwnView->toggleAddField();
+ break;
+ case SID_SHOW_PROPERTYBROWSER:
+ if ( m_bShowProperties )
+ m_sLastActivePage = m_pMyOwnView->getCurrentPage();
+ else
+ m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+
+ m_bShowProperties = !m_bShowProperties;
+ if ( aArgs.getLength() == 1 )
+ aArgs[0].Value >>= m_bShowProperties;
+
+ m_pMyOwnView->togglePropertyBrowser(m_bShowProperties);
+ break;
+ case SID_PROPERTYBROWSER_LAST_PAGE: // nothing to do
+ m_sLastActivePage = m_pMyOwnView->getCurrentPage();
+ break;
+ case SID_SPLIT_POSITION:
+ m_pMyOwnView->Resize();
+ break;
+ case SID_PAGEDIALOG:
+ case SID_ATTR_CHAR_COLOR_BACKGROUND:
+ {
+ uno::Reference<report::XSection> xSection;
+ if (aArgs.getLength() == 1 )
+ aArgs[0].Value >>= xSection;
+ openPageDialog(xSection);
+ bForceBroadcast = sal_True;
+ }
+ break;
+ case SID_SORTINGANDGROUPING:
+ openSortingAndGroupingDialog();
+ m_bGroupFloaterWasVisible = m_pGroupsFloater && m_pGroupsFloater->IsVisible();
+ break;
+ case SID_BACKGROUND_COLOR:
+ {
+ uno::Reference< awt::XWindow> xWindow;
+ uno::Reference< report::XReportControlFormat> xReportControlFormat = lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow);
+ uno::Reference< report::XSection > xSection = m_pMyOwnView->getCurrentSection();
+ try
+ {
+ if ( xReportControlFormat.is() )
+ {
+ util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
+ xReportControlFormat->setControlBackground( aColor );
+ }
+ else if ( xSection.is() )
+ {
+ util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
+ xSection->setBackColor( aColor );
+ }
+ else
+ OSL_ENSURE( false, "OReportController::Execute: no object to apply this background color to!" );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ bForceBroadcast = sal_True;
+ }
+ break;
+ case SID_ATTR_CHAR_WEIGHT:
+ case SID_ATTR_CHAR_POSTURE:
+ case SID_ATTR_CHAR_UNDERLINE:
+ {
+ uno::Reference< awt::XWindow> xWindow;
+ uno::Reference< report::XReportControlFormat> xReportControlFormat = lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow);
+ if ( xReportControlFormat.is() )
+ {
+ try
+ {
+ awt::FontDescriptor aFontDescriptor = xReportControlFormat->getFontDescriptor();
+ switch(_nId)
+ {
+ case SID_ATTR_CHAR_WEIGHT:
+ aFontDescriptor.Weight = (awt::FontWeight::NORMAL + awt::FontWeight::BOLD) - aFontDescriptor.Weight;
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ aFontDescriptor.Slant = static_cast<awt::FontSlant>(static_cast<sal_Int16>(awt::FontSlant_ITALIC) - static_cast<sal_Int16>(aFontDescriptor.Slant));
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ aFontDescriptor.Underline = awt::FontUnderline::SINGLE - aFontDescriptor.Underline;
+ break;
+ default:
+ OSL_ENSURE(0,"Illegal value in default!");
+ break;
+ }
+
+ xReportControlFormat->setFontDescriptor(aFontDescriptor);
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ }
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ case SID_ATTR_CHAR_COLOR2:
+ {
+ uno::Reference< awt::XWindow> xWindow;
+ uno::Reference< report::XReportControlFormat> xReportControlFormat = lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow);
+ if ( xReportControlFormat.is() )
+ {
+ SequenceAsHashMap aMap(aArgs);
+ util::Color aColor = aMap.getUnpackedValueOrDefault(PROPERTY_FONTCOLOR,util::Color());
+ try
+ {
+ xReportControlFormat->setCharColor(aColor);
+ bForceBroadcast = sal_True;
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ }
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_FONT:
+ if ( aArgs.getLength() == 1 )
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ awt::FontDescriptor aFont;
+ if ( xControlModel.is() && ( aArgs[0].Value >>= aFont ) )
+ xControlModel->setCharFontName(aFont.Name);
+ //xControlModel->setFontDescriptor(aFont);
+ }
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ if ( aArgs.getLength() == 1 )
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ float fSelVal = 0.0;
+ if ( xControlModel.is() && ( aArgs[0].Value >>= fSelVal) )
+ {
+ xControlModel->setCharHeight(fSelVal);
+ }
+ }
+ break;
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ {
+ uno::Reference< report::XReportControlModel> xControlModel(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ if ( xControlModel.is() )
+ {
+ switch(_nId)
+ {
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ xControlModel->setParaAdjust(awt::TextAlign::LEFT);
+ break;
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ xControlModel->setParaAdjust(awt::TextAlign::CENTER);
+ break;
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ xControlModel->setParaAdjust(awt::TextAlign::RIGHT);
+ break;
+ }
+ }
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT);
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_CENTER);
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_RIGHT);
+ }
+ break;
+ case SID_CHAR_DLG:
+ {
+ uno::Reference< awt::XWindow> xWindow;
+ uno::Reference< report::XReportControlFormat> xReportControlFormat = lcl_getReportControlFormat(aArgs,m_pMyOwnView,xWindow);
+ if ( xReportControlFormat.is() )
+ {
+ const String sUndoAction(String(ModuleRes(RID_STR_UNDO_CHANGEFONT)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+ rptui::openCharDialog(xReportControlFormat,xWindow);
+ getUndoMgr()->LeaveListAction();
+ InvalidateAll();
+ }
+ }
+ break;
+ //case SID_FM_DESIGN_MODE:
+ // break;
+ case SID_INSERT_GRAPHIC:
+ insertGraphic();
+ break;
+ case SID_SETCONTROLDEFAULTS:
+ break;
+ case SID_CONDITIONALFORMATTING:
+ {
+ uno::Reference< report::XFormattedField> xFormattedField(m_pMyOwnView->getCurrentControlModel(),uno::UNO_QUERY);
+ if ( xFormattedField.is() )
+ {
+ ConditionalFormattingDialog aDlg( getView(), xFormattedField.get(), *this );
+ aDlg.Execute();
+ }
+ }
+ break;
+ case SID_DATETIME:
+ if ( m_xReportDefinition.is() )
+ {
+ if ( !aArgs.getLength() )
+ {
+ ODateTimeDialog aDlg(getView(),m_pMyOwnView->getCurrentSection(),this);
+ aDlg.Execute();
+ }
+ else
+ createDateTime(aArgs);
+ } // if ( m_xReportDefinition.is() )
+ break;
+ case SID_INSERT_FLD_PGNUMBER:
+ if ( m_xReportDefinition.is() )
+ {
+ if ( !aArgs.getLength() )
+ {
+ OPageNumberDialog aDlg(getView(),m_xReportDefinition,this);
+ aDlg.Execute();
+ }
+ else
+ createPageNumber(aArgs);
+ } // if ( m_xReportDefinition.is() )
+ break;
+ case SID_INSERT_DIAGRAM:
+ case SID_EXPORTDOC:
+ case SID_EXPORTDOCASPDF:
+ break;
+ case SID_PRINTPREVIEW:
+ if ( m_xReportDefinition.is() )
+ {
+ }
+ break;
+ case SID_SAVEASDOC:
+ getView()->PostUserEvent(LINK(this, OReportController,OnSaveAs));
+ break;
+ case SID_SAVEDOC:
+ getView()->PostUserEvent(LINK(this, OReportController,OnSave));
+ break;
+ case SID_EDITDOC:
+ if(isEditable())
+ { // the state should be changed to not editable
+ switch (saveModified())
+ {
+ case RET_CANCEL:
+ // don't change anything here so return
+ return;
+ case RET_NO:
+ setModified(sal_False); // and we are not modified yet
+ break;
+ default:
+ break;
+ }
+ }
+ setEditable(!isEditable());
+ //getJoinView()->setReadOnly(!isEditable());
+ InvalidateAll();
+ return;
+ case SID_GROUP:
+ {
+ ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection();
+ if ( pReportSection.get() )
+ {
+ ::std::vector< uno::Reference< report::XReportComponent > > aSelection;
+ uno::Reference<report::XSection> xSection = pReportSection->getSection();
+ const String sUndoAction(String(ModuleRes(RID_STR_UNDO_GROUP)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ getUndoMgr()->LeaveListAction();
+ }
+ }
+ break;
+ default:
+ OReportController_BASE::Execute(_nId,aArgs);
+ }
+ InvalidateFeature(_nId,Reference< XStatusListener >(),bForceBroadcast);
+}
+// -----------------------------------------------------------------------------
+short OReportController::saveModified()
+{
+ return RET_NO;
+}
+// -----------------------------------------------------------------------------
+void OReportController::impl_initialize( )
+{
+ try
+ {
+ Reference< XConnection > xConn;
+ const ::comphelper::NamedValueCollection& rIni = getInitParams();
+ if ( rIni.get_ensureType(static_cast< ::rtl::OUString>(PROPERTY_ACTIVECONNECTION),xConn) && xConn.is() )
+ initializeConnection( xConn );
+
+ rIni.get_ensureType(static_cast< ::rtl::OUString>(PROPERTY_REPORTNAME),m_sName);
+ if ( !m_sName.getLength() )
+ {
+ static const ::rtl::OUString s_sDocumentTitle(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle"));
+ rIni.get_ensureType(s_sDocumentTitle,m_sName);
+ }
+
+
+ sal_Bool bFirstTry = sal_False;
+ if (!isConnected())
+ { // whoever instantiated us did not give us a connection to share. Okay, create an own one
+ dbtools::isEmbeddedInDatabase(m_xReportDefinition,xConn);
+ if ( xConn.is() )
+ initializeConnection( xConn );
+ if (!isConnected())
+ {
+ reconnect(sal_False);
+ bFirstTry = sal_True;
+ }
+ }
+ if (!isConnected()) // so what should otherwise
+ {
+ if ( !bFirstTry )
+ connectionLostMessage();
+ throw Exception();
+ }
+ }
+ catch(const SQLException&)
+ {
+ OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!");
+ }
+
+ try
+ {
+ if ( m_xReportDefinition.is() )
+ {
+ m_sName = m_xReportDefinition->getName();
+ getView()->initialize(); // show the windows and fill with our informations
+ getUndoMgr()->Clear(); // clear all undo redo things
+ getSdrModel();
+ if ( !m_aReportModel )
+ throw Exception();
+
+ listen(true);
+ setEditable( !m_aReportModel->IsReadOnly() );
+
+ } // if ( m_xReportDefinition.is() )
+
+ // restore the view data
+ m_pMyOwnView->toggleGrid(m_bGridVisible);
+ m_pMyOwnView->showRuler(m_bShowRuler);
+ m_pMyOwnView->togglePropertyBrowser(m_bShowProperties);
+ m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+ m_pMyOwnView->unmarkAllObjects(NULL);
+
+ if ( m_nPageNum != -1 )
+ {
+ if ( m_nPageNum < m_aReportModel->GetPageCount() )
+ {
+ const OReportPage* pPage = dynamic_cast<OReportPage*>(m_aReportModel->GetPage(static_cast<sal_uInt16>(m_nPageNum)));
+ if ( pPage )
+ {
+ uno::Sequence< beans::PropertyValue> aArgs(1);
+ aArgs[0].Value <<= pPage->getSection();
+ executeUnChecked(SID_SELECT,aArgs);
+ }
+ }
+ else
+ m_nPageNum = -1;
+ }
+ m_pMyOwnView->collapseSections(m_aCollapsedSections);
+ m_pMyOwnView->Invalidate();
+
+ if ( m_bShowProperties && m_nPageNum == -1 )
+ {
+ m_sLastActivePage = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"));
+ m_pMyOwnView->setCurrentPage(m_sLastActivePage);
+ uno::Sequence< beans::PropertyValue> aArgs;
+ executeUnChecked(SID_SELECT_REPORT,aArgs);
+ }
+
+ setModified(sal_False); // and we are not modified yet
+ }
+ catch(const SQLException&)
+ {
+ OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!");
+ }
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportController::Construct(Window* pParent)
+{
+ m_pMyOwnView = new ODesignView(pParent,getORB(),this);
+ StartListening(*(m_pMyOwnView));
+ m_pView = m_pMyOwnView;
+
+ // now that we have a view we can create the clipboard listener
+ m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
+ m_aSystemClipboard.StartClipboardListening( );
+ m_pClipbordNotifier = new TransferableClipboardListener( LINK( this, OReportController, OnClipboardChanged ) );
+ m_pClipbordNotifier->acquire();
+ m_pClipbordNotifier->AddRemoveListener( getView(), sal_True );
+
+ OReportController_BASE::Construct(pParent);
+ getView()->Show();
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OReportController::suspend(sal_Bool _bSuspend) throw( RuntimeException )
+{
+ if ( getBroadcastHelper().bInDispose || getBroadcastHelper().bDisposed )
+ return sal_True;
+
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ if ( getView() && getView()->IsInModalMode() )
+ return sal_False;
+
+ sal_Bool bCheck = sal_True;
+ (void)_bSuspend;
+
+ // this suspend will handle in the DBAccess interceptor implementation
+ return bCheck;
+}
+// -----------------------------------------------------------------------------
+void OReportController::describeSupportedFeatures()
+{
+ OSingleDocumentController::describeSupportedFeatures();
+
+ implDescribeSupportedFeature( ".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION );
+ implDescribeSupportedFeature( ".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION );
+
+ implDescribeSupportedFeature( ".uno:Redo", SID_REDO, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:Undo", SID_UNDO, CommandGroup::EDIT );
+ //implDescribeSupportedFeature( ".uno:PasteSpecial", SID_PASTE, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:SelectAll", SID_SELECTALL, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:SelectAllInSection", SID_SELECTALL_IN_SECTION, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:Delete", SID_DELETE, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:SelectReport", SID_SELECT_REPORT, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:ExecuteReport", SID_EXECUTE_REPORT, CommandGroup::EDIT );
+
+ implDescribeSupportedFeature( ".uno:GridVisible", SID_GRID_VISIBLE, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:GridUse", SID_GRID_USE, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:HelplinesMove", SID_HELPLINES_MOVE, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:ShowRuler", SID_RULER, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:AddField", SID_FM_ADD_FIELD, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:ReportNavigator", SID_RPT_SHOWREPORTEXPLORER, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:ControlProperties", SID_SHOW_PROPERTYBROWSER, CommandGroup::VIEW );
+ //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER, CommandGroup::VIEW );
+ //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW );
+
+ implDescribeSupportedFeature( ".uno:InsertPageNumberField", SID_INSERT_FLD_PGNUMBER, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:InsertDateTimeField", SID_DATETIME, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:InsertObjectChart", SID_INSERT_DIAGRAM, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:InsertGraphic", SID_INSERT_GRAPHIC, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:PageDialog", SID_PAGEDIALOG, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ResetAttributes", SID_SETCONTROLDEFAULTS, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:Bold", SID_ATTR_CHAR_WEIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Italic", SID_ATTR_CHAR_POSTURE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Underline", SID_ATTR_CHAR_UNDERLINE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:BackColor", SID_ATTR_CHAR_COLOR_BACKGROUND, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:BackgroundColor", SID_BACKGROUND_COLOR, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Color", SID_ATTR_CHAR_COLOR);
+ implDescribeSupportedFeature( ".uno:FontColor", SID_ATTR_CHAR_COLOR2, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FontDialog", SID_CHAR_DLG, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:LeftPara", SID_ATTR_PARA_ADJUST_LEFT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:CenterPara", SID_ATTR_PARA_ADJUST_CENTER, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:RightPara", SID_ATTR_PARA_ADJUST_RIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FontHeight", SID_ATTR_CHAR_FONTHEIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:CharFontName", SID_ATTR_CHAR_FONT, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:ArrangeMenu", SID_ARRANGEMENU, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:BringToFront", SID_FRAME_TO_TOP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectBackOne", SID_FRAME_DOWN, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectForwardOne", SID_FRAME_UP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SendToBack", SID_FRAME_TO_BOTTOM, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SetObjectToForeground", SID_OBJECT_HEAVEN, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SetObjectToBackground", SID_OBJECT_HELL, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:ObjectAlign", SID_OBJECT_ALIGN, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectAlignLeft", SID_OBJECT_ALIGN_LEFT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:AlignCenter", SID_OBJECT_ALIGN_CENTER, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectAlignRight", SID_OBJECT_ALIGN_RIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:AlignUp", SID_OBJECT_ALIGN_UP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:AlignMiddle", SID_OBJECT_ALIGN_MIDDLE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:AlignDown", SID_OBJECT_ALIGN_DOWN, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:SectionAlign", SID_SECTION_ALIGN, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignLeft", SID_SECTION_ALIGN_LEFT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignCenter", SID_SECTION_ALIGN_CENTER, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignRight", SID_SECTION_ALIGN_RIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignTop", SID_SECTION_ALIGN_UP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignMiddle", SID_SECTION_ALIGN_MIDDLE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionAlignBottom", SID_SECTION_ALIGN_DOWN, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:ObjectResize", SID_OBJECT_RESIZING, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SmallestWidth", SID_OBJECT_SMALLESTWIDTH, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Distribution", SID_DISTRIBUTION, CommandGroup::FORMAT );
+
+ implDescribeSupportedFeature( ".uno:HelpMenu", SID_HELPMENU, CommandGroup::APPLICATION );
+ implDescribeSupportedFeature( ".uno:ExportTo", SID_EXPORTDOC, CommandGroup::APPLICATION );
+ implDescribeSupportedFeature( ".uno:ExportToPDF", SID_EXPORTDOCASPDF, CommandGroup::APPLICATION );
+ implDescribeSupportedFeature( ".uno:PrintPreview", SID_PRINTPREVIEW, CommandGroup::APPLICATION );
+
+ implDescribeSupportedFeature( ".uno:NewDoc", SID_NEWDOC, CommandGroup::DOCUMENT );
+ implDescribeSupportedFeature( ".uno:Save", SID_SAVEDOC, CommandGroup::DOCUMENT );
+ implDescribeSupportedFeature( ".uno:SaveAs", SID_SAVEASDOC, CommandGroup::DOCUMENT );
+
+ // controls
+ implDescribeSupportedFeature( ".uno:SelectObject", SID_OBJECT_SELECT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Label", SID_FM_FIXEDTEXT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:Edit", SID_FM_EDIT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ImageControl", SID_FM_IMAGECONTROL, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:HFixedLine", SID_INSERT_HFIXEDLINE, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:VFixedLine", SID_INSERT_VFIXEDLINE, CommandGroup::INSERT );
+
+ // shapes
+ implDescribeSupportedFeature( ".uno:BasicShapes", SID_DRAWTBX_CS_BASIC, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.rectangle", SID_DRAWTBX_CS_BASIC1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.round-rectangle",SID_DRAWTBX_CS_BASIC2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.quadrat", SID_DRAWTBX_CS_BASIC3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.round-quadrat", SID_DRAWTBX_CS_BASIC4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.circle", SID_DRAWTBX_CS_BASIC5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.ellipse", SID_DRAWTBX_CS_BASIC6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.circle-pie", SID_DRAWTBX_CS_BASIC7, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.isosceles-triangle",SID_DRAWTBX_CS_BASIC8, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.right-triangle",SID_DRAWTBX_CS_BASIC9, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.trapezoid", SID_DRAWTBX_CS_BASIC10, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.diamond", SID_DRAWTBX_CS_BASIC11, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.parallelogram", SID_DRAWTBX_CS_BASIC12, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.pentagon", SID_DRAWTBX_CS_BASIC13, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.hexagon", SID_DRAWTBX_CS_BASIC14, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.octagon", SID_DRAWTBX_CS_BASIC15, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.cross", SID_DRAWTBX_CS_BASIC16, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.ring", SID_DRAWTBX_CS_BASIC17, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.block-arc", SID_DRAWTBX_CS_BASIC18, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.can", SID_DRAWTBX_CS_BASIC19, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.cube", SID_DRAWTBX_CS_BASIC20, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.paper", SID_DRAWTBX_CS_BASIC21, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:BasicShapes.frame", SID_DRAWTBX_CS_BASIC22, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:SymbolShapes", SID_DRAWTBX_CS_SYMBOL, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:SymbolShapes.smiley" , SID_DRAWTBX_CS_SYMBOL1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.sun" , SID_DRAWTBX_CS_SYMBOL2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.moon" , SID_DRAWTBX_CS_SYMBOL3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.lightning" , SID_DRAWTBX_CS_SYMBOL4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.heart" , SID_DRAWTBX_CS_SYMBOL5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.flower" , SID_DRAWTBX_CS_SYMBOL6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.cloud" , SID_DRAWTBX_CS_SYMBOL7, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.forbidden" , SID_DRAWTBX_CS_SYMBOL8, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.puzzle" , SID_DRAWTBX_CS_SYMBOL9, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.bracket-pair" ,SID_DRAWTBX_CS_SYMBOL10, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.left-bracket" ,SID_DRAWTBX_CS_SYMBOL11, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.right-bracket",SID_DRAWTBX_CS_SYMBOL12, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.brace-pair" , SID_DRAWTBX_CS_SYMBOL13, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.left-brace" , SID_DRAWTBX_CS_SYMBOL14, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.right-brace" , SID_DRAWTBX_CS_SYMBOL15, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.quad-bevel" , SID_DRAWTBX_CS_SYMBOL16, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.octagon-bevel",SID_DRAWTBX_CS_SYMBOL17, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:SymbolShapes.diamond-bevel",SID_DRAWTBX_CS_SYMBOL18, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:ArrowShapes.left-arrow" , SID_DRAWTBX_CS_ARROW1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.right-arrow" , SID_DRAWTBX_CS_ARROW2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-arrow" , SID_DRAWTBX_CS_ARROW3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.down-arrow" , SID_DRAWTBX_CS_ARROW4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.left-right-arrow" , SID_DRAWTBX_CS_ARROW5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-down-arrow" , SID_DRAWTBX_CS_ARROW6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-arrow" , SID_DRAWTBX_CS_ARROW7, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-down-arrow" , SID_DRAWTBX_CS_ARROW8, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.quad-arrow" , SID_DRAWTBX_CS_ARROW9, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.corner-right-arrow" , SID_DRAWTBX_CS_ARROW10, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.split-arrow" , SID_DRAWTBX_CS_ARROW11, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.striped-right-arrow" , SID_DRAWTBX_CS_ARROW12, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.notched-right-arrow" , SID_DRAWTBX_CS_ARROW13, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.pentagon-right" , SID_DRAWTBX_CS_ARROW14, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.chevron" , SID_DRAWTBX_CS_ARROW15, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.right-arrow-callout" , SID_DRAWTBX_CS_ARROW16, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.left-arrow-callout" , SID_DRAWTBX_CS_ARROW17, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-arrow-callout" , SID_DRAWTBX_CS_ARROW18, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.down-arrow-callout" , SID_DRAWTBX_CS_ARROW19, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.left-right-arrow-callout",SID_DRAWTBX_CS_ARROW20, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-down-arrow-callout" ,SID_DRAWTBX_CS_ARROW21, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.up-right-arrow-callout",SID_DRAWTBX_CS_ARROW22, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.quad-arrow-callout" , SID_DRAWTBX_CS_ARROW23, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.circular-arrow" , SID_DRAWTBX_CS_ARROW24, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.split-round-arrow" , SID_DRAWTBX_CS_ARROW25, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:ArrowShapes.s-sharped-arrow" , SID_DRAWTBX_CS_ARROW26, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:StarShapes.bang" , SID_DRAWTBX_CS_STAR1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star4" , SID_DRAWTBX_CS_STAR2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star5" , SID_DRAWTBX_CS_STAR3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star6" , SID_DRAWTBX_CS_STAR4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star8" , SID_DRAWTBX_CS_STAR5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star12" , SID_DRAWTBX_CS_STAR6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.star24" , SID_DRAWTBX_CS_STAR7, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.concave-star6" , SID_DRAWTBX_CS_STAR8, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.vertical-scroll" , SID_DRAWTBX_CS_STAR9, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.horizontal-scroll" , SID_DRAWTBX_CS_STAR10, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.signet" , SID_DRAWTBX_CS_STAR11, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes.doorplate" , SID_DRAWTBX_CS_STAR12, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-process" , SID_DRAWTBX_CS_FLOWCHART1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-alternate-process" , SID_DRAWTBX_CS_FLOWCHART2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-decision" , SID_DRAWTBX_CS_FLOWCHART3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-data" , SID_DRAWTBX_CS_FLOWCHART4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-predefined-process" , SID_DRAWTBX_CS_FLOWCHART5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-internal-storage" , SID_DRAWTBX_CS_FLOWCHART6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-document" , SID_DRAWTBX_CS_FLOWCHART7, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-multidocument" , SID_DRAWTBX_CS_FLOWCHART8, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-terminator" , SID_DRAWTBX_CS_FLOWCHART9, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-preparation" , SID_DRAWTBX_CS_FLOWCHART10, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-manual-input" , SID_DRAWTBX_CS_FLOWCHART11, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-manual-operation" , SID_DRAWTBX_CS_FLOWCHART12, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-connector" , SID_DRAWTBX_CS_FLOWCHART13, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-off-page-connector" , SID_DRAWTBX_CS_FLOWCHART14, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-card" , SID_DRAWTBX_CS_FLOWCHART15, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-punched-tape" , SID_DRAWTBX_CS_FLOWCHART16, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-summing-junction" , SID_DRAWTBX_CS_FLOWCHART17, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-or" , SID_DRAWTBX_CS_FLOWCHART18, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-collate" , SID_DRAWTBX_CS_FLOWCHART19, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-sort" , SID_DRAWTBX_CS_FLOWCHART20, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-extract" , SID_DRAWTBX_CS_FLOWCHART21, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-merge" , SID_DRAWTBX_CS_FLOWCHART22, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-stored-data" , SID_DRAWTBX_CS_FLOWCHART23, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-delay" , SID_DRAWTBX_CS_FLOWCHART24, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-sequential-access" , SID_DRAWTBX_CS_FLOWCHART25, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-magnetic-disk" , SID_DRAWTBX_CS_FLOWCHART26, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-direct-access-storage",SID_DRAWTBX_CS_FLOWCHART27, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:FlowChartShapes.flowchart-display" , SID_DRAWTBX_CS_FLOWCHART28, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:CalloutShapes.rectangular-callout" , SID_DRAWTBX_CS_CALLOUT1, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.round-rectangular-callout" , SID_DRAWTBX_CS_CALLOUT2, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.round-callout" , SID_DRAWTBX_CS_CALLOUT3, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.cloud-callout" , SID_DRAWTBX_CS_CALLOUT4, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-1" , SID_DRAWTBX_CS_CALLOUT5, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-2" , SID_DRAWTBX_CS_CALLOUT6, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes.line-callout-3" , SID_DRAWTBX_CS_CALLOUT7, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:ArrowShapes", SID_DRAWTBX_CS_ARROW, CommandGroup::INSERT );
+
+ implDescribeSupportedFeature( ".uno:FlowChartShapes", SID_DRAWTBX_CS_FLOWCHART, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:CalloutShapes", SID_DRAWTBX_CS_CALLOUT, CommandGroup::INSERT );
+ implDescribeSupportedFeature( ".uno:StarShapes", SID_DRAWTBX_CS_STAR, CommandGroup::INSERT );
+
+
+ // keys
+ implDescribeSupportedFeature( ".uno:Escape", SID_ESCAPE, CommandGroup::CONTROLS);
+
+
+ // internal one
+ implDescribeSupportedFeature( ".uno:RPT_RPTHEADER_UNDO", SID_REPORTHEADER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:RPT_RPTFOOTER_UNDO", SID_REPORTFOOTER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:RPT_PGHEADER_UNDO", SID_PAGEHEADER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:RPT_PGFOOTER_UNDO", SID_PAGEFOOTER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:DBBackgroundColor", SID_ATTR_CHAR_COLOR_BACKGROUND);
+ implDescribeSupportedFeature( ".uno:SID_GROUPHEADER", SID_GROUPHEADER);
+ implDescribeSupportedFeature( ".uno:SID_GROUPHEADER_WITHOUT_UNDO", SID_GROUPHEADER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:SID_GROUPFOOTER", SID_GROUPFOOTER);
+ implDescribeSupportedFeature( ".uno:SID_GROUPFOOTER_WITHOUT_UNDO", SID_GROUPFOOTER_WITHOUT_UNDO);
+ implDescribeSupportedFeature( ".uno:SID_GROUP_REMOVE", SID_GROUP_REMOVE);
+ implDescribeSupportedFeature( ".uno:SID_GROUP_APPEND", SID_GROUP_APPEND);
+ implDescribeSupportedFeature( ".uno:SID_ADD_CONTROL_PAIR", SID_ADD_CONTROL_PAIR);
+ implDescribeSupportedFeature( ".uno:SplitPosition", SID_SPLIT_POSITION);
+ implDescribeSupportedFeature( ".uno:LastPropertyBrowserPage", SID_PROPERTYBROWSER_LAST_PAGE);
+ implDescribeSupportedFeature( ".uno:Select", SID_SELECT);
+ implDescribeSupportedFeature( ".uno:InsertFunction", SID_RPT_NEW_FUNCTION);
+ implDescribeSupportedFeature( ".uno:NextMark", SID_NEXT_MARK);
+ implDescribeSupportedFeature( ".uno:PrevMark", SID_PREV_MARK);
+}
+// -----------------------------------------------------------------------------
+SfxUndoManager* OReportController::getUndoMgr()
+{
+ return &m_aUndoManager;
+}
+// -----------------------------------------------------------------------------
+void OReportController::setModified(sal_Bool _bModified)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ try
+ {
+ if ( m_xReportDefinition.is() )
+ m_xReportDefinition->setModified(_bModified);
+ OSingleDocumentController::setModified(_bModified);
+ }
+ catch(uno::Exception)
+ {}
+}
+// -----------------------------------------------------------------------------
+void OReportController::losingConnection( )
+{
+ // let the base class do it's reconnect
+ OReportController_BASE::losingConnection( );
+
+ InvalidateAll();
+}
+// -----------------------------------------------------------------------------
+void OReportController::updateTitle()
+{
+ ::rtl::OUString sName;
+ if ( m_xReportDefinition.is() )
+ sName = m_xReportDefinition->getCaption();
+
+ if ( !sName.getLength() )
+ sName = String(ModuleRes(RID_APP_NEW_DOC));
+
+ String sTitle = String(ModuleRes(RID_APP_TITLE));
+ sName = sName + sTitle;
+//#ifndef PRODUCT
+// ::rtl::OUString aDefault;
+// sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ["));
+// sName += utl::Bootstrap::getBuildIdData( aDefault );
+// sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));
+//#endif
+ OGenericUnoController::setTitle(sName);
+}
+// -----------------------------------------------------------------------------
+void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _xLayoutManager)
+{
+ if ( _xLayoutManager.is() )
+ {
+ static const ::rtl::OUString s_sMenu[] = {
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/statusbar/statusbar"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/reportcontrols"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/Formatting"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/alignmentbar"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/sectionalignmentbar"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/resizebar"))
+ };
+ for (size_t i = 0; i< sizeof(s_sMenu)/sizeof(s_sMenu[0]); ++i)
+ {
+ _xLayoutManager->createElement( s_sMenu[i] );
+ _xLayoutManager->requestElement( s_sMenu[i] );
+ }
+ } // if ( _xLayoutManager.is() )
+}
+// -----------------------------------------------------------------------------
+void OReportController::notifyGroupSections(const ContainerEvent& _rEvent,bool _bShow)
+{
+ uno::Reference< report::XGroup> xGroup(_rEvent.Element,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ ::osl::MutexGuard aGuard(m_aMutex);
+ sal_Int32 nGroupPos = 0;
+ _rEvent.Accessor >>= nGroupPos;
+
+ if ( _bShow )
+ {
+ xGroup->addPropertyChangeListener(PROPERTY_HEADERON, static_cast<XPropertyChangeListener*>(this));
+ xGroup->addPropertyChangeListener(PROPERTY_FOOTERON, static_cast<XPropertyChangeListener*>(this));
+ }
+ else
+ {
+ xGroup->removePropertyChangeListener(PROPERTY_HEADERON, static_cast<XPropertyChangeListener*>(this));
+ xGroup->removePropertyChangeListener(PROPERTY_FOOTERON, static_cast<XPropertyChangeListener*>(this));
+ }
+
+ if ( xGroup->getHeaderOn() )
+ {
+ groupChange(xGroup,PROPERTY_HEADERON,nGroupPos,_bShow);
+ }
+ if ( xGroup->getFooterOn() )
+ {
+ groupChange(xGroup,PROPERTY_FOOTERON,nGroupPos,_bShow);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+// ::container::XContainerListener
+void SAL_CALL OReportController::elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException)
+{
+ notifyGroupSections(_rEvent,true);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException)
+{
+ notifyGroupSections(_rEvent,false);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::elementReplaced( const ContainerEvent& /*_rEvent*/ ) throw(RuntimeException)
+{
+ ::vos::OGuard aSolarGuard(Application::GetSolarMutex());
+ ::osl::MutexGuard aGuard(m_aMutex);
+ OSL_ENSURE(0,"Not yet implemented!");
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEvent& evt ) throw (RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ try
+ {
+ sal_Bool bShow = sal_False;
+ evt.NewValue >>= bShow;
+ if ( evt.Source == m_xReportDefinition )
+ {
+ if ( evt.PropertyName.equals( PROPERTY_REPORTHEADERON ) )
+ {
+ const USHORT nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
+ if ( bShow )
+ m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition);
+ else
+ m_pMyOwnView->removeSection(nPosition);
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) )
+ {
+ USHORT nPosition = m_pMyOwnView->getSectionCount();
+ if ( m_xReportDefinition->getPageFooterOn() )
+ --nPosition;
+ if ( bShow )
+ m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER,nPosition);
+ else
+ m_pMyOwnView->removeSection(nPosition - 1);
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_PAGEHEADERON ) )
+ {
+ if ( bShow )
+ m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,0);
+ else
+ m_pMyOwnView->removeSection(USHORT(0));
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) )
+ {
+ if ( bShow )
+ m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+ else
+ m_pMyOwnView->removeSection(m_pMyOwnView->getSectionCount() - 1);
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_COMMAND )
+ || evt.PropertyName.equals( PROPERTY_COMMANDTYPE )
+ || evt.PropertyName.equals( PROPERTY_ESCAPEPROCESSING )
+ || evt.PropertyName.equals( PROPERTY_FILTER )
+ )
+ {
+ InvalidateFeature(SID_FM_ADD_FIELD);
+ if ( !m_pMyOwnView->isAddFieldVisible() )
+ m_pMyOwnView->toggleAddField();
+ }
+ } // if ( evt.Source == m_xReportDefinition )
+ else
+ {
+ uno::Reference< report::XGroup> xGroup(evt.Source,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ sal_Int32 nGroupPos = getGroupPosition(xGroup);
+
+ groupChange(xGroup,evt.PropertyName,nGroupPos,bShow);
+ }
+ }
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::disposing( const lang::EventObject& /*Source*/ ) throw(uno::RuntimeException)
+{
+ // not interested in
+}
+
+// -----------------------------------------------------------------------------
+USHORT lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups
+ ,sal_Int32 _nGroupPos
+ ,::std::mem_fun_t<sal_Bool,OGroupHelper>&_pGroupMemberFunction)
+{
+ uno::Reference< report::XGroup> xGroup;
+ USHORT nNonVisibleGroups = 0;
+ sal_Int32 nCount = _xGroups->getCount();
+ for( sal_Int32 i = 0; i < _nGroupPos && i < nCount; ++i)
+ {
+ xGroup.set(_xGroups->getByIndex(i),uno::UNO_QUERY);
+ OSL_ENSURE(xGroup.is(),"Group is NULL! -> GPF");
+ OGroupHelper aGroupHelper(xGroup);
+ if ( !_pGroupMemberFunction(&aGroupHelper) )
+ ++nNonVisibleGroups;
+ }
+ return nNonVisibleGroups;
+}
+// -----------------------------------------------------------------------------
+void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGroup,const ::rtl::OUString& _sPropName,sal_Int32 _nGroupPos,bool _bShow)
+{
+ //adjustSectionName(_xGroup,_nGroupPos);
+ ::std::mem_fun_t<sal_Bool,OGroupHelper> pMemFun = ::std::mem_fun(&OGroupHelper::getHeaderOn);
+ ::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> pMemFunSection = ::std::mem_fun(&OGroupHelper::getHeader);
+ ::rtl::OUString sColor(DBGROUPHEADER);
+ USHORT nPosition = 0;
+ bool bHandle = false;
+ if ( _sPropName.equals( PROPERTY_HEADERON ) )
+ {
+ nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0);
+ nPosition += (static_cast<USHORT>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
+ bHandle = true;
+ }
+ else if ( _sPropName.equals( PROPERTY_FOOTERON ) )
+ {
+ pMemFun = ::std::mem_fun(&OGroupHelper::getFooterOn);
+ pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter);
+ nPosition = m_pMyOwnView->getSectionCount();
+
+ if ( m_xReportDefinition->getPageFooterOn() )
+ --nPosition;
+ if ( m_xReportDefinition->getReportFooterOn() )
+ --nPosition;
+ sColor = DBGROUPFOOTER;
+ nPosition -= (static_cast<USHORT>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
+ if ( !_bShow )
+ --nPosition;
+ bHandle = true;
+ }
+ if ( bHandle )
+ {
+ if ( _bShow )
+ {
+ OGroupHelper aGroupHelper(_xGroup);
+ m_pMyOwnView->addSection(pMemFunSection(&aGroupHelper),sColor,nPosition);
+ }
+ else
+ m_pMyOwnView->removeSection(nPosition);
+ }
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnClipboardChanged, void*, EMPTYARG )
+{
+ return OnInvalidateClipboard( NULL );
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OReportController, NotifyUndoActionHdl, SfxUndoAction*, _pUndoAction )
+{
+ OSL_ENSURE(_pUndoAction,"UndoAction is NULL!");
+ addUndoActionAndInvalidate(_pUndoAction);
+ return 0L;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK(OReportController, OnInvalidateClipboard, void*, EMPTYARG)
+{
+ InvalidateFeature(SID_CUT);
+ InvalidateFeature(SID_COPY);
+ InvalidateFeature(SID_PASTE);
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportController::doSaveDoc(sal_Bool _bSaveAs)
+{
+ WaitObject aWO(getView());
+
+ sal_Bool bRet = sal_False;
+ if ( m_xReportDefinition.is() )
+ try
+ {
+ if ( !_bSaveAs )
+ {
+ uno::Reference< embed::XStorage > xStorage = m_xReportDefinition->getDocumentStorage();
+ OSL_ENSURE(xStorage.is(),"No Storage available!");
+ if ( xStorage.is() )
+ {
+ m_xReportDefinition->storeToStorage(xStorage,m_xReportDefinition->getArgs());
+ }
+ }
+
+
+ uno::Reference< sdb::XDocumentDataSource> xDocumentDataSource(getDataSource(),UNO_QUERY);
+ if ( xDocumentDataSource.is() )
+ {
+ uno::Reference< sdb::XReportDocumentsSupplier> xSup(xDocumentDataSource->getDatabaseDocument(),UNO_QUERY);
+ if ( xSup.is() )
+ {
+ uno::Reference< container::XNameContainer> xNames(xSup->getReportDocuments(),uno::UNO_QUERY);
+ OSL_ENSURE(xNames.is(),"Who blows my XNameAccess up! -> GPF");
+ sal_Bool bNew = (0 == m_sName.getLength());
+ bNew = bNew || _bSaveAs || (xNames.is() && !xNames->hasByName(m_sName));
+ // first we need a name for our query so ask the user
+ if ( bNew )
+ {
+ ::rtl::OUString sDefault;
+ if (_bSaveAs && !bNew)
+ sDefault = m_sName;
+ else
+ {
+ String aName = String(ModuleRes(STR_RPT_TITLE));
+ aName = aName.GetToken(0,' ');
+ sDefault = String(::dbtools::createUniqueName(xNames.get(),aName));
+ }
+
+ const ::rtl::OUString sLabel(String(ModuleRes(STR_RPT_LABEL)));
+ Sequence< Any > aArgs(4);
+ Reference< awt::XWindow> xWindow = getTopMostContainerWindow();
+ if ( !xWindow.is() )
+ {
+ xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent());
+ }
+ // the parent window
+ aArgs[0] <<= beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")),makeAny(xWindow));
+ aArgs[1] <<= beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultValue")),makeAny(sDefault));
+ aArgs[2] <<= beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Label")),makeAny(sLabel));
+ aArgs[3] <<= beans::NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalNameAccess")),makeAny(uno::Reference< container::XHierarchicalNameAccess>(xNames,uno::UNO_QUERY)));
+
+ Reference< XExecutableDialog > xDialog(getORB()->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.SaveAsDialog")),aArgs), UNO_QUERY);
+
+ // execute it
+ if (xDialog.is() && xDialog->execute() == RET_OK )
+ {
+ uno::Reference<beans::XPropertySet> xProp(xDialog,uno::UNO_QUERY_THROW);
+ xProp->getPropertyValue(PROPERTY_NAME) >>= m_sName;
+ m_xReportDefinition->setName(m_sName);
+ xNames->insertByName(m_sName,uno::makeAny(m_xReportDefinition));
+ }
+ else
+ return sal_False;
+ } // if(bNew)
+ //else
+ // xNames->replaceByName(m_sName,uno::makeAny(m_xReportDefinition));
+
+ } // if ( xSup.is() )
+ }
+ setModified(sal_False);
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ bRet = sal_False;
+ }
+ return bRet;
+}
+namespace
+{
+// -----------------------------------------------------------------------------
+view::PaperFormat lcl_convertPaperFormat(SvxPaper _ePaperFormat)
+{
+ view::PaperFormat eUnoPaperFormat;
+ switch(_ePaperFormat)
+ {
+ case SVX_PAPER_A3:
+ eUnoPaperFormat = view::PaperFormat_A3;
+ break;
+ case SVX_PAPER_A4:
+ eUnoPaperFormat = view::PaperFormat_A4;
+ break;
+ case SVX_PAPER_A5:
+ eUnoPaperFormat = view::PaperFormat_A5;
+ break;
+ case SVX_PAPER_B4:
+ eUnoPaperFormat = view::PaperFormat_B4;
+ break;
+ case SVX_PAPER_B5:
+ eUnoPaperFormat = view::PaperFormat_B5;
+ break;
+ case SVX_PAPER_LETTER:
+ eUnoPaperFormat = view::PaperFormat_LETTER;
+ break;
+ case SVX_PAPER_LEGAL:
+ eUnoPaperFormat = view::PaperFormat_LEGAL;
+ break;
+ case SVX_PAPER_TABLOID:
+ eUnoPaperFormat = view::PaperFormat_TABLOID;
+ break;
+ default:
+ eUnoPaperFormat = view::PaperFormat_USER;
+ } // switch(_ePaperFormat)
+ return eUnoPaperFormat;
+}
+// -----------------------------------------------------------------------------
+SvxPaper lcl_convertPaperFormat(view::PaperFormat _eUnoPaperFormat)
+{
+ SvxPaper ePaperFormat;
+ switch(_eUnoPaperFormat)
+ {
+ case view::PaperFormat_A3:
+ ePaperFormat = SVX_PAPER_A3;
+ break;
+ case view::PaperFormat_A4:
+ ePaperFormat = SVX_PAPER_A4;
+ break;
+ case view::PaperFormat_A5:
+ ePaperFormat = SVX_PAPER_A5;
+ break;
+ case view::PaperFormat_B4:
+ ePaperFormat = SVX_PAPER_B4;
+ break;
+ case view::PaperFormat_B5:
+ ePaperFormat = SVX_PAPER_B5;
+ break;
+ case view::PaperFormat_LETTER:
+ ePaperFormat = SVX_PAPER_LETTER;
+ break;
+ case view::PaperFormat_LEGAL:
+ ePaperFormat = SVX_PAPER_LEGAL;
+ break;
+ case view::PaperFormat_TABLOID:
+ ePaperFormat = SVX_PAPER_TABLOID;
+ break;
+ default:
+ ePaperFormat = SVX_PAPER_USER;
+ } // switch(_eUnoPaperFormat)
+ return ePaperFormat;
+}
+// -----------------------------------------------------------------------------
+SvxGraphicPosition lcl_convertGraphicPosition(style::GraphicLocation eUnoGraphicPos)
+{
+ SvxGraphicPosition eRet = GPOS_NONE;
+ switch(eUnoGraphicPos)
+ {
+ case style::GraphicLocation_NONE: eRet = GPOS_NONE; break;
+ case style::GraphicLocation_LEFT_TOP: eRet = GPOS_LT; break;
+ case style::GraphicLocation_MIDDLE_TOP: eRet = GPOS_MT; break;
+ case style::GraphicLocation_RIGHT_TOP: eRet = GPOS_RT; break;
+ case style::GraphicLocation_LEFT_MIDDLE: eRet = GPOS_LM; break;
+ case style::GraphicLocation_MIDDLE_MIDDLE: eRet = GPOS_MM; break;
+ case style::GraphicLocation_RIGHT_MIDDLE: eRet = GPOS_RM; break;
+ case style::GraphicLocation_LEFT_BOTTOM: eRet = GPOS_LB; break;
+ case style::GraphicLocation_MIDDLE_BOTTOM: eRet = GPOS_MB; break;
+ case style::GraphicLocation_RIGHT_BOTTOM: eRet = GPOS_RB; break;
+ case style::GraphicLocation_AREA: eRet = GPOS_AREA; break;
+ case style::GraphicLocation_TILED: eRet = GPOS_TILED; break;
+ default:
+ break;
+ } // switch(eUnoGraphicPos)
+ return eRet;
+}
+// -----------------------------------------------------------------------------
+style::GraphicLocation lcl_convertGraphicPosition(SvxGraphicPosition eGraphicPos)
+{
+ style::GraphicLocation eRet = style::GraphicLocation_NONE;
+ switch(eGraphicPos)
+ {
+ case GPOS_NONE: eRet = style::GraphicLocation_NONE; break;
+ case GPOS_LT: eRet = style::GraphicLocation_LEFT_TOP; break;
+ case GPOS_MT: eRet = style::GraphicLocation_MIDDLE_TOP; break;
+ case GPOS_RT: eRet = style::GraphicLocation_RIGHT_TOP; break;
+ case GPOS_LM: eRet = style::GraphicLocation_LEFT_MIDDLE; break;
+ case GPOS_MM: eRet = style::GraphicLocation_MIDDLE_MIDDLE; break;
+ case GPOS_RM: eRet = style::GraphicLocation_RIGHT_MIDDLE; break;
+ case GPOS_LB: eRet = style::GraphicLocation_LEFT_BOTTOM; break;
+ case GPOS_MB: eRet = style::GraphicLocation_MIDDLE_BOTTOM; break;
+ case GPOS_RB: eRet = style::GraphicLocation_RIGHT_BOTTOM; break;
+ case GPOS_AREA: eRet = style::GraphicLocation_AREA; break;
+ case GPOS_TILED: eRet = style::GraphicLocation_TILED; break;
+ default:
+ break;
+ } // switch(eUnoGraphicPos)
+ return eRet;
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+}
+// =============================================================================
+// -----------------------------------------------------------------------------
+void OReportController::openPageDialog(const uno::Reference<report::XSection>& _xSection)
+{
+ if ( !m_xReportDefinition.is() )
+ return;
+ // ------------
+ // UNO->ItemSet
+ static SfxItemInfo aItemInfos[] =
+ {
+ { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_PAGE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_PAGE_SIZE, SFX_ITEM_POOLABLE },
+ { SID_ENUM_PAGE_MODE, SFX_ITEM_POOLABLE },
+ { SID_PAPER_START, SFX_ITEM_POOLABLE },
+ { SID_PAPER_END, SFX_ITEM_POOLABLE },
+ { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE },
+ { SID_FLAG_TYPE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_METRIC, SFX_ITEM_POOLABLE }
+ };
+
+ MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+ FieldUnit eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH;
+ SfxPoolItem* pDefaults[] =
+ {
+ new SvxLRSpaceItem(RPTUI_ID_LRSPACE),
+ new SvxULSpaceItem(RPTUI_ID_ULSPACE),
+ new SvxPageItem(RPTUI_ID_PAGE),
+ new SvxSizeItem(RPTUI_ID_SIZE),
+ new SfxAllEnumItem(RPTUI_ID_PAGE_MODE,SVX_PAGE_MODE_STANDARD),
+ new SfxAllEnumItem(RPTUI_ID_START,SVX_PAPER_A4),
+ new SfxAllEnumItem(RPTUI_ID_END,SVX_PAPER_E),
+ new SvxBrushItem(ITEMID_BRUSH),
+ new SfxUInt16Item(RPTUI_ID_METRIC,static_cast<UINT16>(eUserMetric))
+ };
+
+ static USHORT pRanges[] =
+ {
+ RPTUI_ID_LRSPACE,RPTUI_ID_BRUSH,
+ SID_ATTR_METRIC,SID_ATTR_METRIC
+ };
+
+ try
+ {
+ ::std::auto_ptr<SfxItemPool> pPool( new SfxItemPool(String::CreateFromAscii("ReportPageProperties"), RPTUI_ID_LRSPACE,RPTUI_ID_METRIC, aItemInfos, pDefaults) );
+ pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); // ripped, don't understand why
+ pPool->FreezeIdRanges(); // the same
+
+ ::std::auto_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
+ // fill it
+ if ( _xSection.is() )
+ pDescriptor->Put(SvxBrushItem(::Color(_xSection->getBackColor()),ITEMID_BRUSH));
+ else
+ {
+ //view::PaperFormat eUnoPaperFormat = m_xReportDefinition->getPaperFormat();
+ //pDescriptor->Put(SfxAllEnumItem(RPTUI_ID_START,lcl_convertPaperFormat(eUnoPaperFormat)));
+ pDescriptor->Put(SvxSizeItem(RPTUI_ID_SIZE,VCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE))));
+ pDescriptor->Put(SvxLRSpaceItem(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN)
+ ,getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN),0,0,RPTUI_ID_LRSPACE));
+ pDescriptor->Put(SvxULSpaceItem(static_cast<USHORT>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN))
+ ,static_cast<USHORT>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE));
+ pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast<UINT16>(eUserMetric)));
+
+ uno::Reference< style::XStyle> xPageStyle(getUsedStyle(m_xReportDefinition));
+ if ( xPageStyle.is() )
+ {
+ SvxPageItem aPageItem(RPTUI_ID_PAGE);
+ aPageItem.SetDescName(xPageStyle->getName());
+
+ //style::PageStyleLayout ePageStyleLayout = getStyleProperty<style::PageStyleLayout>(m_xReportDefinition,PROPERTY_PAGESTYLELAYOUT);
+ aPageItem.SetPageUsage(SVX_PAGE_ALL);
+ aPageItem.SetLandscape(getStyleProperty<sal_Bool>(m_xReportDefinition,PROPERTY_ISLANDSCAPE));
+ aPageItem.SetNumType((SvxNumType)getStyleProperty<sal_Int16>(m_xReportDefinition,PROPERTY_NUMBERINGTYPE));
+ pDescriptor->Put(aPageItem);
+ pDescriptor->Put(SvxBrushItem(::Color(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BACKCOLOR)),RPTUI_ID_BRUSH));
+ }
+ }
+
+ { // want the dialog to be destroyed before our set
+ ORptPageDialog aDlg(getView(), pDescriptor.get(),_xSection.is() ? RID_PAGEDIALOG_BACKGROUND : RID_PAGEDIALOG_PAGE);
+ if (RET_OK == aDlg.Execute())
+ {
+ // ------------
+ // ItemSet->UNO
+ // UNO-properties
+ const SfxItemSet* pSet = aDlg.GetOutputItemSet();
+ if ( _xSection.is() )
+ {
+ const SfxPoolItem* pItem;
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_BRUSH,sal_True,&pItem))
+ _xSection->setBackColor(static_cast<const SvxBrushItem*>(pItem)->GetColor().GetColor());
+ }
+ else
+ {
+ const String sUndoAction(String(ModuleRes(RID_STR_UNDO_CHANGEPAGE)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+ const SfxPoolItem* pItem = NULL;
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_SIZE,sal_True,&pItem))
+ {
+ const Size aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
+ //view::PaperFormat eUnoPaperFormat = lcl_convertPaperFormat(SvxPaperInfo::GetSvxPaper(aPaperSize,MAP_100TH_MM,TRUE));
+ //m_xReportDefinition->setPaperFormat(eUnoPaperFormat);
+ setStyleProperty(m_xReportDefinition,PROPERTY_PAPERSIZE,AWTSize(aPaperSize));
+ }
+
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_LRSPACE,sal_True,&pItem))
+ {
+ setStyleProperty(m_xReportDefinition,PROPERTY_LEFTMARGIN,static_cast<const SvxLRSpaceItem*>(pItem)->GetLeft());
+ setStyleProperty(m_xReportDefinition,PROPERTY_RIGHTMARGIN,static_cast<const SvxLRSpaceItem*>(pItem)->GetRight());
+ }
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_ULSPACE,sal_True,&pItem))
+ {
+ setStyleProperty(m_xReportDefinition,PROPERTY_TOPMARGIN,static_cast<const SvxULSpaceItem*>(pItem)->GetUpper());
+ setStyleProperty(m_xReportDefinition,PROPERTY_BOTTOMMARGIN,static_cast<const SvxULSpaceItem*>(pItem)->GetLower());
+ }
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_PAGE,sal_True,&pItem))
+ {
+ const SvxPageItem* pPageItem = static_cast<const SvxPageItem*>(pItem);
+ setStyleProperty(m_xReportDefinition,PROPERTY_ISLANDSCAPE,static_cast<sal_Bool>(pPageItem->IsLandscape()));
+ setStyleProperty(m_xReportDefinition,PROPERTY_NUMBERINGTYPE,static_cast<sal_Int16>(pPageItem->GetNumType()));
+ }
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_BRUSH,sal_True,&pItem))
+ {
+ ::Color aBackColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
+ setStyleProperty(m_xReportDefinition,PROPERTY_BACKTRANSPARENT,aBackColor == COL_TRANSPARENT);
+ setStyleProperty(m_xReportDefinition,PROPERTY_BACKCOLOR,aBackColor.GetColor());
+ }
+ getUndoMgr()->LeaveListAction();
+ }
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+ delete pDefaults[i];
+
+}
+// -----------------------------------------------------------------------------
+sal_Bool SAL_CALL OReportController::attachModel(const uno::Reference< frame::XModel > & xModel) throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ m_xReportDefinition.set(xModel,uno::UNO_QUERY);
+ return m_xReportDefinition.is();
+}
+// -----------------------------------------------------------------------------
+void OReportController::openSortingAndGroupingDialog()
+{
+ if ( !m_xReportDefinition.is() )
+ return;
+ if ( !m_pGroupsFloater )
+ {
+ m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this);
+ m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl));
+ }
+ else
+ m_pGroupsFloater->Show(!m_pGroupsFloater->IsVisible());
+}
+// -----------------------------------------------------------------------------
+sal_Int32 OReportController::getGroupPosition(const uno::Reference< report::XGroup >& _xGroup)
+{
+ return rptui::getPositionInIndexAccess(m_xReportDefinition->getGroups().get(),_xGroup);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, EventLstHdl, VclWindowEvent*, _pEvent )
+{
+ if ( _pEvent && _pEvent->GetId() == VCLEVENT_WINDOW_CLOSE )
+ {
+ InvalidateFeature(SID_SORTINGANDGROUPING);
+ InvalidateFeature(SID_FM_ADD_FIELD);
+ InvalidateFeature(SID_RPT_SHOWREPORTEXPLORER);
+ }
+ return 1L;
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const uno::Reference< report::XReportControlFormat>& _xReportControlFormat) const
+{
+ sal_Bool bRet = sal_False;
+ if ( _xReportControlFormat.is() )
+ {
+ try
+ {
+ const awt::FontDescriptor aFontDescriptor = _xReportControlFormat->getFontDescriptor();
+
+ switch(_nCommand)
+ {
+ case SID_ATTR_CHAR_WEIGHT:
+ bRet = awt::FontWeight::BOLD == aFontDescriptor.Weight;
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ bRet = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ bRet = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
+ break;
+ default:
+ ;
+ } // switch(_nCommand)
+ }
+ catch(uno::Exception&)
+ {
+ }
+ }
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+void OReportController::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
+{
+ if (rHint.ISA(DlgEdHint)
+ && (static_cast< DlgEdHint const & >(rHint).GetKind()
+ == RPTUI_HINT_SELECTIONCHANGED))
+ {
+ InvalidateAll();
+ lang::EventObject aEvent(*this);
+ m_aSelectionListeners.forEach<view::XSelectionChangeListener>(
+ ::boost::bind(&view::XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent)));
+
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun)
+{
+ const String sComment = String((ModuleRes(_nUndoStrId)));
+ m_aUndoManager.EnterListAction(sComment,String());
+ _pMemfun(m_pMyOwnView);
+ m_aUndoManager.LeaveListAction();
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+}
+// -----------------------------------------------------------------------------
+void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection)
+{
+ const String sComment = String((ModuleRes(_nUndoStrId)));
+ m_aUndoManager.EnterListAction(sComment,String());
+ m_pMyOwnView->alignMarkedObjects(_nControlModification,_bAlignAtSection);
+ m_aUndoManager.LeaveListAction();
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ typedef ::std::pair< ::rtl::OUString,sal_uInt16> TStringIntPair;
+ const TStringIntPair pViewDataList[] =
+ {
+ TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridVisible")), SID_GRID_VISIBLE)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridUse")), SID_GRID_USE)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelplinesMove")), SID_HELPLINES_MOVE)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRuler")), SID_RULER)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlProperties")), SID_SHOW_PROPERTYBROWSER)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LastPropertyBrowserPage")),SID_PROPERTYBROWSER_LAST_PAGE)
+ ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitPosition")), SID_SPLIT_POSITION)
+ };
+
+ uno::Sequence<beans::PropertyValue> aCommandProps(sizeof(pViewDataList)/sizeof(pViewDataList[0]));
+ beans::PropertyValue* pIter = aCommandProps.getArray();
+ beans::PropertyValue* pEnd = pIter + aCommandProps.getLength();
+ for (sal_Int32 i = 0; pIter != pEnd; ++pIter,++i)
+ {
+ FeatureState aFeatureState = GetState(pViewDataList[i].second);
+ pIter->Name = pViewDataList[i].first;
+ if ( !!aFeatureState.bChecked )
+ pIter->Value <<= (*aFeatureState.bChecked) ? sal_True : sal_False;
+ else if ( aFeatureState.aValue.hasValue() )
+ pIter->Value = aFeatureState.aValue;
+
+ } // for (; pIter != pEnd; ++pIter)
+
+ uno::Sequence<beans::PropertyValue> aProps(1);
+ aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties"));
+ aProps[0].Value <<= aCommandProps;
+
+ if ( m_pMyOwnView )
+ {
+ ::std::vector<sal_uInt16> aCollapsedPositions;
+ m_pMyOwnView->fillCollapsedSections(aCollapsedPositions);
+ if ( !aCollapsedPositions.empty() )
+ {
+ uno::Sequence<beans::PropertyValue> aCollapsedSections(aCollapsedPositions.size());
+ beans::PropertyValue* pCollapsedIter = aCollapsedSections.getArray();
+ ::std::vector<sal_uInt16>::iterator aIter = aCollapsedPositions.begin();
+ ::std::vector<sal_uInt16>::iterator aEnd = aCollapsedPositions.end();
+ for (sal_Int32 i = 1; aIter != aEnd ; ++aIter,++pCollapsedIter,++i)
+ {
+ pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i);
+ pCollapsedIter->Value <<= static_cast<sal_Int32>(*aIter);
+ }
+ const sal_Int32 nCount = aProps.getLength();
+ aProps.realloc( nCount + 1 );
+ aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CollapsedSections"));
+ aProps[nCount].Value <<= aCollapsedSections;
+ }
+
+ ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection();
+ if ( pSection.get() )
+ {
+ const sal_Int32 nCount = aProps.getLength();
+ aProps.realloc( nCount + 1 );
+ aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection"));
+ aProps[nCount].Value <<= (sal_Int32)pSection->getPage()->GetPageNum();
+ }
+ }
+ return uno::makeAny(aProps);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ uno::Sequence<beans::PropertyValue> aProps;
+ if ( Data >>= aProps )
+ {
+ const beans::PropertyValue* pPropsIter = aProps.getConstArray();
+ const beans::PropertyValue* pPropsEnd = pPropsIter + aProps.getLength();
+ for (sal_Int32 i = 0; pPropsIter != pPropsEnd; ++pPropsIter,++i)
+ {
+ if ( pPropsIter->Name.equalsAscii("CommandProperties") )
+ {
+ util::URL aCommand;
+ uno::Sequence< beans::PropertyValue> aArgs(1);
+ beans::PropertyValue* pArg = aArgs.getArray();
+ pArg->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value"));
+ uno::Sequence< beans::PropertyValue> aCommandProps;
+ if ( pPropsIter->Value >>= aCommandProps )
+ {
+ const beans::PropertyValue* pIter = aCommandProps.getConstArray();
+ const beans::PropertyValue* pEnd = pIter + aCommandProps.getLength();
+ for (; pIter != pEnd; ++pIter)
+ {
+ pArg->Value = pIter->Value;
+ if ( pArg->Value.hasValue() )
+ {
+ aCommand.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:")) + pIter->Name;
+ executeUnChecked(aCommand,aArgs);
+ }
+ }
+ }
+ }
+ else if ( pPropsIter->Name.equalsAscii("CollapsedSections") )
+ pPropsIter->Value >>= m_aCollapsedSections;
+ else if ( pPropsIter->Name.equalsAscii("MarkedSection") )
+ pPropsIter->Value >>= m_nPageNum;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::updateFloater()
+{
+ if ( m_pGroupsFloater && m_pGroupsFloater->IsVisible() )
+ m_pGroupsFloater->UpdateData();
+}
+
+// -----------------------------------------------------------------------------
+Reference<XFrame> OReportController::getXFrame()
+{
+ if ( !m_xFrameLoader.is() )
+ {
+ m_xFrameLoader.set(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),uno::UNO_QUERY_THROW);
+ }
+ const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
+ const ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank"));
+ Reference<XFrame> xFrame = Reference<XFrame>(m_xFrameLoader,uno::UNO_QUERY_THROW)->findFrame(sTarget,nFrameSearchFlag);
+ return xFrame;
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference<frame::XModel> OReportController::executeReport()
+{
+ uno::Reference<frame::XModel> xModel;
+ if ( m_xReportDefinition.is() )
+ {
+ dbtools::SQLExceptionInfo aInfo;
+ try
+ {
+ WaitObject aWait(getView()); // cursor
+ if ( !m_xReportEngine.is() )
+ m_xReportEngine.set(getORB()->createInstance(SERVICE_REPORTENGINE),uno::UNO_QUERY_THROW);
+ m_xReportEngine->setReportDefinition(m_xReportDefinition);
+ m_xReportEngine->setActiveConnection(getConnection());
+ // if ( !m_xFrameLoader.is() )
+ // m_xFrameLoader.set(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),uno::UNO_QUERY_THROW);
+ // const sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
+ // const ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank"));
+ // Reference<XFrame> xFrame = Reference<XFrame>(m_xFrameLoader,uno::UNO_QUERY_THROW)->findFrame(sTarget,nFrameSearchFlag);
+ Reference<XFrame> xFrame = getXFrame();
+ xModel = m_xReportEngine->createDocumentAlive(xFrame);
+ }
+ catch( const sdbc::SQLException& /*e*/ )
+ { // SQLExceptions and derived exceptions must not be translated
+ aInfo = ::cppu::getCaughtException();
+ }
+ catch(const uno::Exception& e)
+ {
+ uno::Any aCaughtException( ::cppu::getCaughtException() );
+
+ // our first message says: we caught an exception
+ sdb::SQLContext aFirstMessage;
+ String sInfo = String( ModuleRes( RID_STR_CAUGHT_FOREIGN_EXCEPTION ) );
+ sInfo.SearchAndReplaceAllAscii( "$type$", aCaughtException.getValueTypeName() );
+ aFirstMessage.Message = sInfo;
+
+ // our second message: the message of the exception we caught
+ sdbc::SQLException aSecondMessage;
+ aSecondMessage.Message = e.Message;
+ aSecondMessage.Context = e.Context;
+
+ // maybe our third message: the message which is wrapped in the exception we caught
+ sdbc::SQLException aThirdMessage;
+ lang::WrappedTargetException aWrapped;
+ if ( aCaughtException >>= aWrapped )
+ {
+ aThirdMessage.Message = aWrapped.Message;
+ aThirdMessage.Context = aWrapped.Context;
+ }
+
+ if ( aThirdMessage.Message.getLength() )
+ aSecondMessage.NextException <<= aThirdMessage;
+ aFirstMessage.NextException <<= aSecondMessage;
+
+ aInfo = aFirstMessage;
+ }
+
+ if (aInfo.isValid())
+ {
+ const String suSQLContext = String( ModuleRes( RID_STR_COULD_NOT_CREATE_REPORT ) );
+ aInfo.prepend(suSQLContext);
+ showError(aInfo);
+ }
+ }
+ return xModel;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XModel > SAL_CALL OReportController::getModel(void) throw( uno::RuntimeException )
+{
+ return m_xReportDefinition.get();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sdbc::XRowSet > OReportController::getRowSet()
+{
+ OSL_PRECOND( m_xReportDefinition.is(), "OReportController::getRowSet: no report definition?!" );
+
+ if ( m_xRowSet.is() || !m_xReportDefinition.is() )
+ return m_xRowSet;
+
+ try
+ {
+ uno::Reference< sdbc::XRowSet > xRowSet( getORB()->createInstance(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.RowSet" ) ) ), uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet> xRowSetProp( xRowSet, uno::UNO_QUERY_THROW );
+
+ xRowSetProp->setPropertyValue( PROPERTY_ACTIVECONNECTION, uno::makeAny( getConnection() ) );
+ xRowSetProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ApplyFilter" ) ), uno::makeAny( sal_True ) );
+
+ TPropertyNamePair aPropertyMediation;
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_COMMAND, PROPERTY_COMMAND ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_COMMANDTYPE, PROPERTY_COMMANDTYPE ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_ESCAPEPROCESSING, PROPERTY_ESCAPEPROCESSING ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_FILTER, PROPERTY_FILTER ) );
+
+ m_xRowSetMediator = new OPropertyMediator( m_xReportDefinition.get(), xRowSetProp, aPropertyMediation );
+ m_xRowSet = xRowSet;
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ return m_xRowSet;
+}
+// -----------------------------------------------------------------------------
+void OReportController::insertGraphic()
+{
+ const String sTitle(ModuleRes(RID_STR_IMPORT_GRAPHIC));
+ // build some arguments for the upcoming dialog
+ try
+ {
+ uno::Reference< report::XSection> xSection = m_pMyOwnView->getCurrentSection();
+ ::sfx2::FileDialogHelper aDialog( ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, SFXWB_GRAPHIC );
+ aDialog.SetTitle( sTitle );
+
+ uno::Reference< ui::dialogs::XFilePickerControlAccess > xController(aDialog.GetFilePicker(), UNO_QUERY_THROW);
+ xController->setValue(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, ::cppu::bool2any(sal_True));
+ xController->enableControl(ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, sal_False);
+ xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, ::cppu::bool2any( sal_True ) );
+
+ if ( ERRCODE_NONE == aDialog.Execute() )
+ {
+ uno::Sequence<beans::PropertyValue> aArgs(1);
+ aArgs[0].Name = PROPERTY_IMAGEURL;
+ aArgs[0].Value <<= ::rtl::OUString(aDialog.GetPath());
+ createControl(aArgs,xSection,::rtl::OUString(),OBJ_DLG_IMAGECONTROL);
+ }
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::displayDesignFloater(sal_Bool _bShow)
+{
+ if ( m_pGroupsFloater )
+ {
+ m_pGroupsFloater->Show( m_bGroupFloaterWasVisible && _bShow);
+ }
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel()
+{
+ if ( !m_aReportModel )
+ {
+ m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition);
+ if ( m_aReportModel )
+ {
+ m_aReportModel->attachController( *this );
+ m_aReportModel->SetNotifyUndoActionHdl(LINK( this, OReportController, NotifyUndoActionHdl ));
+ }
+ }
+ return m_aReportModel;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportController::select( const Any& aSelection ) throw (IllegalArgumentException, RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::sal_Bool bRet = sal_True;
+ if ( m_pMyOwnView )
+ {
+ m_pMyOwnView->unmarkAllObjects(NULL);
+ m_pMyOwnView->SetMode(RPTUI_SELECT);
+
+ uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
+ if ( aSelection >>= aElements )
+ {
+ if ( aElements.getLength() > 0 )
+ m_pMyOwnView->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
+ m_pMyOwnView->setMarked(aElements,sal_True);
+ }
+ else
+ {
+ uno::Reference<uno::XInterface> xObject(aSelection,uno::UNO_QUERY);
+ uno::Reference<report::XReportComponent> xProp(xObject,uno::UNO_QUERY);
+ if ( xProp.is() )
+ {
+ m_pMyOwnView->showProperties(xObject);
+ aElements.realloc(1);
+ aElements[0] = xProp;
+ m_pMyOwnView->setMarked(aElements,sal_True);
+ }
+ else
+ {
+ uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
+ if ( !xSection.is() && xObject.is() )
+ m_pMyOwnView->showProperties(xObject);
+ m_pMyOwnView->setMarked(xSection,xSection.is());
+ }
+ }
+ InvalidateAll();
+ }
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+Any SAL_CALL OReportController::getSelection( ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ Any aRet;
+ if ( m_pMyOwnView )
+ {
+ aRet = m_pMyOwnView->getCurrentlyShownProperty();
+ if ( !aRet.hasValue() )
+ aRet <<= m_pMyOwnView->getCurrentSection();
+ }
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+void OReportController::createNewFunction(const uno::Any& _aValue)
+{
+ uno::Reference< container::XIndexContainer> xFunctions(_aValue,uno::UNO_QUERY_THROW);
+ const ::rtl::OUString sNewName = String(ModuleRes(RID_STR_FUNCTION));
+ uno::Reference< report::XFunction> xFunction(report::Function::create(m_xContext));
+ xFunction->setName(sNewName);
+ // the call below will also create an undo action -> listener
+ xFunctions->insertByIndex(xFunctions->getCount(),uno::makeAny(xFunction));
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnExecuteReport, void* ,/*_pMemfun*/)
+{
+ //m_nExecuteReportEvent = 0;
+ executeReport();
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnSave, void* ,/*_pMemfun*/)
+{
+ //m_nExecuteReportEvent = 0;
+ doSaveDoc(sal_False);
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnSaveAs, void* ,/*_pMemfun*/)
+{
+ //m_nExecuteReportEvent = 0;
+ doSaveDoc(sal_True);
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const ::rtl::OUString& _sFunction,sal_uInt16 _nObjectId)
+{
+ SequenceAsHashMap aMap(_aArgs);
+ m_pMyOwnView->setMarked(_xSection ,sal_True);
+ ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection();
+ if ( !pReportSection )
+ return;
+
+ OSL_ENSURE(pReportSection->getSection() == _xSection,"Invalid section after marking the corrct one.");
+
+ sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN);
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE).Width - nRightMargin;
+ awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION,awt::Point(nLeftMargin,0));
+ if ( aPos.X < nLeftMargin )
+ aPos.X = nLeftMargin;
+
+ SdrUnoObj* pLabel,*pControl;
+ FmFormView::createControlLabelPair(NULL,m_pMyOwnView
+ ,nLeftMargin,0
+ ,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
+ NULL,pReportSection->getPage(),m_aReportModel.get(),
+ pLabel,pControl);
+
+ delete pLabel;
+
+ OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl);
+ uno::Reference<beans::XPropertySet> xUnoProp(pObj->GetUnoControlModel(),uno::UNO_QUERY);
+ uno::Reference< report::XReportComponent> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY);
+ xUnoProp->setPropertyValue(PROPERTY_NAME,xShapeProp->getPropertyValue(PROPERTY_NAME));
+
+ uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
+ if ( xInfo->hasPropertyByName(PROPERTY_FONTDESCRIPTOR) )
+ xUnoProp->setPropertyValue(PROPERTY_FONTDESCRIPTOR,xShapeProp->getPropertyValue(PROPERTY_FONTDESCRIPTOR));
+ if ( xInfo->hasPropertyByName(PROPERTY_BORDER) )
+ xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER));
+ if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) )
+ {
+ ReportFormula aFunctionFormula( ReportFormula::Expression, _sFunction );
+ xUnoProp->setPropertyValue( PROPERTY_DATAFIELD, uno::makeAny( aFunctionFormula.getCompleteFormula() ) );
+ }
+ sal_Int32 nFormatKey = aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEY,sal_Int32(0));
+ if ( nFormatKey && xInfo->hasPropertyByName(PROPERTY_FORMATKEY) )
+ xUnoProp->setPropertyValue( PROPERTY_FORMATKEY, uno::makeAny( nFormatKey ) );
+
+ ::rtl::OUString sUrl = aMap.getUnpackedValueOrDefault(PROPERTY_IMAGEURL,::rtl::OUString());
+ if ( sUrl.getLength() && xInfo->hasPropertyByName(PROPERTY_IMAGEURL) )
+ xUnoProp->setPropertyValue( PROPERTY_IMAGEURL, uno::makeAny( sUrl ) );
+
+ pObj->CreateMediator(sal_True);
+ const sal_Int32 nShapeWidth = xShapeProp->getWidth();
+ const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
+ if ( bChangedPos )
+ aPos.X = nPaperWidth - nShapeWidth;
+ xShapeProp->setPosition(aPos);
+
+ lcl_correctOverlapping(pControl,pReportSection);
+}
+// -----------------------------------------------------------------------------
+void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
+{
+ m_pMyOwnView->unmarkAllObjects(NULL);
+
+ const String sUndoAction(String(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ SequenceAsHashMap aMap(_aArgs);
+ aMap.createItemIfMissing(PROPERTY_FORMATKEY,aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE,sal_Int32(0)));
+
+ uno::Reference< report::XSection> xSection = aMap.getUnpackedValueOrDefault(PROPERTY_SECTION,uno::Reference< report::XSection>());
+ ::rtl::OUString sFunction(RTL_CONSTASCII_USTRINGPARAM("TODAY()"));
+ createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
+ sal_Bool bTime = aMap.getUnpackedValueOrDefault(PROPERTY_STATE,sal_False);
+ if ( bTime )
+ {
+ sFunction = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("NOW()"));
+ aMap[PROPERTY_FORMATKEY] <<= aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYTIME,sal_Int32(0));
+ createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
+ }
+
+ getUndoMgr()->LeaveListAction();
+}
+// -----------------------------------------------------------------------------
+void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs)
+{
+ m_pMyOwnView->unmarkAllObjects(NULL);
+
+ const String sUndoAction(String(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ if ( !m_xReportDefinition->getPageHeaderOn() )
+ {
+ uno::Sequence< beans::PropertyValue > aArgs;
+ executeChecked(SID_PAGEHEADERFOOTER,aArgs);
+ } // if ( !m_xHoldAlive->getPageHeaderOn() )
+
+ SequenceAsHashMap aMap(_aArgs);
+ sal_Bool bStateOfPage = aMap.getUnpackedValueOrDefault(PROPERTY_STATE,sal_False);
+
+ String sFunction = String(ModuleRes(STR_RPT_PN_PAGE));
+ ::rtl::OUString sPageNumber(RTL_CONSTASCII_USTRINGPARAM("PageNumber()"));
+ sFunction.SearchAndReplace(String::CreateFromAscii("#PAGENUMBER#"),sPageNumber);
+
+ if ( bStateOfPage )
+ {
+ ::rtl::OUString sPageCount(RTL_CONSTASCII_USTRINGPARAM("PageCount()"));
+ sFunction += String(ModuleRes(STR_RPT_PN_PAGE_OF));
+ sFunction.SearchAndReplace(String::CreateFromAscii("#PAGECOUNT#"),sPageCount);
+ }
+
+ sal_Bool bInPageHeader = aMap.getUnpackedValueOrDefault(PROPERTY_PAGEHEADERON,sal_True);
+ createControl(_aArgs,bInPageHeader ? m_xReportDefinition->getPageHeader() : m_xReportDefinition->getPageFooter(),sFunction);
+
+ getUndoMgr()->LeaveListAction();
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
+{
+ m_pMyOwnView->unmarkAllObjects(NULL);
+ //////////////////////////////////////////////////////////////////////
+ // Anhand des FormatKeys wird festgestellt, welches Feld benoetigt wird
+ ::boost::shared_ptr<OReportSection> pReportSection[2];
+ pReportSection[0] = m_pMyOwnView->getMarkedSection();
+
+ if ( !pReportSection[0].get() )
+ return;
+
+ uno::Reference<report::XSection> xCurrentSection = m_pMyOwnView->getCurrentSection();
+ UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) );
+
+ try
+ {
+ bool bHandleOnlyOne = false;
+ const PropertyValue* pIter = aArgs.getConstArray();
+ const PropertyValue* pEnd = pIter + aArgs.getLength();
+ for(;pIter != pEnd && !bHandleOnlyOne;++pIter)
+ {
+ Sequence< PropertyValue > aValue;
+ if ( !(pIter->Value >>= aValue) )
+ { // the sequence has only one element which already contains the descriptor
+ bHandleOnlyOne = true;
+ aValue = aArgs;
+ }
+ ::svx::ODataAccessDescriptor aDescriptor(aValue);
+ SequenceAsHashMap aMap(aValue);
+ uno::Reference<report::XSection> xSection = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section")),xCurrentSection);
+ uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+
+ m_pMyOwnView->setMarked(xSection,sal_True);
+ pReportSection[0] = m_pMyOwnView->getMarkedSection();
+
+ sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN);
+ awt::Point aPos = aMap.getUnpackedValueOrDefault(PROPERTY_POSITION,awt::Point(nLeftMargin,0));
+ if ( aPos.X < nLeftMargin )
+ aPos.X = nLeftMargin;
+
+ // LLA: new feature, add the Label in dependency of the given DND_ACTION one section up, normal or one section down
+ sal_Int8 nDNDAction = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction")), sal_Int8(0));
+ pReportSection[1] = pReportSection[0];
+ // ::boost::shared_ptr<OReportSection> pReportSectionPost;
+ sal_Bool bLabelAboveTextField = nDNDAction == DND_ACTION_COPY;
+ if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINK )
+ {
+ // Add the Label one Section up
+ pReportSection[1] = m_pMyOwnView->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST);
+ if (!pReportSection[1].get())
+ {
+ // maybe out of bounds
+ pReportSection[1] = pReportSection[0];
+ }
+ }
+ // clear all selections
+ m_pMyOwnView->unmarkAllObjects(NULL);
+
+ uno::Reference< beans::XPropertySet > xField( aDescriptor[ ::svx::daColumnObject ], uno::UNO_QUERY );
+ uno::Reference< lang::XComponent > xHoldAlive;
+ if ( !xField.is() )
+ {
+ ::rtl::OUString sCommand;
+ ::rtl::OUString sColumnName;
+ sal_Int32 nCommandType( -1 );
+ OSL_VERIFY( aDescriptor[ ::svx::daCommand ] >>= sCommand );
+ OSL_VERIFY( aDescriptor[ ::svx::daColumnName ] >>= sColumnName );
+ OSL_VERIFY( aDescriptor[ ::svx::daCommandType ] >>= nCommandType );
+
+ uno::Reference< container::XNameAccess > xColumns;
+ uno::Reference< sdbc::XConnection > xConnection( getConnection() );
+ if ( sCommand.getLength() && nCommandType != -1 && sColumnName.getLength() && xConnection.is() )
+ {
+ if ( !xReportDefinition->getCommand().getLength() )
+ {
+ xReportDefinition->setCommand(sCommand);
+ xReportDefinition->setCommandType(nCommandType);
+ } // if ( !xReportDefinition->getCommand().getLength() )
+
+ xColumns = dbtools::getFieldsByCommandDescriptor(xConnection,nCommandType,sCommand,xHoldAlive);
+ if ( xColumns.is() && xColumns->hasByName(sColumnName) )
+ xField.set( xColumns->getByName( sColumnName ), uno::UNO_QUERY );
+ }
+
+ if ( !xField.is() )
+ {
+ #if OSL_DEBUG_LEVEL > 0
+ try
+ {
+ uno::Reference< beans::XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW );
+ ::rtl::OUString sRowSetCommand;
+ sal_Int32 nRowSetCommandType( -1 );
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sRowSetCommand );
+ OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nRowSetCommandType );
+ OSL_ENSURE( ( sRowSetCommand == sCommand ) && ( nCommandType == nRowSetCommandType ),
+ "OReportController::addPairControls: this only works for a data source which equals our current settings!" );
+ // if this asserts, then either our row set and our report definition are not in sync, or somebody
+ // requested the creation of a control/pair for another data source than what our report
+ // definition is bound to - which is not supported for the parameters case, since we
+ // can retrieve parameters from the RowSet only.
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ #endif
+
+ // no column name - perhaps a parameter name?
+ uno::Reference< sdb::XParametersSupplier > xSuppParam( getRowSet(), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexAccess > xParams( xSuppParam->getParameters(), uno::UNO_QUERY_THROW );
+ sal_Int32 nParamCount( xParams->getCount() );
+ for ( sal_Int32 i=0; i<nParamCount; ++i)
+ {
+ uno::Reference< beans::XPropertySet > xParamCol( xParams->getByIndex(i), uno::UNO_QUERY_THROW );
+ ::rtl::OUString sParamName;
+ OSL_VERIFY( xParamCol->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Name" ) ) ) >>= sParamName );
+ if ( sParamName == sColumnName )
+ {
+ xField = xParamCol;
+ break;
+ }
+ }
+ }
+ }
+ if ( !xField.is() )
+ continue;
+
+ sal_uInt16 nOBJID = 0;
+ sal_Int32 nDataType = sdbc::DataType::BINARY;
+ xField->getPropertyValue(PROPERTY_TYPE) >>= nDataType;
+ switch ( nDataType )
+ {
+ case sdbc::DataType::BINARY:
+ case sdbc::DataType::VARBINARY:
+ case sdbc::DataType::LONGVARBINARY:
+ nOBJID = OBJ_DLG_IMAGECONTROL;
+ break;
+ default:
+ nOBJID = OBJ_DLG_FORMATTEDFIELD;
+ break;
+ }
+
+ if ( !nOBJID )
+ continue;
+
+ Reference< util::XNumberFormatsSupplier > xSupplier = getNumberFormatter()->getNumberFormatsSupplier();
+ if ( !xSupplier.is() )
+ continue;
+
+ Reference< XNumberFormats > xNumberFormats(xSupplier->getNumberFormats());
+ SdrUnoObj* pControl[2];
+ pControl[0] = NULL;
+ pControl[1] = NULL;
+ //m_pMyOwnView->GetModel()->GetUndoEnv().Lock();
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN);
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE).Width - nRightMargin;
+ OSectionView* pSectionViews[2];
+ pSectionViews[0] = pReportSection[1]->getView();
+ pSectionViews[1] = pReportSection[0]->getView();
+ // find this in svx
+ FmFormView::createControlLabelPair(pSectionViews[0],m_pMyOwnView
+ ,nLeftMargin,0
+ ,xField,xNumberFormats,nOBJID,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
+ pReportSection[1]->getPage(),pReportSection[0]->getPage(),m_aReportModel.get(),
+ pControl[0],pControl[1]);
+ //m_pMyOwnView->GetModel()->GetUndoEnv().UnLock();
+ if ( pControl[0] && pControl[1] )
+ {
+ SdrPageView* pPgViews[2];
+ pPgViews[0] = pSectionViews[0]->GetSdrPageView();
+ pPgViews[1] = pSectionViews[1]->GetSdrPageView();
+ if ( pPgViews[0] && pPgViews[1] )
+ {
+ ::rtl::OUString sDefaultName;
+ size_t i = 0;
+ OUnoObject* pObjs[2];
+ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
+ {
+ pObjs[i] = dynamic_cast<OUnoObject*>(pControl[i]);
+ uno::Reference<beans::XPropertySet> xUnoProp(pObjs[i]->GetUnoControlModel(),uno::UNO_QUERY);
+ uno::Reference< report::XReportComponent> xShapeProp(pObjs[i]->getUnoShape(),uno::UNO_QUERY);
+ xUnoProp->setPropertyValue(PROPERTY_NAME,xShapeProp->getPropertyValue(PROPERTY_NAME));
+
+ uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
+ if ( xInfo->hasPropertyByName(PROPERTY_FONTDESCRIPTOR) )
+ xUnoProp->setPropertyValue(PROPERTY_FONTDESCRIPTOR,xShapeProp->getPropertyValue(PROPERTY_FONTDESCRIPTOR));
+ if ( xInfo->hasPropertyByName(PROPERTY_BORDER) )
+ xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER));
+ if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) )
+ {
+ ::rtl::OUString sName;
+ xUnoProp->getPropertyValue(PROPERTY_DATAFIELD) >>= sName;
+ sDefaultName = sName;
+ xUnoProp->setPropertyValue(PROPERTY_NAME,uno::makeAny(sDefaultName));
+
+ ReportFormula aFormula( ReportFormula::Field, sName );
+ xUnoProp->setPropertyValue( PROPERTY_DATAFIELD, uno::makeAny( aFormula.getCompleteFormula() ) );
+ }
+
+ pObjs[i]->CreateMediator(sal_True);
+ // need SectionView from the above or follow Section
+ // (getMarkedSection) returns the current Section
+ //pSectionViews[i]->InsertObjectAtView(pControl[i],*pPgViews[i],SDRINSERT_ADDMARK);
+
+ const sal_Int32 nShapeWidth = xShapeProp->getWidth();
+ const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
+ if ( bChangedPos )
+ aPos.X = nPaperWidth - nShapeWidth;
+ xShapeProp->setPosition(aPos);
+ if ( bChangedPos )
+ aPos.Y += xShapeProp->getHeight();
+ aPos.X += nShapeWidth;
+ }
+ if (pSectionViews[0] != pSectionViews[1] &&
+ nOBJID == OBJ_DLG_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD
+ {
+ // we have two different Views, so set the position x new.
+ // pSectionViews[1].position.x = pSectionViews[0].position.x
+ uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY);
+ uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY);
+ awt::Point aPosLabel = xShapePropLabel->getPosition();
+ awt::Point aPosTextField = xShapePropTextField->getPosition();
+ aPosTextField.X = aPosLabel.X;
+ xShapePropTextField->setPosition(aPosTextField);
+ if (bLabelAboveTextField)
+ {
+ // move the label down near the splitter
+ uno::Reference<report::XSection> xLabelSection = pReportSection[1]->getSection();
+ sal_Int32 nSectionHeight = xLabelSection->getHeight();
+ sal_Int32 nLabelHeight = xShapePropLabel->getHeight();
+ sal_Int32 nNewYPosition = nSectionHeight - nLabelHeight /* - 1 */;
+ aPosLabel.Y = nNewYPosition;
+ }
+ else
+ {
+ // move the label up to the splitter
+ aPosLabel.Y = 0;
+ }
+ xShapePropLabel->setPosition(aPosLabel);
+ }
+ OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl[0]);
+ uno::Reference< report::XReportComponent> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY);
+ xShapeProp->setName(xShapeProp->getName() + sDefaultName );
+
+ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
+ lcl_correctOverlapping(pControl[i],pReportSection[1-i]);
+ }
+ }
+ else
+ {
+ for(size_t i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i)
+ delete pControl[i];
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+OSectionView* OReportController::getCurrentSectionView() const
+{
+ OSectionView* pSectionView = NULL;
+ ::boost::shared_ptr<OReportSection> pReportSection = m_pMyOwnView->getMarkedSection();
+ if ( pReportSection.get() )
+ pSectionView = pReportSection->getView();
+ return pSectionView;
+}
+// -----------------------------------------------------------------------------
+void OReportController::changeZOrder(sal_Int32 _nId)
+{
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ {
+ switch(_nId)
+ {
+ case SID_FRAME_TO_TOP:
+ pSectionView->MovMarkedToTop();
+ break;
+ case SID_FRAME_DOWN:
+ break;
+ case SID_FRAME_UP:
+ break;
+ case SID_FRAME_TO_BOTTOM:
+ pSectionView->MovMarkedToBtm();
+ break;
+ case SID_OBJECT_HEAVEN:
+ pSectionView->PutMarkedToTop();
+ break;
+ case SID_OBJECT_HELL:
+ pSectionView->PutMarkedToBtm();
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::listen(const bool _bAdd)
+{
+ const ::rtl::OUString aProps [] = { PROPERTY_REPORTHEADERON,PROPERTY_REPORTFOOTERON
+ ,PROPERTY_PAGEHEADERON,PROPERTY_PAGEFOOTERON
+ ,PROPERTY_COMMAND, PROPERTY_COMMANDTYPE
+ };
+
+ void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const ::rtl::OUString&, const uno::Reference< XPropertyChangeListener >& ) =
+ _bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
+
+ for (size_t i = 0; i < sizeof(aProps)/sizeof(aProps[0]); ++i)
+ (m_xReportDefinition.get()->*pPropertyListenerAction)( aProps[i], static_cast< XPropertyChangeListener* >( this ) );
+
+ OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
+ uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv;
+ uno::Sequence< beans::Property> aSeq = m_xReportDefinition->getPropertySetInfo()->getProperties();
+ const beans::Property* pIter = aSeq.getConstArray();
+ const beans::Property* pEnd = pIter + aSeq.getLength();
+ const ::rtl::OUString* pPropsBegin = &aProps[0];
+ const ::rtl::OUString* pPropsEnd = pPropsBegin + (sizeof(aProps)/sizeof(aProps[0])) - 2;
+ for(;pIter != pEnd;++pIter)
+ {
+ if ( ::std::find(pPropsBegin,pPropsEnd,pIter->Name) == pPropsEnd )
+ (m_xReportDefinition.get()->*pPropertyListenerAction)( pIter->Name, xUndo );
+ }
+
+ void (OXUndoEnvironment::*pElementUndoFunction)( const uno::Reference< uno::XInterface >& ) =
+ _bAdd ? &OXUndoEnvironment::AddElement : &OXUndoEnvironment::RemoveElement;
+
+ (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getStyleFamilies() );
+ (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getFunctions() );
+
+ if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
+ m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER);
+ if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
+ m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
+
+ uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+ _bAdd ? xGroups->addContainerListener(&rUndoEnv) : xGroups->removeContainerListener(&rUndoEnv);
+
+ for (sal_Int32 i=0;i<nCount ; ++i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ (xGroup.get()->*pPropertyListenerAction)( PROPERTY_HEADERON, static_cast< XPropertyChangeListener* >( this ) );
+ (xGroup.get()->*pPropertyListenerAction)( PROPERTY_FOOTERON, static_cast< XPropertyChangeListener* >( this ) );
+
+ (rUndoEnv.*pElementUndoFunction)( xGroup );
+ (rUndoEnv.*pElementUndoFunction)( xGroup->getFunctions() );
+ if ( xGroup->getHeaderOn() && _bAdd )
+ m_pMyOwnView->addSection(xGroup->getHeader(),DBGROUPHEADER);
+ } // for (sal_Int32 i=0;i<nCount ; ++i)
+
+ if ( _bAdd )
+ m_pMyOwnView->addSection(m_xReportDefinition->getDetail(),DBDETAIL);
+
+ for (sal_Int32 i=0;i<nCount ; ++i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i),uno::UNO_QUERY);
+ if ( xGroup->getFooterOn() && _bAdd )
+ m_pMyOwnView->addSection(xGroup->getFooter(),DBGROUPFOOTER);
+ } // for (sal_Int32 i=0;i<nCount ; ++i)
+
+ if ( m_xReportDefinition->getReportFooterOn() && _bAdd )
+ m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
+ if ( m_xReportDefinition->getPageFooterOn() && _bAdd )
+ m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+
+ _bAdd ? xGroups->addContainerListener(static_cast<XContainerListener*>(this))
+ : xGroups->removeContainerListener(static_cast<XContainerListener*>(this));
+ _bAdd ? m_xReportDefinition->addModifyListener(static_cast<XModifyListener*>(this))
+ : m_xReportDefinition->removeModifyListener(static_cast<XModifyListener*>(this));
+
+ if ( !_bAdd )
+ m_aReportModel->detachController();
+}
+// -----------------------------------------------------------------------------
+void OReportController::switchReportSection(const sal_Int16 _nId)
+{
+ OSL_ENSURE(_nId == SID_REPORTHEADER_WITHOUT_UNDO || _nId == SID_REPORTFOOTER_WITHOUT_UNDO || _nId == SID_REPORTHEADERFOOTER ,"Illegal id given!");
+
+ if ( m_xReportDefinition.is() )
+ {
+ const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
+ if ( SID_REPORTHEADERFOOTER == _nId )
+ {
+ const String sUndoAction(String(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO
+ ,::std::mem_fun(&OReportHelper::getReportHeader)
+ ,m_xReportDefinition
+ ,bSwitchOn ? Inserted : Removed
+ ,0
+ ));
+
+ addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO
+ ,::std::mem_fun(&OReportHelper::getReportFooter)
+ ,m_xReportDefinition
+ ,bSwitchOn ? Inserted : Removed
+ ,0
+ ));
+ }
+
+ switch( _nId )
+ {
+ case SID_REPORTHEADER_WITHOUT_UNDO:
+ m_xReportDefinition->setReportHeaderOn( bSwitchOn );
+ break;
+ case SID_REPORTFOOTER_WITHOUT_UNDO:
+ m_xReportDefinition->setReportFooterOn( !m_xReportDefinition->getReportFooterOn() );
+ break;
+ case SID_REPORTHEADERFOOTER:
+ m_xReportDefinition->setReportHeaderOn( bSwitchOn );
+ m_xReportDefinition->setReportFooterOn( bSwitchOn );
+ break;
+ }
+
+ if ( SID_REPORTHEADERFOOTER == _nId )
+ getUndoMgr()->LeaveListAction();
+ getView()->Resize();
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::switchPageSection(const sal_Int16 _nId)
+{
+ OSL_ENSURE(_nId == SID_PAGEHEADERFOOTER || _nId == SID_PAGEHEADER_WITHOUT_UNDO || _nId == SID_PAGEFOOTER_WITHOUT_UNDO ,"Illegal id given!");
+ if ( m_xReportDefinition.is() )
+ {
+ const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
+
+ if ( SID_PAGEHEADERFOOTER == _nId )
+ {
+ const String sUndoAction(String(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)));
+ getUndoMgr()->EnterListAction( sUndoAction, String() );
+
+ addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel
+ ,SID_PAGEHEADER_WITHOUT_UNDO
+ ,::std::mem_fun(&OReportHelper::getPageHeader)
+ ,m_xReportDefinition
+ ,bSwitchOn ? Inserted : Removed
+ ,0
+ ));
+
+ addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel
+ ,SID_PAGEFOOTER_WITHOUT_UNDO
+ ,::std::mem_fun(&OReportHelper::getPageFooter)
+ ,m_xReportDefinition
+ ,bSwitchOn ? Inserted : Removed
+ ,0
+ ));
+ } // if ( SID_PAGEHEADERFOOTER == _nId )
+ switch( _nId )
+ {
+ case SID_PAGEHEADER_WITHOUT_UNDO:
+ m_xReportDefinition->setPageHeaderOn( bSwitchOn );
+ break;
+ case SID_PAGEFOOTER_WITHOUT_UNDO:
+ m_xReportDefinition->setPageFooterOn( !m_xReportDefinition->getPageFooterOn() );
+ break;
+ case SID_PAGEHEADERFOOTER:
+ m_xReportDefinition->setPageHeaderOn( bSwitchOn );
+ m_xReportDefinition->setPageFooterOn( bSwitchOn );
+ break;
+ }
+ if ( SID_PAGEHEADERFOOTER == _nId )
+ getUndoMgr()->LeaveListAction();
+ getView()->Resize();
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::modifyGroup(const bool _bAppend, const Sequence< PropertyValue >& _aArgs)
+{
+ if ( !m_xReportDefinition.is() )
+ return;
+
+ try
+ {
+ const SequenceAsHashMap aMap( _aArgs );
+ uno::Reference< report::XGroup > xGroup = aMap.getUnpackedValueOrDefault( PROPERTY_GROUP, uno::Reference< report::XGroup >() );
+ if ( !xGroup.is() )
+ return;
+
+ OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
+ uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
+ if ( _bAppend )
+ {
+ const sal_Int32 nPos = aMap.getUnpackedValueOrDefault( PROPERTY_POSITIONY, xGroups->getCount() );
+ xGroups->insertByIndex( nPos, uno::makeAny( xGroup ) );
+ rUndoEnv.AddElement( xGroup->getFunctions() );
+ }
+
+ addUndoActionAndInvalidate( new OGroupUndo(
+ *m_aReportModel,
+ _bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP,
+ _bAppend ? Inserted : Removed,
+ xGroup,
+ m_xReportDefinition
+ ) );
+
+ if ( !_bAppend )
+ {
+ rUndoEnv.RemoveElement( xGroup->getFunctions() );
+ const sal_Int32 nPos = getGroupPosition( xGroup );
+ const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
+ xGroups->removeByIndex( nPos );
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader, const Sequence< PropertyValue >& _aArgs)
+{
+ if ( m_xReportDefinition.is() )
+ {
+ const SequenceAsHashMap aMap(_aArgs);
+ const sal_Bool bSwitchOn = aMap.getUnpackedValueOrDefault(_bHeader ? PROPERTY_HEADERON : PROPERTY_FOOTERON,sal_False);
+ uno::Reference< report::XGroup> xGroup = aMap.getUnpackedValueOrDefault(PROPERTY_GROUP,uno::Reference< report::XGroup>());
+ if ( xGroup.is() )
+ {
+ const OXUndoEnvironment::OUndoEnvLock aLock(m_aReportModel->GetUndoEnv());
+ if ( _bUndo )
+ addUndoActionAndInvalidate(new OGroupSectionUndo(*m_aReportModel
+ ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO : SID_GROUPFOOTER_WITHOUT_UNDO
+ ,_bHeader ? ::std::mem_fun(&OGroupHelper::getHeader) : ::std::mem_fun(&OGroupHelper::getFooter)
+ ,xGroup
+ ,bSwitchOn ? Inserted : Removed
+ , ( _bHeader ?
+ (bSwitchOn ? RID_STR_UNDO_ADD_GROUP_HEADER : RID_STR_UNDO_REMOVE_GROUP_HEADER)
+ :(bSwitchOn ? RID_STR_UNDO_ADD_GROUP_FOOTER : RID_STR_UNDO_REMOVE_GROUP_FOOTER)
+ )
+ ));
+
+ if ( _bHeader )
+ xGroup->setHeaderOn( bSwitchOn );
+ else
+ xGroup->setFooterOn( bSwitchOn );
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::markSection(const bool _bNext)
+{
+ ::boost::shared_ptr<OReportSection> pSection = m_pMyOwnView->getMarkedSection();
+ if ( pSection )
+ {
+ ::boost::shared_ptr<OReportSection> pPrevSection = m_pMyOwnView->getMarkedSection(_bNext ? POST : PREVIOUS);
+ if ( pPrevSection != pSection && pPrevSection )
+ select(uno::makeAny(pPrevSection->getSection()));
+ else
+ select(uno::makeAny(m_xReportDefinition));
+ }
+ else
+ {
+ m_pMyOwnView->markSection(_bNext ? 0 : m_pMyOwnView->getSectionCount() - 1);
+ pSection = m_pMyOwnView->getMarkedSection();
+ if ( pSection )
+ select(uno::makeAny(pSection->getSection()));
+ }
+}
+
+
diff --git a/reportdesign/source/ui/report/ReportRuler.cxx b/reportdesign/source/ui/report/ReportRuler.cxx
new file mode 100644
index 000000000000..549c53e4e842
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportRuler.cxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportRuler.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_RULER_HXX
+#include "ReportRuler.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+namespace rptui
+{
+using namespace ::com::sun::star;
+DBG_NAME( rpt_OReportRuler )
+OReportRuler::OReportRuler(Window* _pParent,OReportWindow* _pReportWindow,const uno::Reference< report::XSection >& _xSection)
+:Window(_pParent)
+,m_pParent(_pReportWindow)
+{
+ DBG_CTOR( rpt_OReportRuler,NULL);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ Show();
+}
+//------------------------------------------------------------------------------
+OReportRuler::~OReportRuler()
+{
+ DBG_DTOR( rpt_OReportRuler,NULL);
+ delete m_pSection;
+}
+//------------------------------------------------------------------------------
+void OReportRuler::Resize()
+{
+ m_pSection->SetPosSizePixel(Point(0,0),GetOutputSize());
+}
+//------------------------------------------------------------------------------
+void OReportRuler::SetGridVisible(BOOL _bVisible)
+{
+ m_pSection->SetGridVisible( _bVisible );
+}
+//------------------------------------------------------------------------------
+//==============================================================================
+} // rptui
+//==============================================================================
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
new file mode 100644
index 000000000000..3e32762ad62a
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -0,0 +1,763 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportSection.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:32 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef REPORT_RPTMODEL_HXX
+#include "RptModel.hxx"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#include "UITools.hxx"
+#ifndef _SVDPAGV_HXX
+#include <svx/svdpagv.hxx>
+#endif
+#ifndef _EEITEMID_HXX
+#include <svx/eeitemid.hxx>
+#endif
+#ifndef _SVX_ADJITEM_HXX
+#include <svx/adjitem.hxx>
+#endif
+#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARD_HPP_
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#endif
+#include <toolkit/helper/convert.hxx>
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#include "ViewsWindow.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _REPORT_RPTUICLIP_HXX
+#include "dlgedclip.hxx"
+#endif
+#ifndef RPTUI_UNDOACTIONS_HXX
+#include "UndoActions.hxx"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef _SVX_DBAEXCHANGE_HXX_
+#include <svx/dbaexchange.hxx>
+#endif
+#ifndef _CONNECTIVITY_DBTOOLS_HXX_
+#include <connectivity/dbtools.hxx>
+#endif
+#ifndef _GALLERY_HXX_
+#include <svx/gallery.hxx>
+#endif
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#include <svx/unoshape.hxx>
+// =============================================================================
+namespace rptui
+{
+// =============================================================================
+using namespace ::com::sun::star;
+//------------------------------------------------------------------------------
+DBG_NAME( rpt_OReportSection )
+OReportSection::OReportSection(OViewsWindow* _pParent,const uno::Reference< report::XSection >& _xSection)
+: Window(_pParent,WB_DIALOGCONTROL)
+, ::comphelper::OPropertyChangeListener(m_aMutex)
+, DropTargetHelper(this)
+,m_pPage(NULL)
+,m_pView(NULL)
+,m_pParent(_pParent)
+,m_pFunc(NULL)
+,m_pMulti(NULL)
+,m_pReportListener(NULL)
+,m_xSection(_xSection)
+,m_eMode(RPTUI_SELECT)
+,m_bDialogModelChanged(FALSE)
+,m_bInDrag(sal_False)
+{
+ DBG_CTOR( rpt_OReportSection,NULL);
+ EnableChildTransparentMode();
+ SetUniqueId(HID_REPORTSECTION);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_pFunc.reset(new DlgEdFuncSelect( this ));
+ try
+ {
+ fill();
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched!");
+ }
+
+ Show();
+}
+//------------------------------------------------------------------------------
+OReportSection::~OReportSection()
+{
+ DBG_DTOR( rpt_OReportSection,NULL);
+ m_pPage = NULL;
+ //m_pModel->GetUndoEnv().RemoveSection(m_xSection.get());
+ if ( m_pMulti.is() )
+ m_pMulti->dispose();
+
+ if ( m_pReportListener.is() )
+ m_pReportListener->dispose();
+ m_pFunc = ::std::auto_ptr<DlgEdFunc>();
+
+ {
+ ::std::auto_ptr<OSectionView> aTemp( m_pView);
+ if ( m_pView )
+ m_pView->EndListening( *m_pModel );
+ m_pView = NULL;
+ }
+ /*m_pModel->DeletePage(m_pPage->GetPageNum());*/
+}
+//------------------------------------------------------------------------------
+void OReportSection::Paint( const Rectangle& rRect )
+{
+ if ( m_pView )
+ {
+ const Region aReg(rRect);
+ m_pView->CompleteRedraw(this,aReg);
+ }
+}
+//------------------------------------------------------------------------------
+void OReportSection::Resize()
+{
+ Window::Resize();
+ if ( m_xSection.is() && m_pPage && m_pView )
+ {
+ uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
+ m_pPage->SetSize( Size( getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,2*m_xSection->getHeight()) );
+ const Size aPageSize = m_pPage->GetSize();
+
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
+ // PixelToLogic(Size(0,m_pParent->getTotalHeight(this)) ).Height()
+ }
+}
+//------------------------------------------------------------------------------
+void OReportSection::fill()
+{
+ if ( !m_xSection.is() )
+ return;
+
+ m_pMulti = new comphelper::OPropertyChangeMultiplexer(this,m_xSection.get());
+ m_pMulti->addProperty(PROPERTY_BACKCOLOR);
+
+ m_pReportListener = addStyleListener(m_xSection->getReportDefinition(),this);
+
+ m_pModel = m_pParent->getView()->getReportView()->getController()->getSdrModel();
+ m_pPage = m_pModel->getPage(m_xSection);
+
+ m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getView() );
+
+ // without the following call, no grid is painted
+ m_pView->ShowSdrPage( m_pPage );
+
+ m_pView->SetMoveSnapOnlyTopLeft( TRUE );
+ ODesignView* pDesignView = m_pParent->getView()->getReportView();
+
+ Size aGridSize = pDesignView->getGridSize();
+ m_pView->SetGridCoarse( aGridSize );
+ Fraction aX(aGridSize.A());
+ Fraction aY(aGridSize.B());
+ m_pView->SetSnapGridWidth(aX,aY);
+ //m_pView->SetSnapGrid( pDesignView->getGridSize() );
+ m_pView->SetGridSnap( pDesignView->isGridSnap() );
+ m_pView->SetGridFront( FALSE );
+ m_pView->SetDragStripes( TRUE );
+ m_pView->SetPageVisible();
+ m_pView->SetApplicationDocumentColor(m_xSection->getBackColor());
+
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN);
+ m_pPage->SetLftBorder(nLeftMargin);
+ m_pPage->SetRgtBorder(nRightMargin);
+
+ m_pView->SetDesignMode( TRUE );
+
+ m_pView->StartListening( *m_pModel );
+ Resize();
+}
+// -----------------------------------------------------------------------------
+void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce)
+{
+ OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!");
+ if ( m_xSection.is() && _aAllreadyCopiedObjects.getLength() )
+ {
+ // stop all drawing actions
+ m_pView->BrkAction();
+
+ // unmark all objects
+ m_pView->UnmarkAll();
+ const ::rtl::OUString sSectionName = m_xSection->getName();
+ const sal_Int32 nLength = _aAllreadyCopiedObjects.getLength();
+ const beans::NamedValue* pIter = _aAllreadyCopiedObjects.getConstArray();
+ const beans::NamedValue* pEnd = pIter + nLength;
+ for(;pIter != pEnd;++pIter)
+ {
+ if ( _bForce || pIter->Name == sSectionName)
+ {
+ try
+ {
+ uno::Sequence< uno::Reference<util::XCloneable> > aCopies;
+ pIter->Value >>= aCopies;
+ const uno::Reference<util::XCloneable>* pCopiesIter = aCopies.getConstArray();
+ const uno::Reference<util::XCloneable>* pCopiesEnd = pCopiesIter + aCopies.getLength();
+ for (;pCopiesIter != pCopiesEnd ; ++pCopiesIter)
+ {
+ uno::Reference< report::XReportComponent> xComponent(*pCopiesIter,uno::UNO_QUERY_THROW);
+ uno::Reference< report::XReportComponent> xClone(xComponent->createClone(),uno::UNO_QUERY_THROW);
+ Rectangle aRet(VCLPoint(xClone->getPosition()),VCLSize(xClone->getSize()));
+ aRet.setHeight(aRet.getHeight() + 1);
+ aRet.setWidth(aRet.getWidth() + 1);
+ bool bOverlapping = true;
+ while ( bOverlapping )
+ {
+ bOverlapping = isOver(aRet,*m_pPage,*m_pView,true);
+ if ( bOverlapping )
+ {
+ aRet.Move(0,aRet.getHeight()+1);
+ xClone->setPositionY(aRet.Top());
+ }
+ }
+ if ( !bOverlapping )
+ {
+ m_xSection->add(xClone.get());
+ SvxShape* pShape = SvxShape::getImplementation( xClone );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ OSL_ENSURE( pObject, "OReportSection::Paste: no SdrObject for the shape!" );
+ if ( pObject )
+ {
+ m_pView->AddUndo( m_pView->GetModel()->GetSdrUndoFactory().CreateUndoNewObject( *pObject ) );
+ m_pView->MarkObj( pObject, m_pView->GetSdrPageView() );
+ }
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught while pasting a new object!");
+ }
+ if ( !_bForce )
+ break;
+ }
+ }
+ }
+}
+//----------------------------------------------------------------------------
+void OReportSection::Delete()
+{
+ if( !m_pView->AreObjectsMarked() )
+ return;
+
+ m_pView->BrkAction();
+ m_pView->DeleteMarked();
+}
+//----------------------------------------------------------------------------
+BOOL OReportSection::UnmarkDialog()
+{
+ SdrObject* pDlgObj = m_pPage->GetObj(0);
+ SdrPageView* pPgView = m_pView->GetSdrPageView();
+
+ BOOL bWasMarked = m_pView->IsObjMarked( pDlgObj );
+
+ if( bWasMarked )
+ m_pView->MarkObj( pDlgObj, pPgView, TRUE );
+
+ return bWasMarked;
+}
+
+//----------------------------------------------------------------------------
+BOOL OReportSection::RemarkDialog()
+{
+ SdrObject* pDlgObj = m_pPage->GetObj(0);
+ SdrPageView* pPgView = m_pView->GetSdrPageView();
+
+ BOOL bWasMarked = m_pView->IsObjMarked( pDlgObj );
+
+ if( !bWasMarked )
+ m_pView->MarkObj( pDlgObj, pPgView, FALSE );
+
+ return bWasMarked;
+}
+//----------------------------------------------------------------------------
+void OReportSection::SetMode( DlgEdMode eNewMode )
+{
+ if ( eNewMode != m_eMode )
+ {
+ if ( eNewMode == RPTUI_INSERT )
+ m_pFunc.reset(new DlgEdFuncInsert( this ));
+ else
+ m_pFunc.reset(new DlgEdFuncSelect( this ));
+
+ m_pModel->SetReadOnly(eNewMode == RPTUI_READONLY);
+ m_eMode = eNewMode;
+ }
+}
+//----------------------------------------------------------------------------
+void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedObjects)
+{
+ OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!");
+ if( !m_pView->AreObjectsMarked() || !m_xSection.is() )
+ return;
+
+ // stop all drawing actions
+ //m_pView->BrkAction();
+
+ // insert control models of marked objects into clipboard dialog model
+ const SdrMarkList& rMarkedList = m_pView->GetMarkedObjectList();
+ const ULONG nMark = rMarkedList.GetMarkCount();
+
+ ::std::vector< uno::Reference<util::XCloneable> > aCopies;
+ aCopies.reserve(nMark);
+
+ for( ULONG i = 0; i < nMark; i++ )
+ {
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(rMarkedList.GetMark(i)->GetMarkedSdrObj());
+ if ( pObj )
+ {
+ try
+ {
+ uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent();
+ aCopies.push_back(xComponent->createClone());
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can't copy report elements!");
+ }
+ }
+ } // for( ULONG i = 0; i < nMark; i++ )
+
+ if ( !aCopies.empty() )
+ {
+ const sal_Int32 nLength = _rAllreadyCopiedObjects.getLength();
+ _rAllreadyCopiedObjects.realloc( nLength + 1);
+ beans::NamedValue* pNewValue = _rAllreadyCopiedObjects.getArray() + nLength;
+ pNewValue->Name = m_xSection->getName();
+ pNewValue->Value <<= uno::Sequence< uno::Reference<util::XCloneable> >(&(*aCopies.begin()),aCopies.size());
+ }
+}
+//----------------------------------------------------------------------------
+void OReportSection::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ m_pParent->getView()->setMarked(m_pView,sal_True);
+ m_pFunc->MouseButtonDown( rMEvt );
+ Window::MouseButtonDown(rMEvt);
+}
+//----------------------------------------------------------------------------
+void OReportSection::GetFocus()
+{
+ Window::GetFocus();
+ m_pParent->SectionHasFocus(this,TRUE);
+}
+//----------------------------------------------------------------------------
+void OReportSection::LoseFocus()
+{
+ Window::LoseFocus();
+ m_pParent->SectionHasFocus(this,FALSE);
+}
+//----------------------------------------------------------------------------
+
+void OReportSection::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( !m_pFunc->MouseButtonUp( rMEvt ) )
+ getViewsWindow()->getView()->getReportView()->getController()->executeUnChecked(SID_OBJECT_SELECT,uno::Sequence< beans::PropertyValue>());
+}
+
+//----------------------------------------------------------------------------
+
+void OReportSection::MouseMove( const MouseEvent& rMEvt )
+{
+ m_pFunc->MouseMove( rMEvt );
+}
+//----------------------------------------------------------------------------
+bool OReportSection::adjustPageSize()
+{
+ bool bAdjustedPageSize = false;
+ return bAdjustedPageSize;
+}
+//----------------------------------------------------------------------------
+void OReportSection::SetGridVisible(BOOL _bVisible)
+{
+ m_pView->SetGridVisible( _bVisible );
+}
+//------------------------------------------------------------------------------
+void OReportSection::SelectAll()
+{
+ if ( m_pView )
+ m_pView->MarkAllObj();
+}
+// -----------------------------------------------------------------------------
+void OReportSection::setSectionHeightPixel(sal_uInt32 _nHeight)
+{
+ OSL_ENSURE(m_xSection.is(),"Why is the UNO section NULL!");
+ if ( m_xSection.is() )
+ m_xSection->setHeight(PixelToLogic(Size(0,_nHeight),MAP_100TH_MM).Width());
+}
+//----------------------------------------------------------------------------
+void OReportSection::insertObject(const uno::Reference< report::XReportComponent >& _xObject)
+{
+ OSL_ENSURE(_xObject.is(),"Object is not valid to create a SdrObject!");
+ if ( !_xObject.is() || !m_pView || !m_pPage )
+ return;
+ m_pPage->insertObject(_xObject);
+}
+//----------------------------------------------------------------------------
+void OReportSection::Command( const CommandEvent& _rCEvt )
+{
+ Window::Command(_rCEvt);
+ switch (_rCEvt.GetCommand())
+ {
+ case COMMAND_CONTEXTMENU:
+ {
+ OReportController* pController = getViewsWindow()->getView()->getReportView()->getController();
+ PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) );
+ uno::Reference< report::XReportDefinition> xReportDefinition = getSection()->getReportDefinition();
+ const USHORT nCount = aContextMenu.GetItemCount();
+ for (USHORT i = 0; i < nCount; ++i)
+ {
+ if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i))
+ {
+ const USHORT nId = aContextMenu.GetItemId(i);
+ if ( nId == SID_PAGEHEADERFOOTER )
+ {
+ String sText = String(ModuleRes((xReportDefinition.is() && xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT));
+ aContextMenu.SetItemText(nId,sText);
+ }
+ else if ( nId == SID_REPORTHEADERFOOTER )
+ {
+ String sText = String(ModuleRes((xReportDefinition.is() && xReportDefinition->getReportHeaderOn()) ? RID_STR_REPORTHEADERFOOTER_DELETE : RID_STR_REPORTHEADERFOOTER_INSERT));
+ aContextMenu.SetItemText(nId,sText);
+ }
+ aContextMenu.CheckItem(nId,pController->isCommandChecked(nId));
+ aContextMenu.EnableItem(nId,pController->isCommandEnabled(nId));
+ }
+ } // for (USHORT i = 0; i < nCount; ++i)
+ Point aPos = _rCEvt.GetMousePosPixel();
+ m_pView->EndAction();
+ const USHORT nId = aContextMenu.Execute(this, aPos);
+ if ( nId )
+ {
+ uno::Sequence< beans::PropertyValue> aArgs;
+ if ( nId == SID_ATTR_CHAR_COLOR_BACKGROUND )
+ {
+ aArgs.realloc(1);
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Selection"));
+ aArgs[0].Value <<= m_xSection;
+ }
+ pController->executeChecked(nId,aArgs);
+ }
+ }
+ break;
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ if ( m_xSection.is() )
+ {
+ if ( _rEvent.Source == m_xSection )
+ {
+ m_pView->SetApplicationDocumentColor(m_xSection->getBackColor());
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
+ else
+ {
+ if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN )
+ {
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ m_pPage->SetLftBorder(nLeftMargin);
+ //m_pView->GetSdrPageView()->SetPageOrigin(Point(nLeftMargin,0));
+ }
+ else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN )
+ {
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN);
+ m_pPage->SetRgtBorder(nRightMargin);
+ }
+
+ Resize();
+ }
+ }
+}
+//------------------------------------------------------------------------------
+sal_Bool OReportSection::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_pFunc.get() ? m_pFunc->handleKeyEvent(_rEvent) : sal_False;
+}
+// -----------------------------------------------------------------------------
+void OReportSection::createDefault(const ::rtl::OUString& _sType)
+{
+ SdrObject* pObj = m_pView->GetCreateObj();//rMarkList.GetMark(0)->GetObj();
+ if ( !pObj )
+ return;
+ sal_Bool bAttributesAppliedFromGallery = sal_False;
+
+ if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
+ {
+ std::vector< rtl::OUString > aObjList;
+ if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
+ {
+ std::vector< rtl::OUString >::iterator aIter = aObjList.begin();
+ std::vector< rtl::OUString >::iterator aEnd = aObjList.end();
+ for (sal_uInt32 i=0 ; aIter != aEnd; ++aIter,++i)
+ {
+ if ( aIter->equalsIgnoreAsciiCase( _sType ) )
+ {
+ OReportModel aReportModel;
+ SfxItemPool& rPool = aReportModel.GetItemPool();
+ rPool.FreezeIdRanges();
+ if ( GalleryExplorer::GetSdrObj( GALLERY_THEME_POWERPOINT, i, &aReportModel ) )
+ {
+ const SdrObject* pSourceObj = aReportModel.GetPage( 0 )->GetObj( 0 );
+ if( pSourceObj )
+ {
+ const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
+ SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
+ SDRATTR_START, SDRATTR_SHADOW_LAST,
+ SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
+ SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
+ // Graphic Attributes
+ SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST,
+ // 3d Properties
+ SDRATTR_3D_FIRST, SDRATTR_3D_LAST,
+ // CustomShape properties
+ SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
+ // range from SdrTextObj
+ EE_ITEMS_START, EE_ITEMS_END,
+ // end
+ 0, 0);
+ aDest.Set( rSource );
+ pObj->SetMergedItemSet( aDest );
+ sal_Int32 nAngle = pSourceObj->GetRotateAngle();
+ if ( nAngle )
+ {
+ double a = nAngle * F_PI18000;
+ pObj->NbcRotate( pObj->GetSnapRect().Center(), nAngle, sin( a ), cos( a ) );
+ }
+ bAttributesAppliedFromGallery = sal_True;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ if ( !bAttributesAppliedFromGallery )
+ {
+ pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER ,ITEMID_ADJUST) );
+ pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
+ pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) );
+ pObj->SetMergedItem( SdrTextAutoGrowHeightItem( sal_False ) );
+ ((SdrObjCustomShape*)pObj)->MergeDefaultAttributes( &_sType );
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportComponent > OReportSection::getCurrentControlModel() const
+{
+ uno::Reference< report::XReportComponent > xModel;
+ if ( m_pView )
+ {
+ const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList();
+ sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
+
+ if ( nMarkCount == 1 )
+ {
+ SdrObject* pDlgEdObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj);
+ if ( pObj )
+ xModel = pObj->getReportComponent().get();
+ }
+ }
+ return xModel;
+}
+// -----------------------------------------------------------------------------
+void OReportSection::fillControlModelSelection(::std::vector< uno::Reference< report::XReportComponent > >& _rSelection) const
+{
+ if ( m_pView )
+ {
+ const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList();
+ const sal_uInt32 nMarkCount = rMarkList.GetMarkCount();
+
+ for (sal_uInt32 i=0; i < nMarkCount; ++i)
+ {
+ const SdrObject* pDlgEdObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
+ const OObjectBase* pObj = dynamic_cast<const OObjectBase*>(pDlgEdObj);
+ if ( pObj )
+ _rSelection.push_back(pObj->getReportComponent());
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt )
+{
+ OSL_TRACE("AcceptDrop::DropEvent.Action %i\n", _rEvt.mnAction);
+
+ ::Point aDropPos(_rEvt.maPosPixel);
+ MouseEvent aMouseEvt(aDropPos);
+ if ( m_pFunc->isOverlapping(aMouseEvt) )
+ return DND_ACTION_NONE;
+
+ if ( _rEvt.mnAction == DND_ACTION_COPY ||
+ _rEvt.mnAction == DND_ACTION_LINK
+ )
+ {
+ if (!m_pParent) return DND_ACTION_NONE;
+ USHORT nCurrentPosition = 0;
+ nCurrentPosition = m_pParent->getPosition(this);
+ if (_rEvt.mnAction == DND_ACTION_COPY )
+ {
+ // we must assure, we can't drop in the top section
+ if (nCurrentPosition < 1)
+ {
+ return DND_ACTION_NONE;
+ }
+ return DND_ACTION_LINK;
+ }
+ if (_rEvt.mnAction == DND_ACTION_LINK)
+ {
+ // we must assure, we can't drop in the bottom section
+ if (m_pParent->getSectionCount() > (nCurrentPosition + 1) )
+ {
+ return DND_ACTION_COPY;
+ }
+ return DND_ACTION_NONE;
+ }
+ }
+ else
+ {
+ const DataFlavorExVector& rFlavors = GetDataFlavorExVector();
+ if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) )
+ return _rEvt.mnAction;
+
+ const sal_Int8 nDropOption = ( OReportExchange::canExtract(rFlavors) ) ? DND_ACTION_COPYMOVE : DND_ACTION_NONE;
+
+ return nDropOption;
+ }
+ return DND_ACTION_NONE;
+}
+
+// -----------------------------------------------------------------------------
+sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt )
+{
+ OSL_TRACE("ExecuteDrop::DropEvent.Action %i\n", _rEvt.mnAction);
+ ::Point aDropPos(PixelToLogic(_rEvt.maPosPixel));
+ MouseEvent aMouseEvt(aDropPos);
+ if ( m_pFunc->isOverlapping(aMouseEvt) )
+ return DND_ACTION_NONE;
+
+ sal_Int8 nDropOption = DND_ACTION_NONE;
+ TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable);
+ DataFlavorExVector& rFlavors = aDropped.GetDataFlavorExVector();
+ if ( OReportExchange::canExtract(rFlavors) )
+ {
+ OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aDropped);
+ Paste(aCopies,true);
+ nDropOption = DND_ACTION_COPYMOVE;
+ m_pParent->breakAction();
+ m_pParent->unmarkAllObjects(m_pView);
+ //m_pParent->getView()->setMarked(m_pView,sal_True);
+ } // if ( OReportExchange::canExtract(rFlavors) )
+ else if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) )
+ {
+ m_pParent->getView()->setMarked(m_pView,sal_True);
+ m_pView->UnmarkAll();
+ const Rectangle& rRect = m_pView->GetWorkArea();
+ if ( aDropPos.X() < rRect.Left() )
+ aDropPos.X() = rRect.Left();
+ else if ( aDropPos.X() > rRect.Right() )
+ aDropPos.X() = rRect.Right();
+
+ if ( aDropPos.Y() > rRect.Bottom() )
+ aDropPos.Y() = rRect.Bottom();
+
+ ::svx::ODataAccessDescriptor aDescriptor = ::svx::OColumnTransferable::extractColumnDescriptor(aDropped);
+ // we use this way to create undo actions
+ OReportController* pController = getViewsWindow()->getView()->getReportView()->getController();
+ uno::Sequence<beans::PropertyValue> aValues( aDescriptor.createPropertyValueSequence() );
+ sal_Int32 nLength = aValues.getLength();
+ aValues.realloc(nLength + 3);
+ aValues[nLength].Name = PROPERTY_POSITION;
+ aValues[nLength++].Value <<= AWTPoint(aDropPos);
+ // give also the DND Action (Shift|Ctrl) Key to really say what we want
+ aValues[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction"));
+ aValues[nLength++].Value <<= _rEvt.mnAction;
+
+ aValues[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section"));
+ aValues[nLength++].Value <<= getSection();
+
+ pController->executeChecked(SID_ADD_CONTROL_PAIR,aValues);
+ nDropOption = DND_ACTION_COPY;
+ }
+ return nDropOption;
+}
+// -----------------------------------------------------------------------------
+void OReportSection::breakAction()
+{
+ if( m_pView && m_pView->IsAction() )
+ m_pView->BrkAction();
+}
+// =============================================================================
+}
+// =============================================================================
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
new file mode 100644
index 000000000000..b482b247741d
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -0,0 +1,535 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ReportWindow.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef RPTUI_SECTIONSWINDOW_HXX
+#include "SectionsWindow.hxx"
+#endif
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#include "ViewsWindow.hxx"
+#endif
+#ifndef RPTUI_RULER_HXX
+#include "ReportRuler.hxx"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include <RptDef.hxx>
+#endif
+#ifndef _REPORT_RPTUIFUNC_HXX
+#include "dlgedfunc.hxx"
+#endif
+
+#ifndef REPORT_RPTMODEL_HXX
+#include <RptModel.hxx>
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include "RptPage.hxx"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef RPTUI_ENDMARKER_HXX
+#include "EndMarker.hxx"
+#endif
+#ifndef _SFXITEMPOOL_HXX
+#include <svtools/itempool.hxx>
+#endif
+#ifndef RPTUI_COLORCHANGER_HXX
+#include "ColorChanger.hxx"
+#endif
+#ifndef RPTUI_SCROLLHELPER_HXX
+#include "ScrollHelper.hxx"
+#endif
+#ifndef _SV_SPLIT_HXX
+#include <vcl/split.hxx>
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _REPORT_RPTUIFAC_HXX
+#include "dlgedfac.hxx"
+#endif
+#include <boost/bind.hpp>
+
+#define SECTION_OFFSET 3
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace ::comphelper;
+//==================================================================
+// class OReportWindow
+//==================================================================
+DBG_NAME( rpt_OReportWindow )
+//------------------------------------------------------------------------------
+OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
+: Window(_pParent,WB_DIALOGCONTROL)
+,m_aHRuler(this)
+,m_pView(_pView)
+,m_pParent(_pParent)
+{
+ DBG_CTOR( rpt_OReportWindow,NULL);
+ SetUniqueId(UID_REPORTWINDOW);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ m_pSections = new OSectionsWindow(this,this);
+ m_pSections->Show();
+ m_pViews = new OViewsWindow(this,this);
+ m_pViews->Show();
+
+ m_pSections->SetZOrder(m_pViews,WINDOW_ZORDER_BEFOR);
+
+ m_aHRuler.Show();
+ m_aHRuler.Activate();
+ m_aHRuler.SetPagePos(0);
+ m_aHRuler.SetBorders();
+ m_aHRuler.SetIndents();
+ m_aHRuler.SetMargin1();
+ m_aHRuler.SetMargin2();
+
+ m_pObjFac = new DlgEdFactory();
+
+ ImplInitSettings();
+}
+//------------------------------------------------------------------------------
+OReportWindow::~OReportWindow()
+{
+ DBG_DTOR( rpt_OReportWindow,NULL);
+ {
+ ::std::auto_ptr<Window> aTemp(m_pSections);
+ m_pSections = NULL;
+ }
+ {
+ ::std::auto_ptr<Window> aTemp(m_pViews);
+ m_pViews = NULL;
+ }
+ delete m_pObjFac;
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::initialize()
+{
+ if ( m_pViews )
+ m_pViews->initialize();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ if ( m_pViews )
+ m_pViews->SetInsertObj( eObj,_sShapeType);
+}
+//------------------------------------------------------------------------------
+void OReportWindow::SetMode( DlgEdMode eNewMode )
+{
+ if ( m_pViews )
+ m_pViews->SetMode(eNewMode);
+}
+//----------------------------------------------------------------------------
+void OReportWindow::removeSection(USHORT _nPosition)
+{
+ m_pViews->removeSection(_nPosition);
+ m_pSections->removeSection(_nPosition);
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+ m_pSections->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
+ m_pViews->Invalidate(INVALIDATE_NOCHILDREN);
+ //Resize();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
+{
+ if ( !_xSection.is() )
+ return;
+
+ m_pSections->addSection(_xSection,_sColorEntry,_nPosition);
+ m_pViews->addSection(_xSection,_sColorEntry,_nPosition);
+
+ Resize();
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OReportWindow, Collapsed, OStartMarker *, _pMarker )
+{
+ if ( _pMarker && m_pSections && m_pViews )
+ {
+ m_pViews->showView(m_pSections->find(_pMarker),!_pMarker->isCollapsed());
+
+ m_pViews->Resize();
+ m_pViews->Invalidate(INVALIDATE_NOCHILDREN);
+ m_pSections->Resize();
+ _pMarker->Invalidate();
+ m_pSections->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
+ }
+ return 0L;
+}
+//------------------------------------------------------------------------------
+void OReportWindow::toggleGrid(sal_Bool _bVisible)
+{
+ if ( m_pViews )
+ m_pViews->toggleGrid(_bVisible);
+}
+//----------------------------------------------------------------------------
+void OReportWindow::showRuler(sal_Bool _bShow)
+{
+ m_aHRuler.Show(_bShow);
+ if ( m_pSections )
+ m_pSections->showRuler(_bShow);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::getMaxMarkerWidth(sal_Bool _bWithEnd) const
+{
+ return REPORT_STARTMARKER_WIDTH + ( _bWithEnd ? REPORT_ENDMARKER_WIDTH : 0 );
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::GetTotalWidth() const
+{
+ sal_Int32 nWidth = 0;
+ if ( m_pViews && !m_pViews->empty() )
+ {
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController()->getReportDefinition(),PROPERTY_PAPERSIZE).Width;
+ const Size aPageSize = LogicToPixel(Size(nPaperWidth,0),MAP_100TH_MM);
+ nWidth = aPageSize.Width()
+ + REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH;
+ }
+ return nWidth;
+}
+//------------------------------------------------------------------------------
+void OReportWindow::Resize()
+{
+ Window::Resize();
+ if ( m_pView->getController() && m_pViews && !m_pViews->empty() && m_pSections )
+ {
+ const Size aTotalOutputSize = GetOutputSizePixel();
+
+ Point aStartPoint(REPORT_STARTMARKER_WIDTH,0);
+ uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController()->getReportDefinition();
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
+ sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ Size aPageSize = LogicToPixel(Size(nPaperWidth,0),MAP_100TH_MM);
+ nLeftMargin = LogicToPixel(Size(nLeftMargin,0),MAP_100TH_MM).Width();
+ nRightMargin = LogicToPixel(Size(nRightMargin,0),MAP_100TH_MM).Width();
+
+ aPageSize.Height() = m_aHRuler.GetSizePixel().Height();
+
+ const long nTermp(m_pViews->getTotalHeight() + aPageSize.Height());
+ long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.getHeight());
+ m_pSections->SetPosSizePixel(Point(0,aPageSize.Height()),Size(REPORT_STARTMARKER_WIDTH,nSectionsHeight));
+
+ m_aHRuler.SetPosSizePixel(aStartPoint,aPageSize);
+ m_aHRuler.SetNullOffset(nLeftMargin);
+ m_aHRuler.SetMargin1(0);
+ m_aHRuler.SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin);
+
+ aStartPoint.Y() += aPageSize.Height();
+ nSectionsHeight -= aStartPoint.Y();
+
+ //m_pViews->SetPosSizePixel(aStartPoint,Size(GetTotalWidth() - aStartPoint.X(),nSectionsHeight));
+ m_pViews->SetPosSizePixel(aStartPoint,Size(GetTotalWidth(),nSectionsHeight));
+ }
+}
+//------------------------------------------------------------------------------
+Point OReportWindow::getScrollOffset() const
+{
+ return m_pParent->getScrollOffset();
+}
+//------------------------------------------------------------------------------
+void OReportWindow::ImplInitSettings()
+{
+ SetBackground( );
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::getSplitterHeight() const
+{
+ sal_Int32 nRet = 0;
+ if ( m_pViews )
+ nRet = m_pViews->getSplitterHeight();
+ return nRet;
+}
+//------------------------------------------------------------------------------
+void OReportWindow::setTotalSize()
+{
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::GetTotalHeight() const
+{
+ sal_Int32 nHeight = m_aHRuler.GetSizePixel().Height();
+ if ( m_pViews )
+ nHeight += m_pViews->getTotalHeight();
+ return nHeight;
+}
+//------------------------------------------------------------------------------
+namespace
+{
+ class OWindowPositionCorrector
+ {
+ ::std::vector< ::std::pair<Window*,Point> > m_aChildren;
+ long m_nDeltaX;
+ long m_nDeltaY;
+ public:
+ OWindowPositionCorrector(Window* _pWindow,long _nDeltaX, long _nDeltaY) :m_nDeltaX(_nDeltaX), m_nDeltaY(_nDeltaY)
+ {
+ USHORT nCount = _pWindow->GetChildCount();
+ m_aChildren.reserve(nCount);
+ while( nCount )
+ {
+ Window* pChild = _pWindow->GetChild(--nCount);
+ m_aChildren.push_back(::std::pair<Window*,Point>(pChild,pChild->GetPosPixel()));
+ }
+ }
+ ~OWindowPositionCorrector()
+ {
+ ::std::vector< ::std::pair<Window*,Point> >::iterator aIter = m_aChildren.begin();
+ ::std::vector< ::std::pair<Window*,Point> >::iterator aEnd = m_aChildren.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ const Point aPos = aIter->first->GetPosPixel();
+ if ( aPos == aIter->second )
+ aIter->first->SetPosPixel(Point(m_nDeltaX,m_nDeltaY) + aPos);
+ }
+ }
+ };
+}
+//----------------------------------------------------------------------------
+void OReportWindow::ScrollChildren(long nDeltaX, long nDeltaY)
+{
+ MapMode aMap = m_aHRuler.GetMapMode();
+ Point aOrg( aMap.GetOrigin() );
+ aMap.SetOrigin( Point(aOrg.X() - nDeltaX, aOrg.Y()));
+ m_aHRuler.SetMapMode( aMap );
+ m_aHRuler.Scroll(-nDeltaX,0);
+
+ if ( m_pViews )
+ {
+ aMap = m_pViews->GetMapMode();
+ aOrg = aMap.GetOrigin();
+ aMap.SetOrigin( Point(aOrg.X() - nDeltaX, aOrg.Y() - nDeltaY));
+ m_pViews->SetMapMode( aMap );
+ const Size aDelta( PixelToLogic(Size(nDeltaX,nDeltaY)) );
+ OWindowPositionCorrector aCorrector(m_pViews,-nDeltaX,-nDeltaY);
+ m_pViews->Scroll(-aDelta.Width(),-aDelta.Height(),SCROLL_CHILDREN);
+ } // if ( m_pViews )
+ if ( m_pSections && nDeltaY )
+ {
+ aMap = m_pSections->GetMapMode();
+ aOrg = aMap.GetOrigin();
+ aMap.SetOrigin( Point(aOrg.X(), aOrg.Y() - nDeltaY));
+ m_pSections->SetMapMode( aMap );
+ const Size aDelta( PixelToLogic(Size(0,nDeltaY)) );
+ OWindowPositionCorrector aCorrector(m_pSections,0,-nDeltaY);
+ m_pSections->Scroll(0,-aDelta.Height(),SCROLL_CHILDREN);
+ m_pSections->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
+ } // if ( m_pSections )
+}
+//----------------------------------------------------------------------------
+USHORT OReportWindow::getSectionCount() const
+{
+ USHORT nRet = 0;
+ if ( m_pViews )
+ nRet = m_pViews->getSectionCount();
+ return nRet;
+}
+//----------------------------------------------------------------------------
+sal_Int32 OReportWindow::getMinHeight(USHORT _nPos) const
+{
+ return m_pSections ? m_pSections->getMinHeight(_nPos) : sal_Int32(0);
+}
+//----------------------------------------------------------------------------
+void OReportWindow::notifyHeightChanged()
+{
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+ Resize();
+ Invalidate(INVALIDATE_TRANSPARENT);
+}
+//----------------------------------------------------------------------------
+BOOL OReportWindow::HasSelection()
+{
+ return m_pViews && m_pViews->HasSelection();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Delete()
+{
+ if ( m_pViews )
+ m_pViews->Delete();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Copy()
+{
+ if ( m_pViews )
+ m_pViews->Copy();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Paste()
+{
+ if ( m_pViews )
+ m_pViews->Paste();
+}
+//----------------------------------------------------------------------------
+BOOL OReportWindow::IsPasteAllowed()
+{
+ return m_pViews && m_pViews->IsPasteAllowed();
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::SelectAll()
+{
+ if ( m_pViews )
+ m_pViews->SelectAll();
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ if ( m_pViews )
+ m_pViews->unmarkAllObjects(_pSectionView);
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::showProperties(const uno::Reference< report::XSection>& _xReportComponent)
+{
+ ::boost::shared_ptr<OReportSection> pReportSection = m_pViews->getReportSection( _xReportComponent );
+ m_pView->UpdatePropertyBrowserDelayed(pReportSection->getView());
+}
+//------------------------------------------------------------------------------
+sal_Bool OReportWindow::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_pViews ? m_pViews->handleKeyEvent(_rEvent) : sal_False;
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ if ( m_pViews && _pSectionView )
+ m_pViews->setMarked(_pSectionView,_bMark);
+ if ( m_pSections )
+ {
+ m_pSections->setMarked(_pSectionView->getSectionWindow()->getSection(),_bMark);
+ }
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ if ( m_pViews )
+ m_pViews->setMarked(_xSection,_bMark);
+ if ( m_pSections )
+ m_pSections->setMarked(_xSection,_bMark);
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape,sal_Bool _bMark)
+{
+ if ( m_pViews )
+ m_pViews->setMarked(_xShape,_bMark);
+}
+//-----------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OReportWindow::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_pViews ? m_pViews->getMarkedSection(nsa) : ::boost::shared_ptr<OReportSection>();
+}
+// -------------------------------------------------------------------------
+void OReportWindow::markSection(const sal_uInt16 _nPos)
+{
+ if ( m_pViews )
+ m_pViews->markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ if ( m_pSections )
+ m_pSections->fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
+{
+ if ( m_pSections )
+ m_pSections->collapseSections(_aCollpasedSections);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
+{
+ if ( m_pViews )
+ m_pViews->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::setGridSnap(BOOL bOn)
+{
+ if ( m_pViews )
+ m_pViews->setGridSnap(bOn);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::setDragStripes(BOOL bOn)
+{
+ if ( m_pViews )
+ m_pViews->setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+BOOL OReportWindow::isDragStripes() const
+{
+ return m_pViews ? m_pViews->isDragStripes() : FALSE;
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 OReportWindow::getMarkedObjectCount() const
+{
+ return m_pViews ? m_pViews->getMarkedObjectCount() : 0;
+}
+
+//==================================================================
+} //rptui
+//==================================================================
+
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
new file mode 100644
index 000000000000..0eafecc4e801
--- /dev/null
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -0,0 +1,588 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ScrollHelper.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_SCROLLHELPER_HXX
+#include "ScrollHelper.hxx"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+#include "UITools.hxx"
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#endif
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include <toolkit/helper/convert.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+namespace rptui
+{
+#define LINE_SIZE 50
+#define SECTION_OFFSET 3
+#define SCR_LINE_SIZE 10
+using namespace ::com::sun::star;
+
+// -----------------------------------------------------------------------------
+void lcl_setScrollBar(sal_Int32 _nNewValue,sal_Int32 _nOffSet,const Point& _aPos,const Size& _aSize,ScrollBar& _rScrollBar)
+{
+ _rScrollBar.SetPosSizePixel(_aPos,_aSize);
+ _rScrollBar.SetPageSize( _nNewValue );
+ _rScrollBar.SetVisibleSize( _nNewValue );
+ _rScrollBar.SetThumbPos( -_nOffSet );
+}
+
+// -----------------------------------------------------------------------------
+DBG_NAME( rpt_OScrollWindowHelper );
+OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView)
+ : OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL)
+ ,OPropertyChangeListener(m_aMutex)
+ ,m_aHScroll( this, WB_HSCROLL|WB_REPEAT|WB_DRAG )
+ ,m_aVScroll( this, WB_VSCROLL|WB_REPEAT|WB_DRAG )
+ ,m_aCornerWin( this )
+ ,m_pParent(_pDesignView)
+ ,m_pChild(NULL)
+ ,m_pReportDefintionMultiPlexer(NULL)
+{
+ DBG_CTOR( rpt_OScrollWindowHelper,NULL);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ impl_initScrollBar( m_aHScroll );
+ impl_initScrollBar( m_aVScroll );
+
+ m_pChild = new OReportWindow(this,m_pParent);
+ m_pChild->SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_pChild->Show();
+
+ // normally we should be SCROLL_PANE
+ SetAccessibleRole(accessibility::AccessibleRole::SCROLL_PANE);
+ ImplInitSettings();
+}
+
+// -----------------------------------------------------------------------------
+OScrollWindowHelper::~OScrollWindowHelper()
+{
+ DBG_DTOR( rpt_OScrollWindowHelper,NULL);
+ if ( m_pReportDefintionMultiPlexer.is() )
+ m_pReportDefintionMultiPlexer->dispose();
+ {
+ ::std::auto_ptr<OReportWindow> aTemp2(m_pChild);
+ m_pChild = NULL;
+ }
+}
+
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::impl_initScrollBar( ScrollBar& _rScrollBar ) const
+{
+ AllSettings aSettings( _rScrollBar.GetSettings() );
+ StyleSettings aStyle( aSettings.GetStyleSettings() );
+ aStyle.SetDragFullOptions( aStyle.GetDragFullOptions() | DRAGFULL_OPTION_SCROLL );
+ aSettings.SetStyleSettings( aStyle );
+ _rScrollBar.SetSettings( aSettings );
+
+ _rScrollBar.SetScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) );
+ _rScrollBar.SetEndScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) );
+}
+
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::initialize()
+{
+ uno::Reference<report::XReportDefinition> xReportDefinition = m_pParent->getController()->getReportDefinition();
+ m_pReportDefintionMultiPlexer = addStyleListener(xReportDefinition,this);
+ if ( m_pChild )
+ m_pChild->initialize();
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight)
+{
+ // the width never change
+ //if ( !m_aTotalPixelSize.Width() )
+ m_aTotalPixelSize.Width() = _nWidth;
+ m_aTotalPixelSize.Height() = _nHeight;
+ m_aHScroll.SetRangeMax( m_aTotalPixelSize.Width() );
+ m_aHScroll.SetLineSize( SCR_LINE_SIZE );
+ m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
+ m_aVScroll.SetLineSize( SCR_LINE_SIZE );
+ Point aNewPixOffset(-m_aHScroll.GetThumbPos(),-m_aVScroll.GetThumbPos());
+ if ( m_aPixOffset != aNewPixOffset )
+ {
+ const long nX = aNewPixOffset.X() - m_aPixOffset.X();
+ const long nY = aNewPixOffset.Y() - m_aPixOffset.Y();
+ impl_scrollContent( -nX, -nY );
+ m_aPixOffset = aNewPixOffset;
+ }
+
+ Resize();
+}
+//------------------------------------------------------------------------------
+Size OScrollWindowHelper::ResizeScrollBars()
+{
+ // get the new output-size in pixel
+ Size aOutPixSz = GetOutputSizePixel();
+ if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 )
+ return aOutPixSz;
+
+ // determine the size of the output-area and if we need scrollbars
+ const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ BOOL bVVisible = FALSE; // by default no vertical-ScrollBar
+ BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar
+ BOOL bChanged; // determines if a visiblility was changed
+ do
+ {
+ bChanged = FALSE;
+
+ // does we need a vertical ScrollBar
+ if ( aOutPixSz.Width() < m_aTotalPixelSize.Width() && !bHVisible )
+ {
+ bHVisible = TRUE;
+ aOutPixSz.Height() -= nScrSize;
+ bChanged = TRUE;
+ }
+
+ // does we need a horizontal ScrollBar
+ if ( aOutPixSz.Height() < m_aTotalPixelSize.Height() && !bVVisible )
+ {
+ bVVisible = TRUE;
+ aOutPixSz.Width() -= nScrSize;
+ bChanged = TRUE;
+ }
+
+ }
+ while ( bChanged ); // until no visibility has changed
+
+ const Point aOldPixOffset( m_aPixOffset );
+
+ // justify (right/bottom borders should never exceed the window)
+ //Size aPixDelta;
+ //if ( m_aPixOffset.X() < 0 && (m_aTotalPixelSize.Width() + m_aPixOffset.X()) < aOutPixSz.Width() )
+ // aPixDelta.Width() = aOutPixSz.Width() - ( m_aPixOffset.X() + m_aTotalPixelSize.Width() );
+ //if ( m_aPixOffset.Y() < 0 && (m_aTotalPixelSize.Height() + m_aPixOffset.Y()) < aOutPixSz.Height() )
+ // aPixDelta.Height() = aOutPixSz.Height() - ( m_aPixOffset.Y() + m_aTotalPixelSize.Height() );
+ //if ( aPixDelta.Width() || aPixDelta.Height() )
+ //{
+ // m_aPixOffset.X() += aPixDelta.Width();
+ // m_aPixOffset.Y() += aPixDelta.Height();
+ //}
+
+ // for axis without scrollbar restore the origin
+ if ( !bVVisible || !bHVisible )
+ {
+ m_aPixOffset = Point(
+ bHVisible
+ ? m_aPixOffset.X()
+ : 0 ,
+ bVVisible
+ ? m_aPixOffset.Y()
+ : 0 );
+ }
+
+ // select the shifted map-mode
+ if ( m_aPixOffset != aOldPixOffset )
+ {
+ const long nX = m_aPixOffset.X() - aOldPixOffset.X();
+ const long nY = m_aPixOffset.Y() - aOldPixOffset.Y();
+ impl_scrollContent( -nX, -nY );
+ }
+
+ // show or hide scrollbars
+ m_aVScroll.Show( bVVisible );
+ m_aHScroll.Show( bHVisible );
+
+ // disable painting in the corner between the scrollbars
+ if ( bVVisible && bHVisible )
+ {
+ m_aCornerWin.SetPosSizePixel(*((Point*) &aOutPixSz), Size(nScrSize, nScrSize) );
+ m_aCornerWin.Show();
+ }
+ else
+ m_aCornerWin.Hide();
+
+ const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT );
+ // resize scrollbars and set their ranges
+ if ( bHVisible )
+ {
+ const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X();
+ lcl_setScrollBar(nNewWidth,m_aPixOffset.X(),Point( REPORT_STARTMARKER_WIDTH, aOutPixSz.Height() ),Size( aOutPixSz.Width() - REPORT_STARTMARKER_WIDTH, nScrSize ),m_aHScroll);
+ }
+ if ( bVVisible )
+ {
+ const sal_Int32 nNewHeight = aOutPixSz.Height() - m_pChild->getRulerHeight();
+ lcl_setScrollBar(nNewHeight,m_aPixOffset.Y(),Point( aOutPixSz.Width(), m_pChild->getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll);
+ Invalidate(Rectangle(Point(aOutPixSz.Width(),0),Size(nScrSize,m_pChild->getRulerHeight())));
+ }
+ return aOutPixSz;
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::EndScroll( long nDeltaX, long nDeltaY )
+{
+ ScrollPane( nDeltaX, nDeltaY );
+
+ impl_scrollContent( nDeltaX, nDeltaY );
+ Resize();
+
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::impl_scrollContent( long nDeltaX, long nDeltaY )
+{
+ m_aScrollOffset += Point( nDeltaX, nDeltaY );
+ if ( m_pChild )
+ m_pChild->ScrollChildren(nDeltaX,nDeltaY);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::Resize()
+{
+ OScrollWindowHelper_BASE::Resize();
+ const Size aTotalOutputSize = ResizeScrollBars();
+
+ OSL_ENSURE(m_pChild,"ReportWindow is NULL");
+ if ( m_pChild )
+ m_pChild->SetPosSizePixel(Point( 0, 0 ),Size( aTotalOutputSize.Width(), aTotalOutputSize.Height()));
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, pScroll )
+{
+ // get the delta in logic coordinates
+ const Size aDelta( m_aHScroll.GetDelta(), m_aVScroll.GetDelta() );
+
+ // scroll the window, if this is not already done
+ if ( pScroll == &m_aHScroll )
+ ScrollPane( aDelta.Width(), 0 );
+ else
+ ScrollPane( 0, aDelta.Height() );
+
+ impl_scrollContent( m_aHScroll.GetDelta(), m_aVScroll.GetDelta() );
+
+ return 0;
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::ScrollPane( long nDeltaX, long nDeltaY )
+{
+ // get the delta in pixel
+ Size aDeltaPix( nDeltaX, nDeltaY );
+ Size aOutPixSz( GetOutputSizePixel() );
+ const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+
+ if ( m_aVScroll.IsVisible() )
+ aOutPixSz.Width() -= nScrSize;
+
+ if ( m_aHScroll.IsVisible() )
+ aOutPixSz.Height() -= nScrSize;
+
+ Point aNewPixOffset( m_aPixOffset );
+
+ // scrolling horizontally?
+ if ( nDeltaX != 0 )
+ {
+ aNewPixOffset.X() -= nDeltaX;
+ if ( ( aOutPixSz.Width() - aNewPixOffset.X() ) > m_aTotalPixelSize.Width() )
+ aNewPixOffset.X() = - ( m_aTotalPixelSize.Width() - aOutPixSz.Width() );
+ else if ( aNewPixOffset.X() > 0 )
+ aNewPixOffset.X() = 0;
+ }
+
+ // scrolling vertically?
+ if ( nDeltaY != 0 )
+ {
+ aNewPixOffset.Y() -= aDeltaPix.Height();
+ if ( ( aOutPixSz.Height() - aNewPixOffset.Y() ) > m_aTotalPixelSize.Height() )
+ aNewPixOffset.Y() = - ( m_aTotalPixelSize.Height() - aOutPixSz.Height() );
+ else if ( aNewPixOffset.Y() > 0 )
+ aNewPixOffset.Y() = 0;
+ }
+
+ // recompute the logical scroll units
+ aDeltaPix.Width() = m_aPixOffset.X() - aNewPixOffset.X();
+ aDeltaPix.Height() = m_aPixOffset.Y() - aNewPixOffset.Y();
+ /*nDeltaX = aDeltaPix.Width();
+ nDeltaY = aDeltaPix.Height();*/
+ m_aPixOffset = Point(-m_aHScroll.GetThumbPos(),-m_aVScroll.GetThumbPos());
+
+
+ // scrolling?
+ if ( nDeltaX != 0 || nDeltaY != 0 )
+ {
+ Update();
+
+ // does the new area overlap the old one?
+ if ( Abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() ||
+ Abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() )
+ {
+ // scroll the overlapping area
+ //SetMapMode( aMap );
+ //EndScroll(-nDeltaX,-nDeltaY);
+ //Size aDelta( PixelToLogic(aDeltaPix) );
+ //if ( aDelta.Width() )
+ //{
+ // Rectangle aRect(PixelToLogic(Rectangle(Point(REPORT_STARTMARKER_WIDTH,0),Size(aOutPixSz.Width() - REPORT_STARTMARKER_WIDTH,aOutPixSz.Height()))));
+ // Window::Scroll(-aDelta.Width(),0,aRect, SCROLL_CLIP|SCROLL_CHILDREN);
+ //} // if ( aDelta.Width() )
+ //if ( aDelta.Height() )
+ //{
+ // Rectangle aRect(PixelToLogic(Rectangle(Point(0,0),Size(aOutPixSz.Width(),aOutPixSz.Height() - m_pChild->getRulerHeight()))));
+ // Window::Scroll(0,-aDelta.Height(),aRect, SCROLL_CLIP|SCROLL_CHILDREN);
+ //}
+ }
+ else
+ {
+ // repaint all
+ //SetMapMode( aMap );
+ Invalidate();
+ }
+
+ Update();
+ }
+
+ m_aPixOffset.X() -= nDeltaX;
+ m_aPixOffset.Y() -= nDeltaY;
+ if ( nDeltaX )
+ m_aHScroll.SetThumbPos( -m_aPixOffset.X() );
+ if ( nDeltaY )
+ m_aVScroll.SetThumbPos( -m_aPixOffset.Y() );
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition)
+{
+ m_pChild->addSection(_xSection,_sColorEntry,_nPosition);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::removeSection(USHORT _nPosition)
+{
+ m_pChild->removeSection(_nPosition);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::toggleGrid(sal_Bool _bVisible)
+{
+ m_pChild->toggleGrid(_bVisible);
+}
+//------------------------------------------------------------------------------
+USHORT OScrollWindowHelper::getSectionCount() const
+{
+ return m_pChild->getSectionCount();
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ m_pChild->SetInsertObj(eObj,_sShapeType);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode )
+{
+ m_pChild->SetMode(_eNewMode);
+}
+//------------------------------------------------------------------------------
+BOOL OScrollWindowHelper::HasSelection()
+{
+ return m_pChild && m_pChild->HasSelection();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Delete()
+{
+ if ( m_pChild )
+ m_pChild->Delete();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Copy()
+{
+ if ( m_pChild )
+ m_pChild->Copy();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Paste()
+{
+ if ( m_pChild )
+ m_pChild->Paste();
+}
+//----------------------------------------------------------------------------
+BOOL OScrollWindowHelper::IsPasteAllowed()
+{
+ return m_pChild && m_pChild->IsPasteAllowed();
+}
+//-----------------------------------------------------------------------------
+void OScrollWindowHelper::SelectAll()
+{
+ m_pChild->SelectAll();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ m_pChild->unmarkAllObjects(_pSectionView);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OScrollWindowHelper::getMaxMarkerWidth(sal_Bool _bWithEnd) const
+{
+ return m_pChild->getMaxMarkerWidth(_bWithEnd);
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::showRuler(sal_Bool _bShow)
+{
+ m_pChild->showRuler(_bShow);
+}
+//------------------------------------------------------------------------------
+sal_Bool OScrollWindowHelper::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_pChild ? m_pChild->handleKeyEvent(_rEvent) : sal_False;
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ if ( m_pChild )
+ m_pChild->setMarked(_pSectionView,_bMark);
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ if ( m_pChild )
+ m_pChild->setMarked(_xSection,_bMark);
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape,sal_Bool _bMark)
+{
+ if ( m_pChild )
+ m_pChild->setMarked(_xShape,_bMark);
+}
+// -------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_pChild ? m_pChild->getMarkedSection(nsa) : ::boost::shared_ptr<OReportSection>();
+}
+// -------------------------------------------------------------------------
+void OScrollWindowHelper::markSection(const sal_uInt16 _nPos)
+{
+ if ( m_pChild )
+ m_pChild->markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ if ( m_pChild )
+ m_pChild->fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
+{
+ if ( m_pChild )
+ m_pChild->collapseSections(_aCollpasedSections);
+}
+//------------------------------------------------------------------------------
+long OScrollWindowHelper::Notify( NotifyEvent& rNEvt )
+{
+ const CommandEvent* pCommandEvent = rNEvt.GetCommandEvent();
+ if ( pCommandEvent &&
+ ( ((pCommandEvent->GetCommand() == COMMAND_WHEEL) ||
+ (pCommandEvent->GetCommand() == COMMAND_STARTAUTOSCROLL) ||
+ (pCommandEvent->GetCommand() == COMMAND_AUTOSCROLL))) )
+ {
+ ScrollBar* pHScrBar = NULL;
+ ScrollBar* pVScrBar = NULL;
+ if ( m_aHScroll.IsVisible() )
+ pHScrBar = &m_aHScroll;
+
+ if ( m_aVScroll.IsVisible() )
+ pVScrBar = &m_aVScroll;
+
+ if ( HandleScrollCommand( *pCommandEvent, pHScrBar, pVScrBar ) )
+ return 1L;
+ }
+ return OScrollWindowHelper_BASE::Notify(rNEvt);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
+{
+ if ( m_pChild )
+ m_pChild->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::ImplInitSettings()
+{
+ SetBackground( );
+}
+//-----------------------------------------------------------------------------
+void OScrollWindowHelper::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_rEvent*/) throw( uno::RuntimeException)
+{
+ if ( m_pChild )
+ m_pChild->notifyHeightChanged();
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::setGridSnap(BOOL bOn)
+{
+ if ( m_pChild )
+ m_pChild->setGridSnap(bOn);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::setDragStripes(BOOL bOn)
+{
+ if ( m_pChild )
+ m_pChild->setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+BOOL OScrollWindowHelper::isDragStripes() const
+{
+ return m_pChild ? m_pChild->isDragStripes() : FALSE;
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const
+{
+ return m_pChild ? m_pChild->getMarkedObjectCount() : 0;
+}
+// -----------------------------------------------------------------------------
+//==============================================================================
+} // rptui
+//==============================================================================
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
new file mode 100644
index 000000000000..374cd738afd0
--- /dev/null
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -0,0 +1,199 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SectionView.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef RPT_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+
+#ifndef _REPORT_RPTUIPAGE_HXX
+#include <RptPage.hxx>
+#endif
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include <RptObject.hxx>
+#endif
+#ifndef _SVXIDS_HRC
+#include <svx/svxids.hrc>
+#endif
+
+#ifndef _SV_SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+
+
+namespace rptui
+{
+TYPEINIT1( OSectionView, SdrView );
+
+//----------------------------------------------------------------------------
+DBG_NAME( rpt_OSectionView )
+OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor )
+ :SdrView( pModel, _pSectionWindow )
+ ,m_pReportWindow( pEditor )
+ ,m_pSectionWindow(_pSectionWindow)
+{
+ DBG_CTOR( rpt_OSectionView,NULL);
+ //SetBufferedOutputAllowed(true);
+ SetBufferedOverlayAllowed(true);
+ SetPageBorderVisible(false);
+ SetBordVisible();
+}
+
+//----------------------------------------------------------------------------
+
+OSectionView::~OSectionView()
+{
+ DBG_DTOR( rpt_OSectionView,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+void OSectionView::MarkListHasChanged()
+{
+ DBG_CHKTHIS( rpt_OSectionView,NULL);
+ SdrView::MarkListHasChanged();
+
+ if ( m_pReportWindow )
+ {
+ //m_pReportWindow->unmarkAllObjects(this); // WHY
+ DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED );
+ m_pReportWindow->getReportView()->Broadcast( aHint );
+ m_pReportWindow->getReportView()->UpdatePropertyBrowserDelayed(this);
+ }
+}
+
+//----------------------------------------------------------------------------
+
+void OSectionView::MakeVisible( const Rectangle& rRect, Window& rWin )
+{
+ DBG_CHKTHIS( rpt_OSectionView,NULL);
+ // visible area
+ MapMode aMap( rWin.GetMapMode() );
+ const Point aOrg( aMap.GetOrigin() );
+ const Size aVisSize( rWin.GetOutputSize() );
+ const Rectangle aVisRect( Point(-aOrg.X(),-aOrg.Y()), aVisSize );
+
+ // check, if rectangle is inside visible area
+ if ( !aVisRect.IsInside( rRect ) )
+ {
+ // calculate scroll distance; the rectangle must be inside the visible area
+ sal_Int32 nScrollX = 0, nScrollY = 0;
+
+ const sal_Int32 nVisLeft = aVisRect.Left();
+ const sal_Int32 nVisRight = aVisRect.Right();
+ const sal_Int32 nVisTop = aVisRect.Top();
+ const sal_Int32 nVisBottom = aVisRect.Bottom();
+
+ // don't scroll beyond the page size
+ Size aPageSize = m_pSectionWindow->getPage()->GetSize();
+ const sal_Int32 nPageWidth = aPageSize.Width();
+ const sal_Int32 nPageHeight = aPageSize.Height();
+
+ if ( nVisRight + nScrollX > nPageWidth )
+ nScrollX = nPageWidth - nVisRight;
+
+ if ( nVisLeft + nScrollX < 0 )
+ nScrollX = -nVisLeft;
+
+ if ( nVisBottom + nScrollY > nPageHeight )
+ nScrollY = nPageHeight - nVisBottom;
+
+ if ( nVisTop + nScrollY < 0 )
+ nScrollY = -nVisTop;
+
+ // scroll window
+ rWin.Update();
+ rWin.Scroll( -nScrollX, -nScrollY );
+ aMap.SetOrigin( Point( aOrg.X() - nScrollX, aOrg.Y() - nScrollY ) );
+ rWin.SetMapMode( aMap );
+ rWin.Update();
+ rWin.Invalidate();
+
+ if ( m_pReportWindow )
+ {
+ const DlgEdHint aHint( RPTUI_HINT_WINDOWSCROLLED );
+ m_pReportWindow->getReportView()->Broadcast( aHint );
+ }
+ }
+}
+//------------------------------------------------------------------------------
+void OSectionView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ DBG_CHKTHIS( rpt_OSectionView,NULL);
+ SdrView::Notify(rBC,rHint);
+ if ( rHint.ISA(SdrHint) )
+ {
+ const SdrObject* pObj = ((SdrHint&)rHint).GetObject();
+ const SdrHintKind eKind = ((SdrHint&)rHint).GetKind();
+ // check for change of selected object
+ if(HINT_OBJCHG == eKind && pObj && IsObjMarked(const_cast<SdrObject*>(pObj)))
+ AdjustMarkHdl();
+ else if ( eKind == HINT_OBJREMOVED )
+ ObjectRemovedInAliveMode(pObj);
+ }
+}
+
+//------------------------------------------------------------------------------
+void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject )
+{
+ DBG_CHKTHIS( rpt_OSectionView,NULL);
+ const SdrMarkList& rMarkedList = GetMarkedObjectList();
+ const ULONG nMark = rMarkedList.GetMarkCount();
+
+ for( ULONG i = 0; i < nMark; i++ )
+ {
+ SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj();
+ if (_pObject == pSdrObj)
+ {
+ SdrPageView* pPgView = GetSdrPageView();
+ BrkAction();
+ MarkObj( pSdrObj, pPgView, TRUE );
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
new file mode 100644
index 000000000000..998c73ca6873
--- /dev/null
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -0,0 +1,342 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: StartMarker.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_STARTMARKER_HXX
+#include "StartMarker.hxx"
+#endif
+#ifndef _SV_IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef RPTUI_COLORCHANGER_HXX
+#include "ColorChanger.hxx"
+#endif
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#include "ReportDefines.hxx"
+#endif
+#ifndef RPTUI_SECTIONSWINDOW_HXX
+#include "SectionsWindow.hxx"
+#endif
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#ifndef _SV_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#include <vcl/gradient.hxx>
+#include <vcl/lineinfo.hxx>
+#ifndef _SFXSMPLHINT_HXX
+#include <svtools/smplhint.hxx>
+#endif
+
+#define CORNER_SPACE 5
+#define TEXT_WIDTH 10
+#define STRT_BORDER 6
+
+//=====================================================================
+namespace rptui
+{
+//=====================================================================
+
+Image* OStartMarker::s_pDefCollapsed = NULL;
+Image* OStartMarker::s_pDefExpanded = NULL;
+Image* OStartMarker::s_pDefCollapsedHC = NULL;
+Image* OStartMarker::s_pDefExpandedHC = NULL;
+oslInterlockedCount OStartMarker::s_nImageRefCount = 0;
+
+DBG_NAME( rpt_OStartMarker )
+// -----------------------------------------------------------------------------
+OStartMarker::OStartMarker(OSectionsWindow* _pParent,const ::rtl::OUString& _sColorEntry)
+: OColorListener(_pParent,_sColorEntry)
+,m_aVRuler(this,WB_VERT)
+,m_aText(this,WB_WORDBREAK)
+,m_aImage(this,WB_LEFT|WB_TOP)
+,m_pParent(_pParent)
+,m_nCornerSize(CORNER_SPACE)
+,m_bShowRuler(sal_True)
+{
+ DBG_CTOR( rpt_OStartMarker,NULL);
+ SetUniqueId(HID_STARTMARKER);
+ osl_incrementInterlockedCount(&s_nImageRefCount);
+ initDefaultNodeImages();
+ ImplInitSettings();
+ m_aText.SetHelpId(HID_START_TITLE);
+ m_aImage.SetHelpId(HID_START_IMAGE);
+ m_aText.Show();
+ m_aImage.Show();
+ m_aVRuler.Show();
+ m_aVRuler.Activate();
+ m_aVRuler.SetPagePos(0);
+ m_aVRuler.SetBorders();
+ m_aVRuler.SetIndents();
+ m_aVRuler.SetMargin1();
+ m_aVRuler.SetMargin2();
+
+}
+// -----------------------------------------------------------------------------
+OStartMarker::~OStartMarker()
+{
+ DBG_DTOR( rpt_OStartMarker,NULL);
+ if ( osl_decrementInterlockedCount(&s_nImageRefCount) == 0 )
+ {
+ DELETEZ(s_pDefCollapsed);
+ DELETEZ(s_pDefExpanded);
+ DELETEZ(s_pDefCollapsedHC);
+ DELETEZ(s_pDefExpandedHC);
+ } // if ( osl_decrementInterlockedCount(&s_nImageRefCount) == 0 )
+}
+// -----------------------------------------------------------------------------
+sal_Int32 OStartMarker::getWidth() const
+{
+ return (GetDisplayBackground().GetColor().IsDark() ? s_pDefExpandedHC : s_pDefCollapsed)->GetSizePixel().Width() + GetTextWidth(m_aText.GetText(),0,::std::min<USHORT>(TEXT_WIDTH,m_aText.GetText().Len())) + 2*REPORT_EXTRA_SPACE;
+}
+// -----------------------------------------------------------------------------
+sal_Int32 OStartMarker::getMinHeight() const
+{
+ return m_aText.GetTextHeight() + 2*STRT_BORDER + 2;
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::Paint( const Rectangle& rRect )
+{
+ Window::Paint( rRect );
+ //SetUpdateMode(FALSE);
+ Size aSize = GetSizePixel();
+ long nSize = aSize.Width();
+ if ( !isCollapsed() )
+ nSize = aSize.Width() - m_aVRuler.GetSizePixel().Width() - m_nCornerSize;
+ SetClipRegion(Region(Rectangle(Point(),Size( nSize,aSize.Height()))));
+ aSize.Width() += m_nCornerSize;
+
+ Rectangle aWholeRect(Point(),aSize);
+ {
+ const ColorChanger aColors( this, m_nTextBoundaries, m_nColor );
+
+ //aGradient.SetBorder(static_cast<USHORT>(m_nCornerSize));
+ PolyPolygon aPoly;
+ aPoly.Insert(Polygon(aWholeRect,m_nCornerSize,m_nCornerSize));
+
+ Color aStartColor(m_nColor);
+ aStartColor.IncreaseLuminance(10);
+ USHORT nHue = 0;
+ USHORT nSat = 0;
+ USHORT nBri = 0;
+ aStartColor.RGBtoHSB(nHue, nSat, nBri);
+ nSat += 40;
+ Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri));
+ Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor);
+ aGradient.SetSteps(static_cast<USHORT>(aSize.Height()));
+
+ DrawGradient(aPoly ,aGradient);
+ }
+ if ( m_bMarked )
+ {
+#define DIFF_DIST 2
+ Rectangle aRect( Point(m_nCornerSize,m_nCornerSize),
+ Size(aSize.Width() - m_nCornerSize- m_nCornerSize,aSize.Height() - m_nCornerSize- m_nCornerSize));
+ ColorChanger aColors( this, COL_WHITE, COL_WHITE );
+ DrawPolyLine(Polygon(aRect),LineInfo(LINE_SOLID,2));
+ }
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::setColor()
+{
+ const Color aColor(m_nColor);
+ Color aTextColor = GetTextColor();
+ if ( aColor.GetLuminance() < 128 )
+ aTextColor = COL_WHITE;
+ m_aText.SetTextColor(aTextColor);
+ m_aText.SetLineColor(m_nColor);
+}
+// -----------------------------------------------------------------------
+void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( !rMEvt.IsLeft() )
+ return;
+
+ Point aPos( rMEvt.GetPosPixel());
+
+ const Size aOutputSize = GetOutputSizePixel();
+ if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
+ return;
+ Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetImage().GetSizePixel());
+ if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) )
+ {
+ m_bCollapsed = !m_bCollapsed;
+
+ Image* pImage = NULL;
+ if ( GetDisplayBackground().GetColor().IsDark() )
+ pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC;
+ else
+ pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
+ m_aImage.SetImage(*pImage);
+
+ m_aVRuler.Show(!m_bCollapsed && m_bShowRuler);
+ m_nCornerSize = CORNER_SPACE;
+ if ( m_aCollapsedLink.IsSet() )
+ m_aCollapsedLink.Call(this);
+ }
+
+ m_pParent->showProperties(this);
+}
+// -----------------------------------------------------------------------
+void OStartMarker::initDefaultNodeImages()
+{
+ if ( !s_pDefCollapsed )
+ {
+ s_pDefCollapsed = new Image( ModuleRes( RID_IMG_TREENODE_COLLAPSED) );
+ s_pDefCollapsedHC = new Image( ModuleRes( RID_IMG_TREENODE_COLLAPSED_HC ) );
+ s_pDefExpanded = new Image( ModuleRes( RID_IMG_TREENODE_EXPANDED ) );
+ s_pDefExpandedHC = new Image( ModuleRes( RID_IMG_TREENODE_EXPANDED_HC ) );
+ }
+
+ Image* pImage = NULL;
+ if ( GetDisplayBackground().GetColor().IsDark() )
+ {
+ pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC;
+ }
+ else
+ {
+ pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
+ }
+ m_aImage.SetImage(*pImage);
+ m_aImage.SetMouseTransparent(TRUE);
+ m_aImage.SetBackground();
+ m_aText.SetBackground();
+ m_aText.SetMouseTransparent(TRUE);
+}
+// -----------------------------------------------------------------------
+void OStartMarker::ImplInitSettings()
+{
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
+ //SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDarkShadowColor() );
+ setColor();
+}
+//------------------------------------------------------------------------------
+void OStartMarker::Resize()
+{
+ const Size aOutputSize( GetOutputSize() );
+ const long nOutputWidth = aOutputSize.Width();
+ const long nOutputHeight = aOutputSize.Height();
+
+ const Size aImageSize = m_aImage.GetImage().GetSizePixel();
+ sal_Int32 nY = ::std::min<sal_Int32>(static_cast<sal_Int32>(REPORT_EXTRA_SPACE),static_cast<sal_Int32>((nOutputHeight - aImageSize.Height()) * 0.5));
+ if ( m_bCollapsed )
+ nY = static_cast<sal_Int32>((nOutputHeight - aImageSize.Height()) * 0.5);
+ Point aPos(REPORT_EXTRA_SPACE,nY);
+
+ m_aImage.SetPosSizePixel(aPos,Size(aImageSize.Width() + REPORT_EXTRA_SPACE,nOutputHeight - 2*nY));
+ aPos.X() += aImageSize.Width() + REPORT_EXTRA_SPACE;
+ aPos.Y() -= 2;
+
+ const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+ const Point aRulerPos(nOutputWidth - nVRulerWidth - 5,0);
+
+ m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nOutputHeight - 2*aPos.Y()));
+
+
+ m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::setTitle(const String& _sTitle)
+{
+ m_aText.SetText(_sTitle);
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
+{
+ OColorListener::Notify(rBc, rHint);
+ if (rHint.ISA(SfxSimpleHint)
+ && (static_cast< SfxSimpleHint const & >(rHint).GetId()
+ == SFX_HINT_COLORS_CHANGED))
+ {
+ setColor();
+ //m_aText.Invalidate();
+ Invalidate(INVALIDATE_CHILDREN);
+ }
+}
+//----------------------------------------------------------------------------
+void OStartMarker::showRuler(sal_Bool _bShow)
+{
+ m_bShowRuler = _bShow;
+ m_aVRuler.Show(!m_bCollapsed && m_bShowRuler);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OStartMarker::getRulerOffset() const
+{
+ return m_aVRuler.GetSizePixel().Width();
+}
+
+//------------------------------------------------------------------------------
+void OStartMarker::RequestHelp( const HelpEvent& rHEvt )
+{
+ if( m_aText.GetText().Len())
+ {
+ // Hilfe anzeigen
+ Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight()));
+ //aItemRect = LogicToPixel( aItemRect );
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+ if( rHEvt.GetMode() == HELPMODE_BALLOON )
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText.GetText());
+ else
+ Help::ShowQuickHelp( this, aItemRect, m_aText.GetText() );
+ }
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::setCollapsed(sal_Bool _bCollapsed)
+{
+ OColorListener::setCollapsed(_bCollapsed);
+ showRuler(_bCollapsed);
+}
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+// -----------------------------------------------------------------------
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
new file mode 100644
index 000000000000..5998e9387fa3
--- /dev/null
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -0,0 +1,1202 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: ViewsWindow.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#include "ViewsWindow.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef INCLUDED_SVTOOLS_COLORCFG_HXX
+#include <svtools/colorcfg.hxx>
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#ifndef RPTUI_ENDMARKER_HXX
+#include "EndMarker.hxx"
+#endif
+#ifndef _REPORT_RPTUIDEF_HXX
+#include "RptDef.hxx"
+#endif
+#ifndef _RPTUI_DLGRESID_HRC
+#include "RptResId.hrc"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _REPORT_RPTUICLIP_HXX
+#include "dlgedclip.hxx"
+#endif
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#include "ModuleHelper.hxx"
+#endif
+#ifndef _SVDPAGV_HXX
+#include <svx/svdpagv.hxx>
+#endif
+#ifndef _SVX_UNOSHAPE_HXX
+#include <svx/unoshape.hxx>
+#endif
+#include <vcl/svapp.hxx>
+#include <boost/bind.hpp>
+
+#include "helpids.hrc"
+#include <svx/svdundo.hxx>
+#include <algorithm>
+
+namespace rptui
+{
+#define SECTION_OFFSET 3
+
+using namespace ::com::sun::star;
+using namespace ::comphelper;
+// -----------------------------------------------------------------------------
+bool lcl_getNewRectSize(const Rectangle& _aObjRect,long& _nXMov, long& _nYMov,SdrObject* _pObj,SdrView* _pView,sal_Int32 _nControlModification, bool _bBoundRects)
+{
+ bool bMoveAllowed = _nXMov != 0 || _nYMov != 0;
+ if ( bMoveAllowed )
+ {
+ Rectangle aNewRect = _aObjRect;
+ SdrObject* pOverlappedObj = NULL;
+ do
+ {
+ aNewRect = _aObjRect;
+ switch(_nControlModification)
+ {
+ case ControlModification::HEIGHT_GREATEST:
+ case ControlModification::WIDTH_GREATEST:
+ aNewRect.setWidth(_nXMov);
+ aNewRect.setHeight(_nYMov);
+ break;
+ default:
+ aNewRect.Move(_nXMov,_nYMov);
+ break;
+ }
+
+ pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj);
+ if ( pOverlappedObj && _pObj != pOverlappedObj )
+ {
+ Rectangle aOverlappingRect = (_bBoundRects ? pOverlappedObj->GetCurrentBoundRect() : pOverlappedObj->GetSnapRect());
+ sal_Int32 nXTemp = _nXMov;
+ sal_Int32 nYTemp = _nYMov;
+ switch(_nControlModification)
+ {
+ case ControlModification::LEFT:
+ nXTemp += aOverlappingRect.Right() - aNewRect.Left();
+ bMoveAllowed = _nXMov != nXTemp;
+ break;
+ case ControlModification::RIGHT:
+ nXTemp += aOverlappingRect.Left() - aNewRect.Right();
+ bMoveAllowed = _nXMov != nXTemp;
+ break;
+ case ControlModification::TOP:
+ nYTemp += aOverlappingRect.Bottom() - aNewRect.Top();
+ bMoveAllowed = _nYMov != nYTemp;
+ break;
+ case ControlModification::BOTTOM:
+ nYTemp += aOverlappingRect.Top() - aNewRect.Bottom();
+ bMoveAllowed = _nYMov != nYTemp;
+ break;
+ case ControlModification::CENTER_HORIZONTAL:
+ nXTemp += aOverlappingRect.Center().X() - aNewRect.Center().X();
+ bMoveAllowed = _nXMov != nXTemp;
+ break;
+ case ControlModification::CENTER_VERTICAL:
+ nYTemp += aOverlappingRect.Center().Y() - aNewRect.Center().Y();
+ bMoveAllowed = _nYMov != nYTemp;
+ break;
+ case ControlModification::HEIGHT_GREATEST:
+ case ControlModification::WIDTH_GREATEST:
+ {
+ Rectangle aIntersectionRect = aNewRect.GetIntersection(aOverlappingRect);
+ if ( !aIntersectionRect.IsEmpty() )
+ {
+ if ( _nControlModification == ControlModification::WIDTH_GREATEST )
+ {
+ if ( aNewRect.Left() < aIntersectionRect.Left() )
+ {
+ aNewRect.Right() = aIntersectionRect.Left();
+ }
+ else if ( aNewRect.Left() < aIntersectionRect.Right() )
+ {
+ aNewRect.Left() = aIntersectionRect.Right();
+ }
+ }
+ else if ( _nControlModification == ControlModification::HEIGHT_GREATEST )
+ {
+ if ( aNewRect.Top() < aIntersectionRect.Top() )
+ {
+ aNewRect.Bottom() = aIntersectionRect.Top();
+ }
+ else if ( aNewRect.Top() < aIntersectionRect.Bottom() )
+ {
+ aNewRect.Top() = aIntersectionRect.Bottom();
+ }
+ }
+ nYTemp = aNewRect.getHeight();
+ bMoveAllowed = _nYMov != nYTemp;
+ nXTemp = aNewRect.getWidth();
+ bMoveAllowed = bMoveAllowed && _nXMov != nXTemp;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ _nXMov = nXTemp;
+ _nYMov = nYTemp;
+ }
+ else
+ pOverlappedObj = NULL;
+ }
+ while ( pOverlappedObj && bMoveAllowed );
+ }
+ return bMoveAllowed;
+}
+// -----------------------------------------------------------------------------
+
+DBG_NAME( rpt_OViewsWindow );
+OViewsWindow::OViewsWindow( Window* _pParent,OReportWindow* _pReportWindow)
+: Window( _pParent,WB_DIALOGCONTROL)
+,OPropertyChangeListener(m_aMutex)
+,m_pParent(_pReportWindow)
+,m_bInSplitHandler(sal_False)
+,m_bInUnmark(sal_False)
+{
+ DBG_CTOR( rpt_OViewsWindow,NULL);
+ SetUniqueId(UID_VIEWSWINDOW);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+ StartListening(m_aColorConfig);
+ ImplInitSettings();
+}
+// -----------------------------------------------------------------------------
+OViewsWindow::~OViewsWindow()
+{
+ EndListening(m_aColorConfig);
+ try
+ {
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ aIter->first.second->dispose();
+ }
+ catch (uno::Exception&)
+ {
+ }
+ m_aSections.clear();
+
+ DBG_DTOR( rpt_OViewsWindow,NULL);
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::initialize()
+{
+
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::Resize()
+{
+ Window::Resize();
+ if ( m_aSections.empty() )
+ return;
+ Point aStartPoint(0,0);
+
+ aStartPoint -= m_pParent->getScrollOffset();
+ Point aSplitterStartPoint(aStartPoint.X(),0);
+
+ uno::Reference<report::XReportDefinition> xReportDefinition = getView()->getReportView()->getController()->getReportDefinition();
+ if ( !xReportDefinition.is() )
+ return;
+ //sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
+ const Size aOrignalSize = LogicToPixel(Size(nPaperWidth,0),MAP_100TH_MM);
+ nRightMargin = LogicToPixel(Size(nRightMargin,0),MAP_100TH_MM).Width();
+
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (USHORT nPos=0;aIter != aEnd ; ++aIter,++nPos)
+ {
+ ::boost::shared_ptr<OReportSection> pReportSection = (*aIter).first.first;
+ uno::Reference< report::XSection> xSection = pReportSection->getSection();
+ Size aSectionSize = LogicToPixel( Size( nPaperWidth,xSection->getHeight() ),MAP_100TH_MM );
+
+ ::boost::shared_ptr<Splitter> pSplitter = (*aIter).second.second;
+ ::boost::shared_ptr<OEndMarker> pEndMarker = (*aIter).second.first;
+
+ const sal_Int32 nMinHeight = m_pParent->getMinHeight(nPos);
+ if ( pReportSection->IsVisible() )
+ {
+ pReportSection->SetPosSizePixel(aStartPoint,aSectionSize);
+ if ( !m_bInSplitHandler )
+ {
+ pSplitter->SetPosSizePixel(Point(aSplitterStartPoint.X(),aStartPoint.Y() + aSectionSize.Height()),Size(aOrignalSize.Width(),pSplitter->GetSizePixel().Height()));
+ pSplitter->SetDragRectPixel( Rectangle(Point(aSplitterStartPoint.X(),aStartPoint.Y() - 1),Size(aOrignalSize.Width(),m_pParent->GetOutputSizePixel().Height())) );
+ }
+
+ if ( nMinHeight > aSectionSize.Height() )
+ {
+ pEndMarker->SetPosSizePixel(Point(aSplitterStartPoint.X() + aOrignalSize.Width(),aStartPoint.Y()),Size(REPORT_ENDMARKER_WIDTH,nMinHeight));
+ aSectionSize.Height() = nMinHeight;
+ }
+ else
+ {
+ pEndMarker->SetPosSizePixel(Point(aSplitterStartPoint.X() + aOrignalSize.Width(),aStartPoint.Y()),Size(REPORT_ENDMARKER_WIDTH,aSectionSize.Height()));
+ }
+ }
+ else
+ {
+ aSectionSize.Height() = nMinHeight;
+ pEndMarker->SetPosSizePixel(Point(aSplitterStartPoint.X(),aStartPoint.Y()),Size(aOrignalSize.Width() + REPORT_ENDMARKER_WIDTH,aSectionSize.Height()));
+ }
+ aStartPoint.Y() += aSectionSize.Height() + pSplitter->GetSizePixel().Height();
+ } // for (;aIter != aEnd ; ++aIter)
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::ImplInitSettings()
+{
+ SetBackground( Wallpaper( m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor ) );
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
+ SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
+}
+//-----------------------------------------------------------------------------
+void OViewsWindow::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
+{
+ ::boost::shared_ptr<OReportSection> pReportSection( new OReportSection(this,_xSection) );
+ pReportSection->Show();
+
+ ::boost::shared_ptr<OEndMarker> pEndMarker( new OEndMarker(this,_sColorEntry) );
+ pEndMarker->Show();
+
+ ::boost::shared_ptr<Splitter> pSplitter(new Splitter(this));
+ pSplitter->SetStartSplitHdl(LINK(this, OViewsWindow,StartSplitHdl));
+ pSplitter->SetSplitHdl(LINK(this, OViewsWindow,SplitHdl));
+ pSplitter->SetEndSplitHdl(LINK(this, OViewsWindow,EndSplitHdl));
+ pSplitter->Show();
+
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> pMulti = new OPropertyChangeMultiplexer(this,_xSection.get());
+ pMulti->addProperty(PROPERTY_HEIGHT);
+
+ m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(TReportPair(pReportSection,pMulti),TSplitterPair(pEndMarker,pSplitter)));
+ m_pParent->setMarked(pReportSection->getView(),m_aSections.size() == 1);
+
+ Resize();
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::removeSection(USHORT _nPosition)
+{
+ if ( _nPosition < m_aSections.size() )
+ {
+ TSectionsMap::iterator aPos = getIteratorAtPos(_nPosition);
+ TSectionsMap::iterator aNew = getIteratorAtPos(_nPosition == 0 ? _nPosition+1: _nPosition - 1);
+
+ m_pParent->getReportView()->UpdatePropertyBrowserDelayed(aNew->first.first->getView());
+
+ aPos->first.second->dispose();
+ aPos->first.second = NULL;
+ m_aSections.erase(aPos);
+ Resize();
+ } // if ( _nPosition < m_aSections.size() )
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::showView(USHORT _nPos,BOOL _bShow)
+{
+ if ( _nPos < m_aSections.size() )
+ {
+ TSectionsMap::iterator aPos = getIteratorAtPos(_nPos);
+ aPos->first.first->Show(_bShow);
+ aPos->second.first->setCollapsed(_bShow);
+ aPos->second.second->Show(_bShow);
+ }
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::toggleGrid(sal_Bool _bVisible)
+{
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::SetGridVisible,_1,_bVisible),TReportPairHelper()));
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::Window::Invalidate,_1,INVALIDATE_NOERASE),TReportPairHelper()));
+}
+//------------------------------------------------------------------------------
+sal_Int32 OViewsWindow::getTotalHeight(const OReportSection* _pSection) const
+{
+ sal_Int32 nHeight = 0;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd && _pSection != (*aIter).first.first.get() ; ++aIter)
+ {
+ const ::boost::shared_ptr<OReportSection> pReportSection = (*aIter).first.first;
+ const ::boost::shared_ptr<Splitter> pSplitter = (*aIter).second.second;
+
+ uno::Reference< report::XSection> xSection = pReportSection->getSection();
+ const Size aSectionSize = LogicToPixel( Size( 0 ,xSection->getHeight() ) ,MAP_100TH_MM);
+ nHeight += aSectionSize.Height() + pSplitter->GetSizePixel().Height();
+ }
+
+ return nHeight;
+}
+//----------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+sal_Int32 OViewsWindow::getSplitterHeight() const
+{
+ sal_Int32 nRet = 0;
+ if ( !m_aSections.empty() )
+ nRet = m_aSections.begin()->second.second->GetSizePixel().Height();
+ return nRet;
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( OViewsWindow, StartSplitHdl, Splitter*, )
+{
+ const String sEmpty(String(ModuleRes(RID_STR_UNDO_CHANGE_SIZE)));
+ getView()->getReportView()->getController()->getUndoMgr()->EnterListAction(sEmpty,String());
+ return 0L;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OViewsWindow, EndSplitHdl, Splitter*, )
+{
+ getView()->getReportView()->getController()->getUndoMgr()->LeaveListAction();
+ Resize();
+ return 0L;
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( OViewsWindow, SplitHdl, Splitter*, _pSplitter )
+{
+ if ( !getView()->getReportView()->getController()->isEditable() )
+ {
+ m_bInSplitHandler = sal_False;
+ return 0L;
+ }
+
+ //m_bInSplitHandler = sal_True;
+ sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel();
+ const Point aPos = _pSplitter->GetPosPixel();
+ _pSplitter->SetPosPixel( Point( aPos.X(),nSplitPos ));
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).second.second.get() == _pSplitter )
+ {
+ uno::Reference< report::XSection> xSection = (*aIter).first.first->getSection();
+ nSplitPos = xSection->getHeight() + PixelToLogic(Size(0,nSplitPos-aPos.Y()),MAP_100TH_MM).Height();
+
+ const sal_Int32 nCount = xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference<report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY);
+ if ( xReportComponent.is() && nSplitPos < (xReportComponent->getPositionY() + xReportComponent->getHeight()) )
+ {
+ nSplitPos = xReportComponent->getPositionY() + xReportComponent->getHeight();
+ break;
+ }
+ }
+
+ //nSplitPos += xSection->getHeight();
+ if ( nSplitPos < 0 )
+ nSplitPos = 0;
+
+ xSection->setHeight(nSplitPos);
+ break;
+ }
+ }
+ m_bInSplitHandler = sal_False;
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ uno::Reference< report::XSection > xSection(_rEvent.Source,uno::UNO_QUERY);
+ if ( xSection.is() )
+ {
+ if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) )
+ {
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ ::boost::shared_ptr<OReportSection> pReportSection = (*aIter).first.first;
+ uno::Reference< report::XSection> xCurrentSection = pReportSection->getSection();
+ if ( xCurrentSection == xSection )
+ {
+ Resize();
+ pReportSection->Invalidate();
+ // end marker
+ (*aIter).second.first->Invalidate();
+ break;
+ }
+ } // for (;aIter != aEnd ; ++aIter)
+ }
+ } // if ( xSection.is() )
+}
+//----------------------------------------------------------------------------
+USHORT OViewsWindow::getSectionCount() const
+{
+ return static_cast<USHORT>(m_aSections.size());
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ (*aIter).first.first->getView()->SetCurrentObj( eObj, ReportInventor );
+
+ m_sShapeType = _sShapeType;
+}
+//----------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void OViewsWindow::SetMode( DlgEdMode eNewMode )
+{
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper()));
+}
+//----------------------------------------------------------------------------
+BOOL OViewsWindow::HasSelection()
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd && !(*aIter).first.first->getView()->AreObjectsMarked(); ++aIter)
+ ;
+ return aIter != aEnd;
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::Delete()
+{
+ m_bInUnmark = sal_True;
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::mem_fn(&OReportSection::Delete),TReportPairHelper()));
+ m_bInUnmark = sal_False;
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::Copy()
+{
+ uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ aIter->first.first->Copy(aAllreadyCopiedObjects);
+ OReportExchange* pCopy = new OReportExchange(aAllreadyCopiedObjects);
+ uno::Reference< datatransfer::XTransferable> aEnsureDelete = pCopy;
+ pCopy->CopyToClipboard(this);
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::Paste()
+{
+ TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(this));
+ OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aTransferData);
+ if ( aCopies.getLength() > 1 )
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::Paste,_1,aCopies,false),TReportPairHelper()));
+ else
+ {
+ ::boost::shared_ptr<OReportSection> pMarkedSection = getMarkedSection();
+ if ( pMarkedSection )
+ pMarkedSection->Paste(aCopies,true);
+ }
+}
+//----------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OViewsWindow::getMarkedSection(NearSectionAccess nsa) const
+{
+ ::boost::shared_ptr<OReportSection> pRet;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ sal_uInt32 nCurrentPosition = 0;
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).second.first->isMarked() )
+ {
+ if (nsa == CURRENT)
+ {
+ pRet = (*aIter).first.first;
+ break;
+ }
+ else if ( nsa == PREVIOUS )
+ {
+ if (nCurrentPosition > 0)
+ {
+ const TSectionPair aPair = (*(--aIter));
+ pRet = aPair.first.first;
+ if (pRet == NULL)
+ {
+ pRet = (*m_aSections.begin()).first.first;
+ }
+ }
+ else
+ {
+ // if we are out of bounds return the first one
+ pRet = (*m_aSections.begin()).first.first;
+ }
+ break;
+ }
+ else if ( nsa == POST )
+ {
+ sal_uInt32 nSize = m_aSections.size();
+ if ((nCurrentPosition + 1) < nSize)
+ {
+ const TSectionPair aPair = (*(++aIter));
+ pRet = aPair.first.first;
+ if (pRet == NULL)
+ {
+ pRet = (*(--aEnd)).first.first;
+ }
+ }
+ else
+ {
+ // if we are out of bounds return the last one
+ pRet = (*(--aEnd)).first.first;
+ }
+ break;
+ }
+ } // ( (*aIter).second.first->isMarked() )
+ nCurrentPosition ++;
+ } // for (; aIter != aEnd ; ++aIter)
+
+ return pRet;
+}
+// -------------------------------------------------------------------------
+void OViewsWindow::markSection(const sal_uInt16 _nPos)
+{
+ if ( _nPos < m_aSections.size() )
+ m_pParent->setMarked(getIteratorAtPos(_nPos)->first.first->getSection(),sal_True);
+}
+//----------------------------------------------------------------------------
+BOOL OViewsWindow::IsPasteAllowed()
+{
+ TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(this));
+ return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId());
+}
+//-----------------------------------------------------------------------------
+void OViewsWindow::SelectAll()
+{
+ m_bInUnmark = sal_True;
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::mem_fn(&OReportSection::SelectAll),TReportPairHelper()));
+ m_bInUnmark = sal_False;
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::SectionHasFocus(OReportSection* /*_pSection*/,BOOL /*_bHasFocus*/)
+{
+/* LLA!: this function does nothing!
+TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (USHORT i = 0 ; aIter != aEnd ; ++aIter,++i)
+ {
+ if ( aIter->first.first.get() == _pSection )
+ {
+
+ }
+ }
+*/
+}
+//-----------------------------------------------------------------------------
+void OViewsWindow::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ if ( !m_bInUnmark )
+ {
+ m_bInUnmark = sal_True;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).first.first->getView() != _pSectionView )
+ (*aIter).first.first->getView()->UnmarkAllObj();
+ } // for (; aIter != aEnd ; ++aIter)
+ m_bInUnmark = sal_False;
+ }
+}
+//-----------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OViewsWindow::getReportSection(const uno::Reference< report::XSection >& _xSection)
+{
+ OSL_ENSURE(_xSection.is(),"Section is NULL!");
+ ::boost::shared_ptr<OReportSection> pRet;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).first.first->getSection() == _xSection )
+ {
+ pRet = (*aIter).first.first;
+ break;
+ } // if ( (*aIter).first.first->getSection() == _xSection )
+ } // for (; aIter != aEnd ; ++aIter)
+ return pRet;
+}
+// -----------------------------------------------------------------------
+void OViewsWindow::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
+{
+ if (rHint.ISA(SfxSimpleHint)
+ && (static_cast< SfxSimpleHint const & >(rHint).GetId()
+ == SFX_HINT_COLORS_CHANGED))
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() )
+ {
+ GrabFocus();
+ const uno::Sequence< beans::PropertyValue> aArgs;
+ getView()->getReportView()->getController()->executeChecked(SID_SELECT_REPORT,aArgs);
+ }
+ Window::MouseButtonDown(rMEvt);
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::showProperties(const OEndMarker* _pEndMarker)
+{
+ OSL_PRECOND(_pEndMarker,"End marker is null!");
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd && (*aIter).second.first.get() != _pEndMarker; ++aIter)
+ ;
+ if ( aIter != aEnd )
+ {
+ uno::Reference< report::XSection> xSection = (*aIter).first.first->getSection();
+ m_pParent->showProperties( xSection.get() );
+ }
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() )
+ {
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).first.first->getView()->AreObjectsMarked() )
+ {
+ (*aIter).first.first->MouseButtonUp(rMEvt);
+ break;
+ }
+ }
+ }
+}
+//------------------------------------------------------------------------------
+sal_Bool OViewsWindow::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ sal_Bool bRet = sal_False;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ //if ( (*aIter).first.first->getView()->AreObjectsMarked() )
+ if ( (*aIter).second.first->isMarked() )
+ {
+ bRet = (*aIter).first.first->handleKeyEvent(_rEvent);
+ }
+ }
+ return bRet;
+}
+//----------------------------------------------------------------------------
+OViewsWindow::TSectionsMap::iterator OViewsWindow::getIteratorAtPos(USHORT _nPos)
+{
+ TSectionsMap::iterator aRet = m_aSections.end();
+ if ( _nPos < m_aSections.size() )
+ aRet = m_aSections.begin() + _nPos;
+ return aRet;
+}
+//------------------------------------------------------------------------
+void OViewsWindow::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ OSL_ENSURE(_pSectionView != NULL,"SectionView is NULL!");
+ if ( _pSectionView )
+ setMarked(_pSectionView->getSectionWindow()->getSection(),_bMark);
+}
+//------------------------------------------------------------------------
+void OViewsWindow::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter).first.first->getSection() != _xSection )
+ {
+ (*aIter).second.first->setMarked(sal_False);
+ (*aIter).second.first->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
+ else if ( (*aIter).second.first->isMarked() != _bMark )
+ {
+ (*aIter).second.first->setMarked(_bMark);
+ (*aIter).second.first->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
+ }
+}
+//------------------------------------------------------------------------
+void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,sal_Bool _bMark)
+{
+ bool bFirst = true;
+ const uno::Reference< report::XReportComponent>* pIter = _aShapes.getConstArray();
+ const uno::Reference< report::XReportComponent>* pEnd = pIter + _aShapes.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ uno::Reference< report::XSection> xSection = (*pIter)->getSection();
+ if ( xSection.is() )
+ {
+ if ( bFirst )
+ {
+ bFirst = false;
+ m_pParent->setMarked(xSection,_bMark);
+ }
+ ::boost::shared_ptr<OReportSection> pSection = getReportSection(xSection);
+ if ( pSection )
+ {
+ SvxShape* pShape = SvxShape::getImplementation( *pIter );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject for the shape!" );
+ if ( pObject )
+ pSection->getView()->MarkObj( pObject, pSection->getView()->GetSdrPageView(), !_bMark );
+ }
+ }
+ }
+}
+//------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OViewsWindow::getSection(const Point& _aPosition)
+{
+ ::boost::shared_ptr<OReportSection> pRet;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ Rectangle aWorkArea((*aIter).first.first->ScreenToOutputPixel((*aIter).first.first->GetPosPixel()),(*aIter).first.first->GetOutputSizePixel());
+ aWorkArea = (*aIter).first.first->PixelToLogic( aWorkArea );
+ if ( aWorkArea.IsInside(_aPosition) )
+ {
+ pRet = (*aIter).first.first;
+ }
+ }
+ return pRet;
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::collectRectangles(TRectangleMap& _rSortRectangles, bool _bBoundRects)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (aIter = m_aSections.begin();aIter != aEnd ; ++aIter)
+ {
+ OSectionView* pView = (*aIter).first.first->getView();
+ if ( pView->AreObjectsMarked() )
+ {
+ pView->SortMarkedObjects();
+ const sal_uInt32 nCount = pView->GetMarkedObjectCount();
+ for (sal_uInt32 i=0; i < nCount; ++i)
+ {
+ const SdrMark* pM = pView->GetSdrMarkByIndex(i);
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ Rectangle aObjRect(_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect());
+ _rSortRectangles.insert(TRectangleMap::value_type(aObjRect,TRectangleMap::data_type(pObj,pView)));
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection, bool _bBoundRects,Rectangle& _rBound,Rectangle& _rResize)
+{
+ TRectangleMap::const_iterator aRectIter = _rSortRectangles.begin();
+ TRectangleMap::const_iterator aRectEnd = _rSortRectangles.end();
+ for (;aRectIter != aRectEnd ; ++aRectIter)
+ {
+ Rectangle aObjRect = aRectIter->first;
+ if ( _rResize.IsEmpty() )
+ _rResize = aObjRect;
+ switch(_nControlModification)
+ {
+ case ControlModification::WIDTH_SMALLEST:
+ if ( _rResize.getWidth() > aObjRect.getWidth() )
+ _rResize = aObjRect;
+ break;
+ case ControlModification::HEIGHT_SMALLEST:
+ if ( _rResize.getHeight() > aObjRect.getHeight() )
+ _rResize = aObjRect;
+ break;
+ case ControlModification::WIDTH_GREATEST:
+ if ( _rResize.getWidth() < aObjRect.getWidth() )
+ _rResize = aObjRect;
+ break;
+ case ControlModification::HEIGHT_GREATEST:
+ if ( _rResize.getHeight() < aObjRect.getHeight() )
+ _rResize = aObjRect;
+ break;
+ }
+
+ SdrObjTransformInfoRec aInfo;
+ const SdrObject* pObj = aRectIter->second.first;
+ pObj->TakeObjInfo(aInfo);
+ BOOL bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect();
+ if ( bHasFixed )
+ _rBound.Union(aObjRect);
+ else
+ {
+ if ( _bAlignAtSection || _rSortRectangles.size() == 1 )
+ { // einzelnes Obj an der Seite ausrichten
+ OReportSection* pReportSection = aRectIter->second.second->getSectionWindow();
+ uno::Reference< report::XSection> xSection = pReportSection->getSection();
+ try
+ {
+ uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+ _rBound.Union(Rectangle(getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN),0,
+ getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width - getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN),
+ xSection->getHeight()));
+ }
+ catch(uno::Exception){}
+ }
+ else
+ {
+ if (_bBoundRects)
+ _rBound.Union(aRectIter->second.second->GetMarkedObjBoundRect());
+ else
+ _rBound.Union(aRectIter->second.second->GetMarkedObjRect());
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool _bBoundRects)
+{
+ if ( _nControlModification == ControlModification::NONE )
+ return;
+
+ Point aRefPoint;
+ RectangleLess::CompareMode eCompareMode = RectangleLess::POS_LEFT;
+ switch (_nControlModification)
+ {
+ case ControlModification::TOP : eCompareMode = RectangleLess::POS_UPPER; break;
+ case ControlModification::BOTTOM: eCompareMode = RectangleLess::POS_DOWN; break;
+ case ControlModification::LEFT : eCompareMode = RectangleLess::POS_LEFT; break;
+ case ControlModification::RIGHT : eCompareMode = RectangleLess::POS_RIGHT; break;
+ case ControlModification::CENTER_HORIZONTAL :
+ case ControlModification::CENTER_VERTICAL :
+ {
+ eCompareMode = (ControlModification::CENTER_VERTICAL == _nControlModification) ? RectangleLess::POS_CENTER_VERTICAL : RectangleLess::POS_CENTER_HORIZONTAL;
+ uno::Reference<report::XSection> xSection = m_aSections.begin()->first.first->getSection();
+ uno::Reference<report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+ aRefPoint = Rectangle(getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN),0,
+ getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width - getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN),
+ xSection->getHeight()).Center();
+ }
+ break;
+ default: break;
+ }
+ RectangleLess aCompare(eCompareMode,aRefPoint);
+ TRectangleMap aSortRectangles(aCompare);
+ collectRectangles(aSortRectangles,_bBoundRects);
+
+ Rectangle aBound;
+ Rectangle aResize;
+ collectBoundResizeRect(aSortRectangles,_nControlModification,_bAlignAtSection,_bBoundRects,aBound,aResize);
+
+ bool bMove = true;
+
+ ::std::mem_fun_t<long&,Rectangle> aGetFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Bottom);
+ ::std::mem_fun_t<long&,Rectangle> aRefFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Top);
+ TRectangleMap::iterator aRectIter = aSortRectangles.begin();
+ TRectangleMap::iterator aRectEnd = aSortRectangles.end();
+ for (;aRectIter != aRectEnd ; ++aRectIter)
+ {
+ Rectangle aObjRect = aRectIter->first;
+ SdrObject* pObj = aRectIter->second.first;
+ SdrView* pView = aRectIter->second.second;
+ Point aCenter(aBound.Center());
+ SdrObjTransformInfoRec aInfo;
+ pObj->TakeObjInfo(aInfo);
+ if (aInfo.bMoveAllowed && !pObj->IsMoveProtect())
+ {
+ long nXMov = 0;
+ long nYMov = 0;
+ long* pValue = &nXMov;
+ switch(_nControlModification)
+ {
+ case ControlModification::TOP :
+ aGetFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Top);
+ aRefFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Bottom);
+ pValue = &nYMov;
+ break;
+ case ControlModification::BOTTOM:
+ // defaults are already set
+ pValue = &nYMov;
+ break;
+ case ControlModification::CENTER_VERTICAL:
+ nYMov = aCenter.Y() - aObjRect.Center().Y();
+ pValue = &nYMov;
+ bMove = false;
+ break;
+ case ControlModification::RIGHT :
+ aGetFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Right);
+ aRefFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Left);
+ break;
+ case ControlModification::CENTER_HORIZONTAL:
+ nXMov = aCenter.X() - aObjRect.Center().X();
+ bMove = false;
+ break;
+ case ControlModification::LEFT :
+ aGetFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Left);
+ aRefFun = ::std::mem_fun<long&,Rectangle>(&Rectangle::Right);
+ break;
+ default:
+ bMove = false;
+ break;
+ }
+ if ( bMove )
+ {
+ Rectangle aTest = aObjRect;
+ aGetFun(&aTest) = aGetFun(&aBound);
+ TRectangleMap::iterator aInterSectRectIter = aSortRectangles.begin();
+ for (; aInterSectRectIter != aRectIter; ++aInterSectRectIter)
+ {
+ if ( pView == aInterSectRectIter->second.second )
+ {
+ SdrObject* pPreviousObj = aInterSectRectIter->second.first;
+ Rectangle aIntersectRect = aTest.GetIntersection(_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect());
+ if ( !aIntersectRect.IsEmpty() && (aIntersectRect.Left() != aIntersectRect.Right() && aIntersectRect.Top() != aIntersectRect.Bottom() ) )
+ {
+ *pValue = aRefFun(&aIntersectRect) - aGetFun(&aObjRect);
+ break;
+ }
+ }
+ }
+ if ( aInterSectRectIter == aRectIter )
+ *pValue = aGetFun(&aBound) - aGetFun(&aObjRect);
+ }
+
+ if ( lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification,_bBoundRects) )
+ {
+ const Size aSize(nXMov,nYMov);
+ pView->AddUndo(pView->GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,aSize));
+ pObj->Move(aSize);
+ aObjRect = (_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect());
+ }
+
+ // resizing control
+ if ( !aResize.IsEmpty() && aObjRect != aResize )
+ {
+ nXMov = aResize.getWidth();
+ nYMov = aResize.getHeight();
+ switch(_nControlModification)
+ {
+ case ControlModification::WIDTH_GREATEST:
+ case ControlModification::HEIGHT_GREATEST:
+ if ( _nControlModification == ControlModification::HEIGHT_GREATEST )
+ nXMov = aObjRect.getWidth();
+ else if ( _nControlModification == ControlModification::WIDTH_GREATEST )
+ nYMov = aObjRect.getHeight();
+ lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification,_bBoundRects);
+ // run through
+ case ControlModification::WIDTH_SMALLEST:
+ case ControlModification::HEIGHT_SMALLEST:
+ pView->AddUndo( pView->GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+ if ( _nControlModification == ControlModification::WIDTH_SMALLEST || _nControlModification == ControlModification::WIDTH_GREATEST )
+ pObj->Resize(aObjRect.TopLeft(),Fraction(nXMov,aObjRect.getWidth()),Fraction(1,1));
+ else if ( _nControlModification == ControlModification::HEIGHT_GREATEST || _nControlModification == ControlModification::HEIGHT_SMALLEST )
+ pObj->Resize(aObjRect.TopLeft(),Fraction(1,1),Fraction(nYMov,aObjRect.getHeight()));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ pView->AdjustMarkHdl();
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::createDefault()
+{
+ ::boost::shared_ptr<OReportSection> pSection = getMarkedSection();
+ if ( pSection )
+ pSection->createDefault(m_sShapeType);
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::setGridSnap(BOOL bOn)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ (*aIter).first.first->getView()->SetGridSnap(bOn);
+ (*aIter).first.first->Invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::setDragStripes(BOOL bOn)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ (*aIter).first.first->getView()->SetDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+BOOL OViewsWindow::isDragStripes() const
+{
+ if ( m_aSections.empty() )
+ return FALSE;
+ return m_aSections.begin()->first.first->getView()->IsDragStripes();
+}
+// -----------------------------------------------------------------------------
+
+USHORT OViewsWindow::getPosition(const OReportSection* _pSection) const
+{
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ USHORT nPosition = 0;
+ for (; aIter != aEnd ; ++aIter)
+ {
+ ::boost::shared_ptr<OReportSection> pReportSection = (*aIter).first.first;
+ if (_pSection == pReportSection.get() )
+ {
+ break;
+ }
+ ++nPosition;
+ }
+ return nPosition;
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<OReportSection> OViewsWindow::getSection(const USHORT _nPos) const
+{
+ ::boost::shared_ptr<OReportSection> aReturn;
+
+ if ( _nPos < m_aSections.size() )
+ aReturn = m_aSections[_nPos].first.first;
+
+ return aReturn;
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::breakAction()
+{
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::breakAction,_1),TReportPairHelper()));
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl)
+{
+ const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width());
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ aIter->first.first->getView()->BegDragObj(_aPnt, (OutputDevice*)NULL, _pHdl, nDrgLog,NULL);
+}
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ enum SectionViewAction
+ {
+ eEndDragObj,
+ eEndAction,
+ eMoveAction
+ };
+ struct ApplySectionViewAction : public ::std::unary_function< OViewsWindow::TSectionsMap::value_type, void >
+ {
+ private:
+ SectionViewAction m_eAction;
+ sal_Bool m_bCopy;
+ Point m_aPoint;
+
+ public:
+ ApplySectionViewAction( sal_Bool _bCopy ) : m_eAction( eEndDragObj ), m_bCopy( _bCopy ) { }
+ ApplySectionViewAction() : m_eAction( eEndAction ) { }
+ ApplySectionViewAction( const Point& _rPoint ) : m_eAction( eMoveAction ), m_bCopy( sal_False ), m_aPoint( _rPoint ) { }
+
+ void operator() ( const OViewsWindow::TSectionsMap::value_type& _rhs )
+ {
+ OSectionView& rView( *_rhs.first.first->getView() );
+ switch ( m_eAction )
+ {
+ case eEndDragObj: rView.EndDragObj( m_bCopy ); break;
+ case eEndAction: rView.EndAction ( ); break;
+ case eMoveAction: rView.MovAction ( m_aPoint ); break;
+ }
+ }
+ };
+}
+
+// -----------------------------------------------------------------------------
+void OViewsWindow::EndDragObj(BOOL _bCopy)
+{
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( _bCopy ) );
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::EndAction()
+{
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction() );
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::MovAction(const Point& rPnt)
+{
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( rPnt ) );
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 OViewsWindow::getMarkedObjectCount() const
+{
+ sal_uInt32 nCount = 0;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ nCount += aIter->first.first->getView()->GetMarkedObjectCount();
+ return nCount;
+}
+//==============================================================================
+} // rptui
+//==============================================================================
+
diff --git a/reportdesign/source/ui/report/dlgedclip.cxx b/reportdesign/source/ui/report/dlgedclip.cxx
new file mode 100644
index 000000000000..dc4d7a857772
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedclip.cxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedclip.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _REPORT_RPTUICLIP_HXX
+#include "dlgedclip.hxx"
+#endif
+
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_DATATRANSFER_XMIMECONTENTTYPE_HPP_
+#include <com/sun/star/datatransfer/XMimeContentType.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DATATRANSFER_XMIMECONTENTTYPEFACTORY_HPP_
+#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
+#endif
+
+namespace rptui
+{
+
+using namespace comphelper;
+using namespace ::com::sun::star;
+
+//============================================================================
+// OReportExchange
+//============================================================================
+//----------------------------------------------------------------------------
+OReportExchange::OReportExchange(const TSectionElements& _rCopyElements )
+: m_aCopyElements(_rCopyElements)
+{
+}
+//--------------------------------------------------------------------
+sal_uInt32 OReportExchange::getDescriptorFormatId()
+{
+ static sal_uInt32 s_nFormat = (sal_uInt32)-1;
+ if ((sal_uInt32)-1 == s_nFormat)
+ {
+ s_nFormat = SotExchange::RegisterFormatName(String::CreateFromAscii("application/x-openoffice;windows_formatname=\"report.ReportObjectsTransfer\""));
+ OSL_ENSURE((sal_uInt32)-1 != s_nFormat, "OReportExchange::getDescriptorFormatId: bad exchange id!");
+ }
+ return s_nFormat;
+}
+//--------------------------------------------------------------------
+void OReportExchange::AddSupportedFormats()
+{
+ AddFormat(getDescriptorFormatId());
+}
+//--------------------------------------------------------------------
+sal_Bool OReportExchange::GetData( const datatransfer::DataFlavor& _rFlavor )
+{
+ const sal_uInt32 nFormatId = SotExchange::GetFormat(_rFlavor);
+ return (nFormatId == getDescriptorFormatId()) ?
+ SetAny( uno::Any(m_aCopyElements), _rFlavor )
+ : sal_False;
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportExchange::canExtract(const DataFlavorExVector& _rFlavor)
+{
+ return IsFormatSupported(_rFlavor,getDescriptorFormatId());
+}
+// -----------------------------------------------------------------------------
+OReportExchange::TSectionElements OReportExchange::extractCopies(const TransferableDataHelper& _rData)
+{
+ sal_Int32 nKnownFormatId = getDescriptorFormatId();
+ if ( _rData.HasFormat( nKnownFormatId ) )
+ {
+ // extract the any from the transferable
+ datatransfer::DataFlavor aFlavor;
+#if OSL_DEBUG_LEVEL > 0
+ sal_Bool bSuccess =
+#endif
+ SotExchange::GetFormatDataFlavor(nKnownFormatId, aFlavor);
+ OSL_ENSURE(bSuccess, "OReportExchange::extractCopies: invalid data format (no flavor)!");
+
+ uno::Any aDescriptor = _rData.GetAny(aFlavor);
+
+ TSectionElements aCopies;
+#if OSL_DEBUG_LEVEL > 0
+ bSuccess =
+#endif
+ aDescriptor >>= aCopies;
+ OSL_ENSURE(bSuccess, "OReportExchange::extractCopies: invalid clipboard format!");
+
+ // build the real descriptor
+ return aCopies;
+ }
+
+ return TSectionElements();
+}
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
new file mode 100644
index 000000000000..f27f02fa45e9
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedfac.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _REPORT_RPTUIFAC_HXX
+#include "dlgedfac.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+
+#ifndef _REPORT_RPTUIDEF_HXX
+#include <RptDef.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_SCROLLBARORIENTATION_HPP_
+#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#endif
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+
+//----------------------------------------------------------------------------
+
+DlgEdFactory::DlgEdFactory()
+{
+ SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFactory::~DlgEdFactory()
+{
+ SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
+}
+
+//----------------------------------------------------------------------------
+
+IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
+{
+ if ( pObjFactory->nInventor == ReportInventor )
+ {
+ switch( pObjFactory->nIdentifier )
+ {
+ case OBJ_DLG_FIXEDTEXT:
+ pObjFactory->pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
+ ,OBJ_DLG_FIXEDTEXT);
+ break;
+ case OBJ_DLG_IMAGECONTROL:
+ pObjFactory->pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl"))
+ ,OBJ_DLG_IMAGECONTROL);
+ break;
+ case OBJ_DLG_FORMATTEDFIELD:
+ pObjFactory->pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField"))
+ ,OBJ_DLG_FORMATTEDFIELD);
+ break;
+ case OBJ_DLG_VFIXEDLINE:
+ case OBJ_DLG_HFIXEDLINE:
+ {
+ OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel"))
+ ,pObjFactory->nIdentifier);
+ pObjFactory->pNewObj = pObj;
+ if ( pObjFactory->nIdentifier == OBJ_DLG_HFIXEDLINE )
+ {
+ uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
+ xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
+ }
+ }
+ break;
+ case OBJ_CUSTOMSHAPE:
+ pObjFactory->pNewObj = new OCustomShape(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.Shape")));
+ break;
+ default:
+ OSL_ENSURE(0,"Unknown object id");
+ break;
+ }
+ }
+
+ return 0;
+}
+//----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
new file mode 100644
index 000000000000..407eec2f37b4
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -0,0 +1,987 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dlgedfunc.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _SV_SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#ifndef _SVDVIEW_HXX //autogen
+#include <svx/svdview.hxx>
+#endif
+#include <svx/svdpagv.hxx>
+#include <svx/outlobj.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/unolingu.hxx>
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <svx/svdetc.hxx>
+#include <svx/editstat.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svddrgmt.hxx>
+#ifndef _SVDOASHP_HXX
+#include <svx/svdoashp.hxx>
+#endif
+
+
+#ifndef _REPORT_RPTUIFUNC_HXX
+#include "dlgedfunc.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#include "ViewsWindow.hxx"
+#endif
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#include "ReportWindow.hxx"
+#endif
+#include "RptObject.hxx"
+#ifndef DBAUI_SCROLLHELPER_HXX
+#include "ScrollHelper.hxx"
+#endif
+#ifndef _SV_SELENG_HXX //autogen
+#include <vcl/seleng.hxx>
+#endif
+#ifndef RPTUI_RULER_HXX
+#include "ReportRuler.hxx"
+#endif
+#include "UITools.hxx"
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#ifndef _SVDITER_HXX
+#include <svx/svditer.hxx>
+#endif
+
+#define DEFAUL_MOVE_SIZE 100
+namespace rptui
+{
+using namespace ::com::sun::star;
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
+IMPL_LINK( DlgEdFunc, ScrollTimeout, Timer *, )
+{
+ ForceScroll( pParent->PixelToLogic( pParent->GetPointerPosPixel() ) );
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+
+void DlgEdFunc::ForceScroll( const Point& rPos )
+{
+ aScrollTimer.Stop();
+
+ OReportWindow* pReportWindow = pParent->getViewsWindow()->getView();
+ OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
+
+ Size aOut = pReportWindow->GetOutputSizePixel();
+ aOut.Width() -= REPORT_STARTMARKER_WIDTH;
+
+ Rectangle aOutRect( pScrollWindow->getScrollOffset(), aOut );
+ aOutRect = pParent->PixelToLogic( aOutRect );
+ //Rectangle aWorkArea = pParent->getView()->GetWorkArea();
+ Rectangle aWorkArea(Point(),pScrollWindow->getTotalSize());
+ aWorkArea.Right() -= REPORT_STARTMARKER_WIDTH;
+ aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
+ if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
+ {
+ ScrollBar* pHScroll = pScrollWindow->GetHScroll();
+ ScrollBar* pVScroll = pScrollWindow->GetVScroll();
+ long nDeltaX = pHScroll->GetLineSize();
+ long nDeltaY = pVScroll->GetLineSize();
+
+ if( rPos.X() < aOutRect.Left() )
+ nDeltaX = -nDeltaX;
+ else if( rPos.X() <= aOutRect.Right() )
+ nDeltaX = 0;
+
+ if( rPos.Y() < aOutRect.Top() )
+ nDeltaY = -nDeltaY;
+ else if( rPos.Y() <= aOutRect.Bottom() )
+ nDeltaY = 0;
+
+ pScrollWindow->EndScroll(nDeltaX,nDeltaY);
+ }
+
+ aScrollTimer.Start();
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFunc::DlgEdFunc( OReportSection* _pParent )
+{
+ pParent = _pParent;
+ aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) );
+ aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFunc::~DlgEdFunc()
+{
+ aScrollTimer.Stop();
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ m_aMDPos = pParent->PixelToLogic( rMEvt.GetPosPixel() );
+ pParent->GrabFocus();
+ BOOL bHandled = FALSE;
+ if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 2 )
+ {
+ // show property browser
+ if ( pParent->GetMode() != RPTUI_READONLY )
+ {
+ uno::Sequence<beans::PropertyValue> aArgs(1);
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowProperties"));
+ aArgs[0].Value <<= sal_True;
+ pParent->getViewsWindow()->getView()->getReportView()->getController()->executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
+ pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pParent->getView());
+ bHandled = TRUE;
+ }
+ }
+ else if ( rMEvt.IsRight() && !rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) // mark object when context menu was selected
+ {
+ OSectionView* pView = pParent->getView();
+ //const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+ SdrPageView* pPV = pView->GetSdrPageView();
+ SdrViewEvent aVEvt;
+ pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ if ( aVEvt.pRootObj )
+ pView->MarkObj(aVEvt.pRootObj, pPV);
+ else
+ pParent->getViewsWindow()->unmarkAllObjects(NULL);
+
+
+ bHandled = TRUE;
+ }
+ return bHandled;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ )
+{
+ aScrollTimer.Stop();
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ )
+{
+ return TRUE;
+}
+//------------------------------------------------------------------------------
+sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ BOOL bReturn = FALSE;
+
+ OSectionView* pView = pParent->getView();
+
+ const KeyCode& rCode = _rEvent.GetKeyCode();
+ USHORT nCode = rCode.GetCode();
+
+ switch ( nCode )
+ {
+ case KEY_ESCAPE:
+ {
+ if ( pView->IsAction() )
+ {
+ pView->BrkAction();
+ bReturn = TRUE;
+ }
+ else if ( pView->AreObjectsMarked() )
+ {
+ const SdrHdlList& rHdlList = pView->GetHdlList();
+ SdrHdl* pHdl = rHdlList.GetFocusHdl();
+ if ( pHdl )
+ ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ else
+ pView->UnmarkAll();
+
+ bReturn = FALSE;
+ }
+ }
+ break;
+ case KEY_TAB:
+ {
+ if ( !rCode.IsMod1() && !rCode.IsMod2() )
+ {
+ // mark next object
+ if ( !pView->MarkNextObj( !rCode.IsShift() ) )
+ {
+ // if no next object, mark first/last
+ pView->UnmarkAllObj();
+ pView->MarkNextObj( !rCode.IsShift() );
+ }
+
+ if ( pView->AreObjectsMarked() )
+ pView->MakeVisible( pView->GetAllMarkedRect(), *pParent);
+
+ bReturn = TRUE;
+ }
+ else if ( rCode.IsMod1() )
+ {
+ // selected handle
+ const SdrHdlList& rHdlList = pView->GetHdlList();
+ ((SdrHdlList&)rHdlList).TravelFocusHdl( !rCode.IsShift() );
+
+ // guarantee visibility of focused handle
+ SdrHdl* pHdl = rHdlList.GetFocusHdl();
+ if ( pHdl )
+ {
+ Point aHdlPosition( pHdl->GetPos() );
+ Rectangle aVisRect( aHdlPosition - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) );
+ pView->MakeVisible( aVisRect, *pParent);
+ }
+
+ bReturn = TRUE;
+ }
+ }
+ break;
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ {
+ long nX = 0;
+ long nY = 0;
+
+ if ( nCode == KEY_UP )
+ nY = -1;
+ else if ( nCode == KEY_DOWN )
+ nY = 1;
+ else if ( nCode == KEY_LEFT )
+ nX = -1;
+ else if ( nCode == KEY_RIGHT )
+ nX = 1;
+
+ if ( pView->AreObjectsMarked() && !rCode.IsMod1() )
+ {
+ if ( rCode.IsMod2() )
+ {
+ // move in 1 pixel distance
+ const Size aPixelSize = pParent? pParent->PixelToLogic( Size( 1, 1 ) ) : Size( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE );
+ nX *= aPixelSize.Width();
+ nY *= aPixelSize.Height();
+ }
+ else
+ {
+ // move in 1 mm distance
+ nX *= DEFAUL_MOVE_SIZE;
+ nY *= DEFAUL_MOVE_SIZE;
+ }
+
+ const SdrHdlList& rHdlList = pView->GetHdlList();
+ SdrHdl* pHdl = rHdlList.GetFocusHdl();
+
+ if ( pHdl == 0 )
+ {
+ // no handle selected
+ if ( pView->IsMoveAllowed() )
+ {
+ // restrict movement to work area
+ const Rectangle& rWorkArea = pView->GetWorkArea();
+
+ if ( !rWorkArea.IsEmpty() )
+ {
+ Rectangle aMarkRect( pView->GetMarkedObjRect() );
+ aMarkRect.Move( nX, nY );
+
+ if ( !rWorkArea.IsInside( aMarkRect ) )
+ {
+ if ( aMarkRect.Left() < rWorkArea.Left() )
+ nX += rWorkArea.Left() - aMarkRect.Left();
+
+ if ( aMarkRect.Right() > rWorkArea.Right() )
+ nX -= aMarkRect.Right() - rWorkArea.Right();
+
+ if ( aMarkRect.Top() < rWorkArea.Top() )
+ nY += rWorkArea.Top() - aMarkRect.Top();
+
+ if ( aMarkRect.Bottom() > rWorkArea.Bottom() )
+ nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
+ }
+ bool bCheck = false;
+ const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+ for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
+ {
+ SdrMark* pMark = rMarkList.GetMark(i);
+ bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ }
+
+ if ( bCheck && isOver(aMarkRect,*pParent->getPage(),*pView) )
+ break;
+ }
+
+ if ( nX != 0 || nY != 0 )
+ {
+ pView->MoveAllMarked( Size( nX, nY ) );
+ pView->MakeVisible( pView->GetAllMarkedRect(), *pParent);
+ }
+ }
+ }
+ else
+ {
+ // move the handle
+ if ( pHdl && ( nX || nY ) )
+ {
+ const Point aStartPoint( pHdl->GetPos() );
+ const Point aEndPoint( pHdl->GetPos() + Point( nX, nY ) );
+ const SdrDragStat& rDragStat = pView->GetDragStat();
+
+ // start dragging
+ pView->BegDragObj( aStartPoint, 0, pHdl, 0 );
+
+ if ( pView->IsDragObj() )
+ {
+ const FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
+ const BOOL bWasSnapEnabled = pView->IsSnapEnabled();
+
+ // switch snapping off
+ if ( !bWasNoSnap )
+ ((SdrDragStat&)rDragStat).SetNoSnap( TRUE );
+ if ( bWasSnapEnabled )
+ pView->SetSnapEnabled( FALSE );
+
+ Rectangle aNewRect;
+ bool bCheck = false;
+ const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
+ for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i )
+ {
+ SdrMark* pMark = rMarkList.GetMark(i);
+ bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ if ( bCheck )
+ aNewRect.Union(pMark->GetMarkedSdrObj()->GetLastBoundRect());
+ }
+
+ switch(pHdl->GetKind())
+ {
+ case HDL_LEFT:
+ case HDL_UPLFT:
+ case HDL_LWLFT:
+ case HDL_UPPER:
+ aNewRect.Left() += nX;
+ aNewRect.Top() += nY;
+ break;
+ case HDL_UPRGT:
+ case HDL_RIGHT:
+ case HDL_LWRGT:
+ case HDL_LOWER:
+ aNewRect.setWidth(aNewRect.getWidth() + nX);
+ aNewRect.setHeight(aNewRect.getHeight() + nY);
+ break;
+ default:
+ break;
+ }
+ if ( !(bCheck && isOver(aNewRect,*pParent->getPage(),*pView)) )
+ pView->MovAction( aEndPoint );
+ pView->EndDragObj();
+
+ // restore snap
+ if ( !bWasNoSnap )
+ ((SdrDragStat&)rDragStat).SetNoSnap( bWasNoSnap );
+ if ( bWasSnapEnabled )
+ pView->SetSnapEnabled( bWasSnapEnabled );
+ }
+
+ // make moved handle visible
+ const Rectangle aVisRect( aEndPoint - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) );
+ pView->MakeVisible( aVisRect, *pParent);
+ }
+ }
+ pView->AdjustMarkHdl();
+ }
+ else
+ {
+ // scroll page
+ OScrollWindowHelper* pScrollWindow = pParent->getViewsWindow()->getView()->getScrollWindow();
+ ScrollBar* pScrollBar = ( nX != 0 ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll();
+ if ( pScrollBar && pScrollBar->IsVisible() )
+ pScrollBar->DoScrollAction(( nX < 0 || nY < 0 ) ? SCROLL_LINEUP : SCROLL_LINEDOWN );
+ }
+
+ bReturn = TRUE;
+ }
+ break;
+ default:
+ {
+ bReturn = pView->KeyInput(_rEvent, pParent);
+ }
+ break;
+ }
+
+ if ( bReturn )
+ pParent->ReleaseMouse();
+
+ return bReturn;
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::isOverlapping(const MouseEvent& rMEvt)
+{
+ bool bOverlapping = false;
+ OSectionView* pView = pParent->getView();
+ SdrViewEvent aVEvt;
+ bOverlapping = pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE;
+ return bOverlapping;
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt)
+{
+ OSectionView* pView = pParent->getView();
+ if ( pView->IsDragObj() )
+ {
+ if ( isRectangleHit(rMEvt) )
+ pView->BrkAction();
+ // object was dragged
+ pView->EndDragObj( rMEvt.IsMod1() );
+ pView->ForceMarkedToAnotherPage();
+ pParent->Invalidate();
+ }
+ else if ( pView->IsAction() )
+ pView->EndAction();
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
+{
+ OSectionView* pView = pParent->getView();
+ SdrViewEvent aVEvt;
+ const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEMOVE, aVEvt);
+ bool bIsSetPoint = (eHit == SDRHIT_UNMARKEDOBJECT);
+ if ( !bIsSetPoint )
+ {
+ // no drag rect, we have to check every single select rect
+ //const Rectangle& rRect = pView->GetDragStat().GetActionRect();
+ const SdrDragStat& rDragStat = pView->GetDragStat();
+ SdrObjListIter aIter(*pParent->getPage(),IM_DEEPNOGROUPS);
+ SdrObject* pObjIter = NULL;
+ // loop through all marked objects and check if there new rect overlapps an old one.
+ while( (pObjIter = aIter.Next()) != NULL && !bIsSetPoint)
+ {
+ if ( pView->IsObjMarked(pObjIter)
+ && dynamic_cast<OUnoObject*>(pObjIter) != NULL )
+ {
+ Rectangle aNewRect = pObjIter->GetLastBoundRect();
+ long nDx = rDragStat.IsHorFixed() ? 0 : rDragStat.GetDX();
+ long nDy = rDragStat.IsVerFixed() ? 0 : rDragStat.GetDY();
+ if ( (nDx + aNewRect.Left()) < 0 )
+ nDx = -aNewRect.Left();
+ if ( (nDy + aNewRect.Top()) < 0 )
+ nDy = -aNewRect.Top();
+
+ Point aTest;
+ rDragStat.GetDragMethod()->MovPoint(aTest);
+ if ( rDragStat.GetDragMethod()->IsMoveOnly() )
+ aNewRect.Move(nDx,nDy);
+ else
+ ::ResizeRect(aNewRect,rDragStat.GetRef1(),rDragStat.GetXFact(),rDragStat.GetYFact());
+
+
+ bIsSetPoint = isOver(aNewRect,*pParent->getPage(),*pView,false,pObjIter);
+ }
+ }
+ }
+ return bIsSetPoint;
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::setMovementPointer(const MouseEvent& rMEvt)
+{
+ bool bIsSetPoint = isRectangleHit(rMEvt);
+ if ( bIsSetPoint )
+ pParent->SetPointer( Pointer(POINTER_NOTALLOWED));
+
+ return bIsSetPoint;
+}
+//----------------------------------------------------------------------------
+
+DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) :
+ DlgEdFunc( _pParent )
+{
+ pParent->getView()->SetCreateMode( TRUE );
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncInsert::~DlgEdFuncInsert()
+{
+ pParent->getView()->SetEditMode( TRUE );
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseButtonDown(rMEvt) )
+ return TRUE;
+ if( !rMEvt.IsLeft() )
+ return TRUE;
+
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent);
+
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+ const USHORT nDrgLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+
+#ifdef MAC
+ pParent->GrabFocus();
+#endif
+ pParent->CaptureMouse();
+
+ SdrViewEvent aVEvt;
+ const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+
+ if ( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
+ {
+ SdrHdl* pHdl = pView->PickHandle(m_aMDPos);
+
+ pParent->getViewsWindow()->unmarkAllObjects(pView);
+
+ // if selected object was hit, drag object
+ if ( pHdl!=NULL || pView->IsMarkedHit(m_aMDPos, nHitLog) )
+ pView->BegDragObj(m_aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+
+ if( eHit != SDRHIT_UNMARKEDOBJECT )
+ {
+ // if no action, create object
+ if ( !pView->IsAction() )
+ {
+ if ( pView->AreObjectsMarked() )
+ pParent->getViewsWindow()->unmarkAllObjects(pView);
+ pView->BegCreateObj(m_aMDPos);
+ pParent->getViewsWindow()->createDefault();
+ }
+ }
+ else
+ {
+ if( !rMEvt.IsShift() )
+ pView->UnmarkAll();
+
+ pView->BegMarkObj( m_aMDPos );
+ }
+ }
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ DlgEdFunc::MouseButtonUp( rMEvt );
+
+ const Point aPos( pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent );
+
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+
+ pParent->ReleaseMouse();
+
+ BOOL bReturn = TRUE;
+ // object creation active?
+ if ( pView->IsCreateObj() )
+ {
+ if ( isOver(pView->GetCreateObj(),*pParent->getPage(),*pView) )
+ {
+ pView->BrkAction();
+ // BrkAction disables the create mode
+ pView->SetCreateMode( TRUE );
+ return TRUE;
+ }
+
+ pView->EndCreateObj(SDRCREATE_FORCEEND);
+
+ if ( !pView->AreObjectsMarked() )
+ {
+ pView->MarkObj(aPos, nHitLog);
+ }
+
+ bReturn = pView->AreObjectsMarked();
+ }
+ else
+ checkMovementAllowed(rMEvt);
+
+ if ( pView && !pView->AreObjectsMarked() &&
+ Abs(m_aMDPos.X() - aPos.X()) < nHitLog &&
+ Abs(m_aMDPos.Y() - aPos.Y()) < nHitLog &&
+ !rMEvt.IsShift() && !rMEvt.IsMod2() )
+ {
+ SdrPageView* pPV = pView->GetSdrPageView();
+ SdrViewEvent aVEvt;
+ pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ pView->MarkObj(aVEvt.pRootObj, pPV);
+ }
+ pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pView);
+ return bReturn;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt )
+{
+ const Point aPos( pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent );
+
+ if ( pView->IsCreateObj() )
+ {
+ pView->SetOrtho(SdrObjCustomShape::doConstructOrthogonal(pView->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift());
+ pView->SetAngleSnapEnabled(rMEvt.IsShift());
+ }
+
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+
+ bool bIsSetPoint = false;
+ if ( pView->IsAction() )
+ {
+ bIsSetPoint = setMovementPointer(rMEvt);
+ ForceScroll(aPos);
+ pView->MovAction(aPos);
+ }
+
+ //if ( isOver(pView->GetCreateObj(),*pParent->getPage(),*pView) )
+ // pParent->SetPointer( Pointer(POINTER_NOTALLOWED));
+ //else
+ if ( !bIsSetPoint )
+ pParent->SetPointer( pView->GetPreferedPointer( aPos, pParent, nHitLog ) );
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncSelect::DlgEdFuncSelect( OReportSection* _pParent ) :
+ DlgEdFunc( _pParent ),
+ bMarkAction(FALSE)
+{
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncSelect::~DlgEdFuncSelect()
+{
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseButtonDown(rMEvt) )
+ return TRUE;
+ // get view from parent
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent);
+
+ const USHORT nDrgLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+
+ if ( rMEvt.IsLeft() )
+ {
+#ifdef MAC
+ pParent->GrabFocus();
+#endif
+ pParent->CaptureMouse();
+ SdrHdl* pHdl = pView->PickHandle(m_aMDPos);
+ // hit selected object?
+ if ( (pHdl!=NULL || pView->IsMarkedHit(m_aMDPos, nHitLog)) )
+ {
+ if ( rMEvt.GetClicks() == 1 )
+ {
+ pParent->getViewsWindow()->unmarkAllObjects(pView);
+ pView->BegDragObj(m_aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ }
+ // TODO character in shapes
+ //else
+ //{
+ // SdrViewEvent aVEvt;
+ // pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) )
+ // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, FALSE);
+ //}
+
+ }
+ else
+ {
+ SdrViewEvent aVEvt;
+ const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ if( eHit == SDRHIT_UNMARKEDOBJECT )
+ {
+ // if not multi selection, unmark all
+ if ( !rMEvt.IsShift() )
+ pParent->getViewsWindow()->unmarkAllObjects(NULL);
+
+ if ( pView->MarkObj(m_aMDPos, nHitLog) && rMEvt.IsLeft() )
+ {
+ // drag object
+ pHdl = pView->PickHandle(m_aMDPos);
+ pView->BegDragObj(m_aMDPos, (OutputDevice*) NULL, pHdl, nDrgLog);
+ }
+ else
+ {
+ // select object
+ pView->BegMarkObj(m_aMDPos);
+ bMarkAction = TRUE;
+ }
+ }
+ else
+ {
+ if( !rMEvt.IsShift() )
+ pParent->getViewsWindow()->unmarkAllObjects(NULL);
+ //pView->UnmarkAll();
+
+ if ( rMEvt.GetClicks() == 1 )
+ pView->BegMarkObj( m_aMDPos );
+ else
+ pView->SdrBeginTextEdit( aVEvt.pRootObj,pView->GetSdrPageView(),pParent,sal_False );
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ DlgEdFunc::MouseButtonUp( rMEvt );
+
+ // get view from parent
+ const Point aPnt( pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent );
+
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+
+ if ( rMEvt.IsLeft() )
+ checkMovementAllowed(rMEvt);
+
+ bMarkAction = FALSE;
+
+ if ( pView && pView->IsAction() )
+ pView->EndAction();
+
+ pParent->SetPointer( pView->GetPreferedPointer( aPnt, pParent, nHitLog ) );
+ pParent->ReleaseMouse();
+
+ pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pView);
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt )
+{
+ OSectionView* pView = pParent->getView();
+ pView->SetActualWin( pParent);
+
+ const Point aPnt( pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ bool bIsSetPoint = false;
+
+ if ( pView->IsAction() )
+ {
+ bIsSetPoint = setMovementPointer(rMEvt);
+ ForceScroll(aPnt);
+ pView->MovAction(aPnt);
+ }
+
+ if ( !bIsSetPoint )
+ {
+ const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() );
+ pParent->SetPointer( pView->GetPreferedPointer( aPnt, pParent, nHitLog ) );
+ }
+
+ return TRUE;
+}
+// -----------------------------------------------------------------------------
+//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag)
+//{
+// OSectionView* pView = pParent->getView();
+// pView->SetActualWin( pParent);
+//
+// SdrPageView* pPV = pView->GetSdrPageView();
+// if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() )
+// {
+// pView->SetCurrentObj(OBJ_TEXT);
+// pView->SetEditMode(SDREDITMODE_EDIT);
+//
+// BOOL bEmptyOutliner = FALSE;
+//
+// if (!_pTextObj->GetOutlinerParaObject() && pView->GetTextEditOutliner())
+// {
+// ::SdrOutliner* pOutl = pView->GetTextEditOutliner();
+// ULONG nParaAnz = pOutl->GetParagraphCount();
+// Paragraph* p1stPara = pOutl->GetParagraph( 0 );
+//
+// if (nParaAnz==1 && p1stPara)
+// {
+// // Bei nur einem Pararaph
+// if (pOutl->GetText(p1stPara).Len() == 0)
+// {
+// bEmptyOutliner = TRUE;
+// }
+// }
+// }
+//
+// if (_pTextObj != pView->GetTextEditObject() || bEmptyOutliner)
+// {
+// UINT32 nInv = _pTextObj->GetObjInventor();
+// UINT16 nSdrObjKind = _pTextObj->GetObjIdentifier();
+//
+// if (nInv == SdrInventor && _pTextObj->HasTextEdit() &&
+// (nSdrObjKind == OBJ_TEXT ||
+// nSdrObjKind == OBJ_TITLETEXT ||
+// nSdrObjKind == OBJ_OUTLINETEXT ||
+// (_pTextObj->ISA(SdrTextObj) && !_pTextObj->IsEmptyPresObj())))
+// {
+// // Neuen Outliner machen (gehoert der SdrObjEditView)
+// SdrModel* pModel = _pTextObj->GetModel();
+// SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, pModel );
+// pOutl->SetMinDepth(0);
+// pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pModel->GetStyleSheetPool());
+// //pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
+// ULONG nCntrl = pOutl->GetControlWord();
+// nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
+// nCntrl |= EE_CNTRL_URLSFXEXECUTE;
+// nCntrl |= EE_CNTRL_MARKFIELDS;
+// nCntrl |= EE_CNTRL_AUTOCORRECT;
+//
+// nCntrl &= ~EE_CNTRL_ULSPACESUMMATION;
+// //if ( pModel->IsSummationOfParagraphs() )
+// // nCntrl |= EE_CNTRL_ULSPACESUMMATION;
+//
+// //SetSpellOptions( nCntrl );
+//
+// pOutl->SetControlWord(nCntrl);
+//
+// uno::Reference< linguistic2::XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
+// if ( xSpellChecker.is() )
+// pOutl->SetSpeller( xSpellChecker );
+//
+// uno::Reference< linguistic2::XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
+// if( xHyphenator.is() )
+// pOutl->SetHyphenator( xHyphenator );
+//
+// pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
+//
+// // in einem Gliederungstext darf nicht auf die 0-te
+// // Ebene ausgerueckt werden
+// if (_pTextObj->GetObjInventor() == SdrInventor &&
+// _pTextObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
+// {
+// pOutl->SetMinDepth(1);
+// }
+//
+// if (bEmptyOutliner)
+// {
+// pView->SdrEndTextEdit(sal_True);
+// }
+//
+// if( _pTextObj )
+// {
+// OutlinerParaObject* pOPO = _pTextObj->GetOutlinerParaObject();
+// if( ( pOPO && pOPO->IsVertical() ) /*||
+// nSlotId == SID_ATTR_CHAR_VERTICAL ||
+// nSlotId == SID_TEXT_FITTOSIZE_VERTICAL */)
+// pOutl->SetVertical( TRUE );
+//
+//
+// if (pView->SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor)
+// {
+// //bFirstObjCreated = TRUE;
+// //DeleteDefaultText();
+//
+// OutlinerView* pOLV = pView->GetTextEditOutlinerView();
+//
+// nSdrObjKind = _pTextObj->GetObjIdentifier();
+//
+// SdrViewEvent aVEvt;
+// SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+//
+// if (eHit == SDRHIT_TEXTEDIT)
+// {
+// // Text getroffen
+// if (nSdrObjKind == OBJ_TEXT ||
+// nSdrObjKind == OBJ_TITLETEXT ||
+// nSdrObjKind == OBJ_OUTLINETEXT ||
+// //nSlotId == SID_TEXTEDIT ||
+// !bQuickDrag)
+// {
+// pOLV->MouseButtonDown(rMEvt);
+// pOLV->MouseMove(rMEvt);
+// pOLV->MouseButtonUp(rMEvt);
+// }
+//
+// if ( bQuickDrag && _pTextObj->GetOutlinerParaObject())
+// {
+// pOLV->MouseButtonDown(rMEvt);
+// }
+// }
+// else
+// {
+// // #98198# Move cursor to end of text
+// ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
+// pOLV->SetSelection(aNewSelection);
+// }
+// }
+// else
+// {
+// //RestoreDefaultText();
+// }
+// }
+// }
+// }
+// }
+// else
+// _pTextObj = NULL;
+//}
+
+
+//----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/ui/report/makefile.mk b/reportdesign/source/ui/report/makefile.mk
new file mode 100644
index 000000000000..53dab612cc48
--- /dev/null
+++ b/reportdesign/source/ui/report/makefile.mk
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=report
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+IMGLST_SRS=$(SRS)$/$(TARGET).srs
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/ReportController.obj \
+ $(SLO)$/ReportSection.obj \
+ $(SLO)$/SectionView.obj \
+ $(SLO)$/ViewsWindow.obj \
+ $(SLO)$/SectionsWindow.obj \
+ $(SLO)$/ScrollHelper.obj \
+ $(SLO)$/StartMarker.obj \
+ $(SLO)$/EndMarker.obj \
+ $(SLO)$/dlgedfunc.obj \
+ $(SLO)$/dlgedfac.obj \
+ $(SLO)$/dlgedclip.obj \
+ $(SLO)$/ReportWindow.obj \
+ $(SLO)$/DesignView.obj \
+ $(SLO)$/propbrw.obj
+
+
+SRS1NAME=$(TARGET)
+SRC1FILES = report.src
+
+# --- Targets -------------------------------------------------------
+
+
+.INCLUDE : target.mk
+
+$(SRS)$/$(TARGET).srs: $(SOLARINCDIR)$/svx$/globlmn.hrc
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
new file mode 100644
index 000000000000..73fa89fc8fdd
--- /dev/null
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -0,0 +1,679 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: propbrw.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef _REPORT_PROPBRW_HXX
+#include "propbrw.hxx"
+#endif
+
+#ifndef _REPORT_RPTUIOBJ_HXX
+#include "RptObject.hxx"
+#endif
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#include "ReportController.hxx"
+#endif
+#ifndef _CPPUHELPER_COMPONENT_CONTEXT_HXX_
+#include <cppuhelper/component_context.hxx>
+#endif
+#ifndef _REPORT_DLGRESID_HRC
+#include <RptResId.hrc>
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XLAYOUTCONSTRAINS_HPP_
+#include <com/sun/star/awt/XLayoutConstrains.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_OBJECTINSPECTOR_HPP_
+#include <com/sun/star/inspection/ObjectInspector.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSPECTION_DEFAULTHELPPROVIDER_HPP_
+#include <com/sun/star/inspection/DefaultHelpProvider.hpp>
+#endif
+#ifndef _SVX_SVXIDS_HRC
+#include <svx/svxids.hrc>
+#endif
+
+#ifndef _VCL_STDTEXT_HXX
+#include <vcl/stdtext.hxx>
+#endif
+
+#ifndef _SVDVIEW_HXX //autogen
+#include <svx/svdview.hxx>
+#endif
+
+#ifndef _SVDOGRP_HXX
+#include <svx/svdogrp.hxx>
+#endif
+
+#ifndef _SVDPAGE_HXX
+#include <svx/svdpage.hxx>
+#endif
+
+#ifndef _SVDITER_HXX
+#include <svx/svditer.hxx>
+#endif
+
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/unohlp.hxx>
+#endif
+
+#ifndef _COMPHELPER_PROPERTY_HXX_
+#include <comphelper/property.hxx>
+#endif
+#ifndef _COMPHELPER_NAMECONTAINER_HXX_
+#include <comphelper/namecontainer.hxx>
+#endif
+#ifndef _COMPHELPER_COMPOSEDPROPS_HXX_
+#include <comphelper/composedprops.hxx>
+#endif
+
+#ifndef _COMPHELPER_STLTYPES_HXX_
+#include <comphelper/stl_types.hxx>
+#endif
+
+#ifndef _COMPHELPER_TYPES_HXX_
+#include <comphelper/types.hxx>
+#endif
+#include <comphelper/sequence.hxx>
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
+#include <com/sun/star/awt/PosSize.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REPORT_INSPECTION_DEFAULTCOMPONENTINSPECTORMODEL_HPP_
+#include <com/sun/star/report/inspection/DefaultComponentInspectorModel.hpp>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _REPORT_SECTIONVIEW_HXX
+#include "SectionView.hxx"
+#endif
+#ifndef REPORT_REPORTSECTION_HXX
+#include "ReportSection.hxx"
+#endif
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#ifndef RPTUI_DESIGNVIEW_HXX
+#include "DesignView.hxx"
+#endif
+#include "ViewsWindow.hxx"
+#include "UITools.hxx"
+#ifndef _UNOTOOLS_CONFIGNODE_HXX_
+#include <unotools/confignode.hxx>
+#endif
+
+namespace rptui
+{
+#define STD_WIN_SIZE_X 300
+#define STD_WIN_SIZE_Y 350
+
+using namespace ::com::sun::star;
+using namespace uno;
+using namespace lang;
+using namespace frame;
+using namespace beans;
+using namespace container;
+using namespace ::comphelper;
+
+//----------------------------------------------------------------------------
+//-----------------------------------------------------------------------
+namespace
+{
+ static bool lcl_shouldEnableHelpSection( const Reference< XMultiServiceFactory >& _rxFactory )
+ {
+ const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/PropertyBrowser/" ) );
+ const ::rtl::OUString sPropertyName( RTL_CONSTASCII_USTRINGPARAM( "DirectHelp" ) );
+
+ ::utl::OConfigurationTreeRoot aConfiguration(
+ ::utl::OConfigurationTreeRoot::createWithServiceFactory( _rxFactory, sConfigName ) );
+
+ bool bEnabled = false;
+ OSL_VERIFY( aConfiguration.getNodeValue( sPropertyName ) >>= bEnabled );
+ return bEnabled;
+ }
+}
+//-----------------------------------------------------------------------
+
+//============================================================================
+// PropBrw
+//============================================================================
+
+DBG_NAME( rpt_PropBrw )
+
+//----------------------------------------------------------------------------
+
+PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParent,ODesignView* _pDesignView)
+ :DockingWindow(pParent,WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_3DLOOK|WB_ROLLABLE))
+ ,m_xORB(_xORB)
+ ,m_pDesignView(_pDesignView)
+ ,m_pView( NULL )
+ ,m_bInitialStateChange(sal_True)
+{
+ DBG_CTOR( rpt_PropBrw,NULL);
+
+ Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y);
+ SetOutputSizePixel(aPropWinSize);
+
+ try
+ {
+ // create a frame wrapper for myself
+ m_xMeAsFrame = Reference< XFrame >(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame"))), UNO_QUERY);
+ if (m_xMeAsFrame.is())
+ {
+ m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) );
+ m_xMeAsFrame->setName(::rtl::OUString::createFromAscii("report property browser")); // change name!
+ }
+ }
+ catch (Exception&)
+ {
+ DBG_ERROR("PropBrw::PropBrw: could not create/initialize my frame!");
+ m_xMeAsFrame.clear();
+ }
+
+ if (m_xMeAsFrame.is())
+ {
+ try
+ {
+ Sequence< Any > aArgs(1);
+ aArgs[0] <<= PropertyValue(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")),
+ 0,
+ makeAny(VCLUnoHelper::GetInterface ( this )),
+ PropertyState_DIRECT_VALUE
+ );
+ // our own component context
+ Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW );
+ Reference< XComponentContext > xOwnContext(
+ xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
+ UNO_QUERY_THROW );
+
+ // a ComponentContext for the
+ ::cppu::ContextEntry_Init aHandlerContextInfo[] =
+ {
+ ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) ), makeAny( m_pDesignView->getController()->getModel() ) ),
+ ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) ), makeAny( VCLUnoHelper::GetInterface ( this ) ) ),
+ ::cppu::ContextEntry_Init( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) ), makeAny( m_pDesignView->getController()->getConnection() ) ),
+ };
+ Reference< XComponentContext > xInspectorContext(
+ ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ),
+ xOwnContext ) );
+ // create a property browser controller
+ bool bEnableHelpSection = lcl_shouldEnableHelpSection( m_xORB );
+ Reference< inspection::XObjectInspectorModel> xInspectorModel( bEnableHelpSection
+ ? report::inspection::DefaultComponentInspectorModel::createWithHelpSection( xInspectorContext, 3, 8 )
+ : report::inspection::DefaultComponentInspectorModel::createDefault( xInspectorContext ) );
+
+ m_xBrowserController = inspection::ObjectInspector::createWithModel(xInspectorContext, xInspectorModel);
+ if ( !m_xBrowserController.is() )
+ {
+ const ::rtl::OUString sServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.inspection.ObjectInspector" ) );
+ ShowServiceNotAvailableError(pParent, sServiceName, sal_True);
+ }
+ else
+ {
+ m_xBrowserController->attachFrame(m_xMeAsFrame);
+ m_xBrowserComponentWindow = m_xMeAsFrame->getComponentWindow();
+ OSL_ENSURE(m_xBrowserComponentWindow.is(), "PropBrw::PropBrw: attached the controller, but have no component window!");
+ if ( bEnableHelpSection )
+ {
+ uno::Reference< inspection::XObjectInspector > xInspector( m_xBrowserController, uno::UNO_QUERY_THROW );
+ uno::Reference< inspection::XObjectInspectorUI > xInspectorUI( xInspector->getInspectorUI() );
+ uno::Reference< uno::XInterface > xDefaultHelpProvider( inspection::DefaultHelpProvider::create( xInspectorContext, xInspectorUI ) );
+ }
+ }
+ }
+ catch (Exception&)
+ {
+ DBG_ERROR("PropBrw::PropBrw: could not create/initialize the browser controller!");
+ try
+ {
+ ::comphelper::disposeComponent(m_xBrowserController);
+ ::comphelper::disposeComponent(m_xBrowserComponentWindow);
+ }
+ catch(Exception&) { }
+ m_xBrowserController.clear();
+ m_xBrowserComponentWindow.clear();
+ }
+ }
+
+ if (m_xBrowserComponentWindow.is())
+ {
+
+ m_xBrowserComponentWindow->setPosSize(0, 0, aPropWinSize.Width(), aPropWinSize.Height(),
+ awt::PosSize::WIDTH | awt::PosSize::HEIGHT | awt::PosSize::X | awt::PosSize::Y);
+ Resize();
+ m_xBrowserComponentWindow->setVisible(sal_True);
+ }
+ ::rptui::notifySystemWindow(pParent,this,::comphelper::mem_fun(&TaskPaneList::AddWindow));
+}
+
+//----------------------------------------------------------------------------
+
+PropBrw::~PropBrw()
+{
+ if (m_xBrowserController.is())
+ implDetachController();
+
+ ::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+
+ DBG_DTOR( rpt_PropBrw,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+void PropBrw::implDetachController()
+{
+ m_sLastActivePage = getCurrentPage();
+ implSetNewObject( );
+
+ if ( m_xMeAsFrame.is() )
+ m_xMeAsFrame->setComponent( NULL, NULL );
+
+ if ( m_xBrowserController.is() )
+ m_xBrowserController->attachFrame( NULL );
+
+ m_xBrowserController.clear();
+ m_xMeAsFrame.clear();
+}
+//-----------------------------------------------------------------------
+::rtl::OUString PropBrw::getCurrentPage() const
+{
+ ::rtl::OUString sCurrentPage;
+ try
+ {
+ if ( m_xBrowserController.is() )
+ {
+ OSL_VERIFY( m_xBrowserController->getViewData() >>= sCurrentPage );
+ }
+
+ if ( !sCurrentPage.getLength() )
+ sCurrentPage = m_sLastActivePage;
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" );
+ }
+ return sCurrentPage;
+}
+//----------------------------------------------------------------------------
+
+sal_Bool PropBrw::Close()
+{
+ m_xLastSection.clear();
+ // suspend the controller (it is allowed to veto)
+ if ( m_xMeAsFrame.is() )
+ {
+ try
+ {
+ Reference< XController > xController( m_xMeAsFrame->getController() );
+ if ( xController.is() && !xController->suspend( sal_True ) )
+ return sal_False;
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "FmPropBrw::Close: caught an exception while asking the controller!" );
+ }
+ }
+ implDetachController();
+
+ if( IsRollUp() )
+ RollDown();
+
+ m_pDesignView->getController()->executeUnChecked(SID_PROPERTYBROWSER_LAST_PAGE,uno::Sequence< beans::PropertyValue>());
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const SdrMarkList& _rMarkList)
+{
+ sal_uInt32 nMarkCount = _rMarkList.GetMarkCount();
+ ::std::vector< uno::Reference< uno::XInterface> > aSets;
+ aSets.reserve(nMarkCount);
+
+ for(sal_uInt32 i=0;i<nMarkCount;++i)
+ {
+ SdrObject* pCurrent = _rMarkList.GetMark(i)->GetMarkedSdrObj();
+
+ ::std::auto_ptr<SdrObjListIter> pGroupIterator;
+ if (pCurrent->IsGroupObject())
+ {
+ pGroupIterator.reset(new SdrObjListIter(*pCurrent->GetSubList()));
+ pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
+ }
+
+ while (pCurrent)
+ {
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(pCurrent);
+ if ( pObj )
+ aSets.push_back(CreateComponentPair(pObj));
+
+ // next element
+ pCurrent = pGroupIterator.get() && pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
+ }
+ }
+ Reference<uno::XInterface> *pSets = aSets.empty() ? NULL : &aSets[0];
+ return uno::Sequence< Reference<uno::XInterface> >(pSets, aSets.size());
+}
+//----------------------------------------------------------------------------
+void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> >& _aObjects )
+{
+ if ( m_xBrowserController.is() )
+ {
+ m_xBrowserController->inspect(uno::Sequence< Reference<uno::XInterface> >());
+ m_xBrowserController->inspect(_aObjects);
+
+ Resize();
+ }
+ SetText( GetHeadlineName(_aObjects) );
+}
+
+//----------------------------------------------------------------------------
+
+::rtl::OUString PropBrw::GetHeadlineName( const uno::Sequence< Reference<uno::XInterface> >& _aObjects )
+{
+ ::rtl::OUString aName;
+ if ( !_aObjects.getLength() )
+ {
+ aName = String(ModuleRes(RID_STR_BRWTITLE_NO_PROPERTIES));
+ }
+ else if ( _aObjects.getLength() == 1 ) // single selection
+ {
+ sal_uInt16 nResId = 0;
+ aName = String(ModuleRes(RID_STR_BRWTITLE_PROPERTIES));
+
+ uno::Reference< container::XNameContainer > xNameCont(_aObjects[0],uno::UNO_QUERY);
+ Reference< lang::XServiceInfo > xServiceInfo( xNameCont->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent"))), UNO_QUERY );
+ if ( xServiceInfo.is() )
+ {
+ if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ) )
+ {
+ nResId = RID_STR_PROPTITLE_FIXEDTEXT;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL ) )
+ {
+ nResId = RID_STR_PROPTITLE_IMAGECONTROL;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ) )
+ {
+ nResId = RID_STR_PROPTITLE_FORMATTED;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_SHAPE ) )
+ {
+ nResId = RID_STR_PROPTITLE_SHAPE;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) )
+ {
+ nResId = RID_STR_PROPTITLE_REPORT;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_SECTION ) )
+ {
+ nResId = RID_STR_PROPTITLE_SECTION;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_FUNCTION ) )
+ {
+ nResId = RID_STR_PROPTITLE_FUNCTION;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_GROUP ) )
+ {
+ nResId = RID_STR_PROPTITLE_GROUP;
+ }
+ else if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE ) )
+ {
+ nResId = RID_STR_PROPTITLE_FIXEDLINE;
+ }
+ else
+ {
+ OSL_ENSURE(0,"Unknown service name!");
+ nResId = RID_STR_CLASS_FORMATTEDFIELD;
+ }
+
+ if (nResId)
+ {
+ aName += String(ModuleRes(nResId));
+ }
+ }
+ }
+ else // multiselection
+ {
+ aName = String(ModuleRes(RID_STR_BRWTITLE_PROPERTIES));
+ aName += String(ModuleRes(RID_STR_BRWTITLE_MULTISELECT));
+ }
+
+ return aName;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface> PropBrw::CreateComponentPair(OObjectBase* _pObj)
+{
+ return CreateComponentPair(_pObj->getAwtComponent(),_pObj->getReportComponent());
+}
+//----------------------------------------------------------------------------
+uno::Reference< uno::XInterface> PropBrw::CreateComponentPair(const uno::Reference< uno::XInterface>& _xFormComponent
+ ,const uno::Reference< uno::XInterface>& _xReportComponent)
+{
+ uno::Reference< container::XNameContainer > xNameCont = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast<Reference<XInterface> * >(NULL)));
+ xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormComponent")),uno::makeAny(_xFormComponent));
+ xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent")),uno::makeAny(_xReportComponent));
+ xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RowSet"))
+ ,uno::makeAny(uno::Reference< uno::XInterface>(m_pDesignView->getController()->getRowSet())));
+
+ return xNameCont.get();
+}
+//----------------------------------------------------------------------------
+void PropBrw::Resize()
+{
+ Window::Resize();
+
+ Reference< awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY );
+ if( xLayoutConstrains.is() )
+ {
+ ::Size aSize;
+ awt::Size aMinSize = xLayoutConstrains->getMinimumSize();
+ aMinSize.Height += 4;
+ aMinSize.Width += 4;
+ aSize.setHeight( aMinSize.Height );
+ aSize.setWidth( aMinSize.Width );
+ SetMinOutputSizePixel( aSize );
+ aSize = GetOutputSizePixel();
+ sal_Bool bResize = sal_False;
+ if( aSize.Width() < aMinSize.Width )
+ {
+ aSize.setWidth( aMinSize.Width );
+ bResize = sal_True;
+ }
+ if( aSize.Height() < aMinSize.Height )
+ {
+ aSize.setHeight( aMinSize.Height );
+ bResize = sal_True;
+ }
+ if( bResize )
+ SetOutputSizePixel( aSize );
+ }
+ // adjust size
+ if (m_xBrowserComponentWindow.is())
+ {
+ Size aSize = GetOutputSizePixel();
+ m_xBrowserComponentWindow->setPosSize(0, 0, aSize.Width(), aSize.Height(),
+ awt::PosSize::WIDTH | awt::PosSize::HEIGHT);
+ }
+}
+//----------------------------------------------------------------------------
+void PropBrw::Update( OSectionView* pNewView )
+{
+ try
+ {
+ if ( m_pView )
+ {
+ EndListening( *(m_pView->GetModel()) );
+ m_pView = NULL;
+ }
+
+ // set focus on initialization
+ if ( m_bInitialStateChange )
+ {
+ // if we're just newly created, we want to have the focus
+ PostUserEvent( LINK( this, PropBrw, OnAsyncGetFocus ) );
+ m_bInitialStateChange = sal_False;
+ // and additionally, we want to show the page which was active during
+ // our previous incarnation
+ if ( m_sLastActivePage.getLength() && m_xBrowserController.is() )
+ {
+ try
+ {
+ m_xBrowserController->restoreViewData( makeAny( m_sLastActivePage ) );
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
+ }
+ }
+ }
+
+ if ( !pNewView )
+ return;
+ else
+ m_pView = pNewView;
+
+ uno::Sequence< Reference<uno::XInterface> > aMarkedObjects;
+ OViewsWindow* pViews = m_pView->getSectionWindow()->getViewsWindow();
+ const USHORT nSectionCount = pViews->getSectionCount();
+ for (USHORT i = 0; i < nSectionCount; ++i)
+ {
+ ::boost::shared_ptr<OReportSection> pReportSection = pViews->getSection(i);
+ if ( pReportSection )
+ {
+ const SdrMarkList& rMarkList = pReportSection->getView()->GetMarkedObjectList();
+ aMarkedObjects = ::comphelper::concatSequences(aMarkedObjects,CreateCompPropSet( rMarkList ));
+ }
+ }
+
+ // if ( nMarkCount == 1 )
+ // {
+ // m_xLastSection.clear();
+ // SdrObject* pDlgEdObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+ // OObjectBase* pObj = dynamic_cast<OObjectBase*>(pDlgEdObj);
+ // if ( pObj )
+ // {
+ // if ( pDlgEdObj && pDlgEdObj->IsGroupObject() )
+ // {
+ // implSetNewObject( CreateCompPropSet( rMarkList ) );
+ // }
+ // else // single selection
+ // {
+ // uno::Reference< uno::XInterface > xTemp = CreateComponentPair(pObj);
+ // implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) );
+ // }
+ // }
+ // else
+ // {
+ // implSetNewObject( );
+ // }
+ //}
+ // else
+ if ( aMarkedObjects.getLength() ) // multiple selection
+ {
+ m_xLastSection.clear();
+ implSetNewObject( aMarkedObjects );
+ }
+ else if ( m_xLastSection != m_pView->getSectionWindow()->getSection() )
+ {
+ uno::Reference< uno::XInterface> xTemp(m_pView->getSectionWindow()->getSection());
+ m_xLastSection = xTemp;
+ uno::Reference< container::XNameContainer > xNameCont = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast<Reference<XInterface> * >(NULL)));
+ xNameCont->insertByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent")),uno::makeAny(xTemp));
+ xTemp = xNameCont;
+
+ implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) );
+ }
+
+ StartListening( *(m_pView->GetModel()) );
+ }
+ catch ( Exception& )
+ {
+ DBG_ERROR( "PropBrw::Update: Exception occured!" );
+ }
+}
+//----------------------------------------------------------------------------
+void PropBrw::Update( const uno::Reference< uno::XInterface>& _xReportComponent)
+{
+ if ( m_xLastSection != _xReportComponent )
+ {
+ m_xLastSection = _xReportComponent;
+ try
+ {
+ if ( m_pView )
+ {
+ EndListening( *(m_pView->GetModel()) );
+ m_pView = NULL;
+ } // if ( m_pView )
+
+ uno::Reference< uno::XInterface> xTemp(CreateComponentPair(_xReportComponent,_xReportComponent));
+ implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) );
+ }
+ catch ( Exception& )
+ {
+ DBG_ERROR( "PropBrw::Update: Exception occured!" );
+ }
+ }
+}
+//-----------------------------------------------------------------------
+IMPL_LINK( PropBrw, OnAsyncGetFocus, void*, )
+{
+ if (m_xBrowserComponentWindow.is())
+ m_xBrowserComponentWindow->setFocus();
+ return 0L;
+}
+//----------------------------------------------------------------------------
+void PropBrw::LoseFocus()
+{
+ DockingWindow::LoseFocus();
+ m_pDesignView->getController()->InvalidateAll();
+}
+//----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/ui/report/report.src b/reportdesign/source/ui/report/report.src
new file mode 100644
index 000000000000..fea27cbb1494
--- /dev/null
+++ b/reportdesign/source/ui/report/report.src
@@ -0,0 +1,708 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: report.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:33 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+
+// Dialog Controls ---------------------------------------------------------------
+
+String RID_STR_CLASS_FIXEDTEXT
+{
+ Text = "Label" ;
+};
+String RID_STR_CLASS_FIXEDLINE
+{
+ Text = "Line" ;
+};
+String RID_STR_CLASS_IMAGECONTROL
+{
+ Text = "Graphic" ;
+};
+String RID_STR_CLASS_FORMATTEDFIELD
+{
+ Text = "FormattedField" ;
+};
+
+
+// Property Browser Headline ----------------------------------------------------------------
+
+String RID_STR_BRWTITLE_PROPERTIES
+{
+ Text [ de ] = "Eigenschaften: " ;
+ Text [ en-US ] = "Properties: ";
+};
+String RID_STR_BRWTITLE_NO_PROPERTIES
+{
+ Text [ de ] = "Kein Kontrollelement markiert" ;
+ Text [ en-US ] = "No Control marked";
+};
+String RID_STR_BRWTITLE_MULTISELECT
+{
+ Text [ de ] = "Mehrfachselektion" ;
+ Text [ en-US ] = "Multiselection";
+};
+
+String RID_STR_PROPTITLE_IMAGECONTROL
+{
+ Text [ de ] = "Grafisches Kontrollfeld" ;
+ Text [ en-US ] = "Image Control" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_FIXEDTEXT
+{
+ Text [ de ] = "Beschriftungsfeld" ;
+ Text [ en-US ] = "Label field" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_FIXEDLINE
+{
+ Text [ de ] = "Linie" ;
+ Text [ en-US ] = "Line" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_FORMATTED
+{
+ Text [ de ] = "Formatiertes Feld" ;
+ Text [ en-US ] = "Formatted Field";
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_SHAPE
+{
+ Text [ de ] = "Symbol" ;
+ Text [ en-US ] = "Shape";
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_REPORT
+{
+ Text [ de ] = "Bericht";
+ Text [ en-US ] = "Report";
+};
+String RID_STR_PROPTITLE_SECTION
+{
+ Text [ de ] = "Bereich";
+ Text [ en-US ] = "Section";
+};
+String RID_STR_PROPTITLE_FUNCTION
+{
+ Text [ de ] = "Funktion";
+ Text [ en-US ] = "Function";
+};
+String RID_STR_PROPTITLE_GROUP
+{
+ Text [ de ] = "Gruppe";
+ Text [ en-US ] = "Group";
+};
+// -----------------------------------------------------------------------
+
+Image RID_IMG_TREENODE_COLLAPSED
+{
+ ImageBitmap = Bitmap { File = "plus.bmp"; } ;
+ MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; };
+};
+
+Image RID_IMG_TREENODE_EXPANDED
+{
+ ImageBitmap = Bitmap { File = "minus.bmp"; } ;
+ MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; };
+};
+
+Image RID_IMG_TREENODE_COLLAPSED_HC
+{
+ ImageBitmap = Bitmap { File = "plus_sch.bmp"; } ;
+ MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; };
+};
+
+Image RID_IMG_TREENODE_EXPANDED_HC
+{
+ ImageBitmap = Bitmap { File = "minus_sch.bmp"; } ;
+ MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; };
+};
+
+String STR_SHOW_RULER
+{
+ Text [ de ] = "Lineal anzeigen" ;
+ Text [ en-US ] = "Show ruler";
+};
+
+String STR_SHOW_GRID
+{
+ Text [ de ] = "Gitter anzeigen" ;
+ Text [ en-US ] = "Show grid";
+};
+
+String RID_STR_UNDO_CHANGEPOSITION
+{
+ Text [ de ] = "Objekt verändern" ;
+ Text [ en-US ] = "Change Object";
+};
+String RID_STR_UNDO_MOVE_GROUP
+{
+ Text [ de ] = "Gruppe(n) verschieben" ;
+ Text [ en-US ] = "Move Group(s)";
+};
+String RID_STR_UNDO_CONDITIONAL_FORMATTING
+{
+ Text [ de ] = "Bedingte Formatierung" ;
+ Text [ en-US ] = "Conditional Formatting";
+};
+String RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER
+{
+ Text [ de ] = "Berichtskopf,-fuß löschen" ;
+ Text [ en-US ] = "Remove report header / report footer";
+};
+
+String RID_STR_UNDO_ADD_REPORTHEADERFOOTER
+{
+ Text [ de ] = "Berichtskopf,-fuß hinzufügen" ;
+ Text [ en-US ] = "Add report header / report footer";
+};
+
+String RID_STR_UNDO_REMOVE_PAGEHEADERFOOTER
+{
+ Text [ de ] = "Seitenkopf,-fuß löschen" ;
+ Text [ en-US ] = "Remove page header / page footer";
+};
+
+String RID_STR_UNDO_ADD_PAGEHEADERFOOTER
+{
+ Text [ de ] = "Seitenkopf,-fuß hinzufügen" ;
+ Text [ en-US ] = "Add page header / page footer";
+};
+
+String RID_STR_UNDO_PROPERTY
+{
+ Text [ de ] = "Eigenschaft '#' ändern" ;
+ Text [ en-US ] = "Change property '#'";
+ Text = "The # character is used for replacing";
+};
+
+String RID_STR_UNDO_ADD_GROUP_HEADER
+{
+ Text [ de ] = "Gruppenkopf hinzufügen " ;
+ Text [ en-US ] = "Add group header ";
+};
+
+String RID_STR_UNDO_REMOVE_GROUP_HEADER
+{
+ Text [ de ] = "Gruppenkopf löschen " ;
+ Text [ en-US ] = "Remove group header ";
+};
+
+String RID_STR_UNDO_ADD_GROUP_FOOTER
+{
+ Text [ de ] = "Gruppenfuß hinzufügen " ;
+ Text [ en-US ] = "Add group footer ";
+};
+
+String RID_STR_UNDO_REMOVE_GROUP_FOOTER
+{
+ Text [ de ] = "Gruppenfuß löschen " ;
+ Text [ en-US ] = "Remove group footer ";
+};
+String RID_STR_UNDO_ADDFUNCTION
+{
+ Text [ de ] = "Funktion hinzufügen" ;
+ Text [ en-US ] = "Add function";
+};
+
+String RID_STR_UNDO_DELETEFUNCTION
+{
+ Text [ de ] = "Funktion löschen" ;
+ Text [ en-US ] = "Delete function";
+};
+
+String RID_STR_DESIGN_VIEW
+{
+ Text [ de ] = "Entwurf" ;
+ Text [ en-US ] = "Design";
+};
+
+String RID_STR_PREVIEW_VIEW
+{
+ Text [ de ] = "Vorschau" ;
+ Text [ en-US ] = "Preview";
+};
+
+String STR_RPT_TITLE
+{
+ Text [ de ] = "Bericht #" ;
+ Text [ en-US ] = "Report #" ;
+ Text [ x-comment ] = " ";
+};
+
+String STR_RPT_LABEL
+{
+ Text [ de ] ="~Name des Berichts" ;
+ Text [ en-US ] = "~Report name" ;
+};
+
+String RID_STR_UNDO_REMOVE_GROUP
+{
+ Text [ de ] ="Gruppe löschen" ;
+ Text [ en-US ] = "Delete Group" ;
+};
+
+String RID_STR_UNDO_APPEND_GROUP
+{
+ Text [ de ] ="Gruppe hinzufügen" ;
+ Text [ en-US ] = "Add Group" ;
+};
+
+String RID_STR_UNDO_REMOVE_SELECTION
+{
+ Text [ de ] ="Auswahl löschen" ;
+ Text [ en-US ] = "Delete Selection" ;
+};
+String RID_STR_UNDO_REMOVE_FUNCTION
+{
+ Text [ de ] ="Funktion löschen" ;
+ Text [ en-US ] = "Delete Function" ;
+};
+
+String RID_STR_UNDO_CHANGE_SIZE
+{
+ Text [ de ] ="Größe ändern" ;
+ Text [ en-US ] = "Change Size" ;
+};
+
+String RID_STR_UNDO_PASTE
+{
+ Text [ de ] ="Einfügen" ;
+ Text [ en-US ] = "Paste" ;
+};
+
+String RID_STR_UNDO_INSERT_CONTROL
+{
+ Text [ de ] ="Steuerelement Einfügen" ;
+ Text [ en-US ] = "Insert Control" ;
+};
+
+String RID_STR_UNDO_DELETE_CONTROL
+{
+ Text [ de ] ="Steuerelement Löschen" ;
+ Text [ en-US ] = "Delete Control" ;
+};
+
+String RID_STR_UNDO_GROUP
+{
+ Text [ de ] ="Gruppe Einfügen" ;
+ Text [ en-US ] = "Insert Group" ;
+};
+
+String RID_STR_UNDO_UNGROUP
+{
+ Text [ de ] ="Gruppe Löschen" ;
+ Text [ en-US ] = "Delete Group" ;
+};
+
+String RID_STR_GROUPHEADER
+{
+ Text [ de ] = "Gruppenkopf" ;
+ Text [ en-US ] = "GroupHeader";
+ Text [ x-comment ] = "Please try to avoid spaces in the name. It is used as a programatic one.";
+};
+String RID_STR_GROUPFOOTER
+{
+ Text [ de ] = "Gruppenfuß" ;
+ Text [ en-US ] = "GroupFooter";
+ Text [ x-comment ] = "Please try to avoid spaces in the name. It is used as a programatic one.";
+};
+Menu RID_MENU_REPORT
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_SORTINGANDGROUPING;
+ HelpId = SID_SORTINGANDGROUPING ;
+ Command = ".uno:DbSortingAndGrouping";
+ Text [ de ] = "Sortierung und Gruppierung..." ;
+ Text [ en-US ] = "Sorting and Grouping...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_COLOR_BACKGROUND;
+ HelpId = SID_ATTR_CHAR_COLOR_BACKGROUND ;
+ Command = ".uno:DBBackgroundColor";
+ Text [ de ] = "Hintergrundfarbe..." ;
+ Text [ en-US ] = "Background Color...";
+ };
+ MenuItem
+ {
+ Identifier = SID_RULER;
+ HelpId = SID_RULER ;
+ Command = ".uno:ShowRuler";
+ Checkable = TRUE;
+ Text [ de ] = "Lineal..." ;
+ Text [ en-US ] = "Ruler...";
+ };
+ MenuItem
+ {
+ Identifier = SID_GRID_VISIBLE;
+ HelpId = SID_GRID_VISIBLE ;
+ Command = ".uno:GridVisible";
+ Checkable = TRUE;
+ Text [ de ] = "Gitter..." ;
+ Text [ en-US ] = "Grid...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_PAGEHEADERFOOTER;
+ HelpId = SID_PAGEHEADERFOOTER ;
+ Command = ".uno:PageHeaderFooter";
+ Checkable = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_REPORTHEADERFOOTER;
+ HelpId = SID_REPORTHEADERFOOTER ;
+ Command = ".uno:ReportHeaderFooter";
+ Checkable = TRUE;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_ARRANGEMENU ;
+ HelpID = SID_ARRANGEMENU ;
+ Command = ".uno:ArrangeMenu" ;
+ Text [ de ] = "~Anordnung" ;
+ Text [ en-US ] = "~Arrange" ;
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ ITEM_FORMAT_FRAME_TO_TOP
+ };
+ MenuItem
+ {
+ Identifier = SID_FRAME_UP ;
+ HelpID = SID_FRAME_UP ;
+ Text [ de ] = "W~eiter nach vorn" ;
+ Text [ en-US ] = "Bring ~Forward" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_FRAME_DOWN ;
+ HelpID = SID_FRAME_DOWN ;
+ Text [ de ] = "Weiter ~nach hinten" ;
+ Text [ en-US ] = "Send Back~ward" ;
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_FRAME_TO_BOTTOM
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_HEAVEN
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_HELL
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_LEFT
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_CENTER
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_RIGHT
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_UP
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_MIDDLE
+ };
+ MenuItem
+ {
+ ITEM_FORMAT_OBJECT_ALIGN_DOWN
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_RESIZING ;
+ Command = ".uno:ObjectResize" ;
+ HelpID = SID_OBJECT_RESIZING ;
+ Text [ de ] = "~Größenänderung" ;
+ Text [ en-US ] = "~Object Resizing" ;
+ Text [ x-comment ] = " ";
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_OBJECT_SMALLESTWIDTH ;
+ Command = ".uno:SmallestWidth" ;
+ HelpID = SID_OBJECT_SMALLESTWIDTH ;
+ Text [ de ] = "~Fit to smallest width" ;
+ Text [ en-US ] = "~Fit to smallest width" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_GREATESTWIDTH ;
+ Command = ".uno:GreatestWidth" ;
+ HelpID = SID_OBJECT_GREATESTWIDTH ;
+ Text [ de ] = "~Fit to greatest width" ;
+ Text [ en-US ] = "~Fit to greatest width" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_SMALLESTHEIGHT ;
+ Command = ".uno:SmallestHeight" ;
+ HelpID = SID_OBJECT_SMALLESTHEIGHT ;
+ Text [ de ] = "~Fit to smallest height" ;
+ Text [ en-US ] = "~Fit to smallest height" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_GREATESTHEIGHT ;
+ Command = ".uno:GreatestHeight" ;
+ HelpID = SID_OBJECT_GREATESTHEIGHT ;
+ Text [ de ] = "~Fit to greatest height" ;
+ Text [ en-US ] = "~Fit to greatest height" ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_DISTRIBUTION;
+ HelpId = SID_DISTRIBUTION ;
+ Command = ".uno:Distribution";
+ Text [ de ] = "Verteilung..." ;
+ Text [ en-US ] = "Distribution..." ;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_SHOW_PROPERTYBROWSER;
+ HelpId = SID_SHOW_PROPERTYBROWSER ;
+ Command = ".uno:FormProperties";
+ Text [ de ] = "Eigenschaften..." ;
+ Text [ en-US ] = "Properties...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_EDIT_CUT
+ };
+ MenuItem
+ {
+ ITEM_EDIT_COPY
+ };
+ MenuItem
+ {
+ ITEM_EDIT_PASTE
+ };
+ };
+};
+String RID_STR_FIELDSELECTION
+{
+ Text [ de ] = "Feld hinzufügen:";
+ Text [ en-US ] = "Add field:";
+};
+
+String RID_STR_FILTER
+{
+ Text [ de ] = "Filter" ;
+ Text [ en-US ] = "Filter" ;
+};
+
+String RID_APP_TITLE
+{
+ Text [ de ] =" - %PRODUCTNAME Base Bericht" ;
+ Text [ en-US ] = " - %PRODUCTNAME Base Report" ;
+};
+
+String RID_APP_NEW_DOC
+{
+ Text [ de ] = "Unbenannt" ;
+ Text [ en-US ] = "Untitled" ;
+};
+String RID_STR_UNDO_ALIGNMENT
+{
+ Text [ de ] = "Ausrichtung ändern" ;
+ Text [ en-US ] = "Change Alignment" ;
+};
+String RID_STR_HEADER
+{
+ Text [ de ] = "# Kopf" ;
+ Text [ en-US ] = "# Header" ;
+ Text[ x-comment ] = "# will be replaced with a name.";
+};
+String RID_STR_FOOTER
+{
+ Text [ de ] = "# Fuß" ;
+ Text [ en-US ] = "# Footer" ;
+ Text[ x-comment ] = "# will be replaced with a name.";
+};
+String RID_STR_IMPORT_GRAPHIC
+{
+ Text [ de ] = "Grafik einfügen" ;
+ Text [ en-US ] = "Insert graphics" ;
+};
+String RID_STR_DELETE
+{
+ Text [ de ] = "Löschen" ;
+ Text [ en-US ] = "Delete" ;
+};
+String RID_STR_FUNCTION
+{
+ Text [ de ] = "Funktion" ;
+ Text [ en-US ] = "Function" ;
+};
+Image REPORT_TREE_ICON
+{
+ ImageBitmap = Bitmap { File = "report_16"; };
+ MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; };
+};
+String RID_STR_COULD_NOT_CREATE_REPORT
+{
+ Text [ de ] = "Beim Erstellen des Berichtes ist ein Fehler aufgetreten." ;
+ Text [ en-US ] = "An error occured while creating the report." ;
+};
+String RID_STR_CAUGHT_FOREIGN_EXCEPTION
+{
+ Text [ de ] = "Eine Ausnahme von Typ $type$ wurde gefangen." ;
+ Text [ en-US ] = "An exception of type $type$ was caught." ;
+};
+String RID_STR_UNDO_CHANGEFONT
+{
+ Text [ de ] = "Zeichensatz verändern" ;
+ Text [ en-US ] = "Change font";
+};
+String RID_STR_UNDO_CHANGEPAGE
+{
+ Text [ de ] = "Seiteneigenschaften verändern" ;
+ Text [ en-US ] = "Change page attributes";
+};
+String RID_STR_PAGEHEADERFOOTER_INSERT
+{
+ Text [ de ] = "Seitenkopf, -fuß einfügen" ;
+ Text [ en-US ] = "Insert Page Header/Footer";
+};
+String RID_STR_PAGEHEADERFOOTER_DELETE
+{
+ Text [ de ] = "Seitenkopf, -fuß löschen" ;
+ Text [ en-US ] = "Delete Page Header/Footer";
+};
+String RID_STR_COLUMNHEADERFOOTER_INSERT
+{
+ Text [ de ] = "Spaltenkopf, -fuß einfügen" ;
+ Text [ en-US ] = "Insert Column Header/Footer";
+};
+String RID_STR_COLUMNHEADERFOOTER_DELETE
+{
+ Text [ de ] = "Spaltenkopf, -fuß löschen" ;
+ Text [ en-US ] = "Delete Column Header/Footer";
+};
+String RID_STR_REPORTHEADERFOOTER_INSERT
+{
+ Text [ de ] = "Berichtskopf, -fuß einfügen" ;
+ Text [ en-US ] = "Insert Report Header/Footer";
+};
+String RID_STR_REPORTHEADERFOOTER_DELETE
+{
+ Text [ de ] = "Berichtskopf, -fuß löschen" ;
+ Text [ en-US ] = "Delete Report Header/Footer";
+};
diff --git a/reportdesign/uiconfig/dbreport/accelerator/de-DE/default.xml b/reportdesign/uiconfig/dbreport/accelerator/de-DE/default.xml
new file mode 100644
index 000000000000..38bd2e729b98
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/accelerator/de-DE/default.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:SelectReport"/>
+ <accel:item accel:code="KEY_RETURN" accel:mod2="true" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F4" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F5" xlink:href=".uno:ReportNavigator"/>
+ <accel:item accel:code="KEY_ESCAPE" xlink:href=".uno:Escape"/>
+ <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:DbSortingAndGrouping"/>
+ <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:ExecuteReport"/>
+ <accel:item accel:code="KEY_A" accel:mod1="true" accel:shift="true" xlink:href=".uno:SelectAllInSection"/>
+ <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
+ <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" xlink:href=".uno:NextMark"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" accel:shift="true" xlink:href=".uno:PrevMark"/>
+</accel:acceleratorlist>
diff --git a/reportdesign/uiconfig/dbreport/accelerator/en-GB/default.xml b/reportdesign/uiconfig/dbreport/accelerator/en-GB/default.xml
new file mode 100644
index 000000000000..38bd2e729b98
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/accelerator/en-GB/default.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:SelectReport"/>
+ <accel:item accel:code="KEY_RETURN" accel:mod2="true" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F4" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F5" xlink:href=".uno:ReportNavigator"/>
+ <accel:item accel:code="KEY_ESCAPE" xlink:href=".uno:Escape"/>
+ <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:DbSortingAndGrouping"/>
+ <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:ExecuteReport"/>
+ <accel:item accel:code="KEY_A" accel:mod1="true" accel:shift="true" xlink:href=".uno:SelectAllInSection"/>
+ <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
+ <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" xlink:href=".uno:NextMark"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" accel:shift="true" xlink:href=".uno:PrevMark"/>
+</accel:acceleratorlist>
diff --git a/reportdesign/uiconfig/dbreport/accelerator/en-US/default.xml b/reportdesign/uiconfig/dbreport/accelerator/en-US/default.xml
new file mode 100644
index 000000000000..38bd2e729b98
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/accelerator/en-US/default.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<accel:acceleratorlist xmlns:accel="http://openoffice.org/2001/accel" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <accel:item accel:code="KEY_R" accel:mod1="true" xlink:href=".uno:SelectReport"/>
+ <accel:item accel:code="KEY_RETURN" accel:mod2="true" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F4" xlink:href=".uno:ControlProperties"/>
+ <accel:item accel:code="KEY_F5" xlink:href=".uno:ReportNavigator"/>
+ <accel:item accel:code="KEY_ESCAPE" xlink:href=".uno:Escape"/>
+ <accel:item accel:code="KEY_G" accel:mod1="true" xlink:href=".uno:DbSortingAndGrouping"/>
+ <accel:item accel:code="KEY_E" accel:mod1="true" xlink:href=".uno:ExecuteReport"/>
+ <accel:item accel:code="KEY_A" accel:mod1="true" accel:shift="true" xlink:href=".uno:SelectAllInSection"/>
+ <accel:item accel:code="KEY_Y" accel:mod1="true" xlink:href=".uno:Redo"/>
+ <accel:item accel:code="KEY_Z" accel:mod1="true" xlink:href=".uno:Undo"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" xlink:href=".uno:NextMark"/>
+ <accel:item accel:code="KEY_TAB" accel:mod1="true" accel:shift="true" xlink:href=".uno:PrevMark"/>
+</accel:acceleratorlist>
diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
new file mode 100644
index 000000000000..1b0890fd0b1a
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<menu:menubar xmlns:menu="http://openoffice.org/2001/menu" menu:id="menubar">
+ <menu:menu menu:id=".uno:PickList" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:AddDirect"/>
+ <menu:menuitem menu:id=".uno:Open"/>
+ <menu:menuitem menu:id=".uno:RecentFileList"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AutoPilotMenu"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:CloseDoc"/>
+ <menu:menuitem menu:id=".uno:Save"/>
+ <menu:menuitem menu:id=".uno:SaveAll"/>
+ <menu:menuseparator/>
+ <menu:menu menu:id=".uno:ExportReportTo">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:TextDocument"/>
+ <menu:menuitem menu:id=".uno:Spreadsheet"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Quit"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:EditMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:Undo"/>
+ <menu:menuitem menu:id=".uno:Redo"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Cut"/>
+ <menu:menuitem menu:id=".uno:Copy"/>
+ <menu:menuitem menu:id=".uno:Paste"/>
+ <menu:menuitem menu:id=".uno:SelectAll"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Delete"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:PageHeaderFooter"/>
+ <menu:menuitem menu:id=".uno:ReportHeaderFooter"/>
+ <menu:menuitem menu:id=".uno:ColumnHeaderFooter"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SelectReport"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ExecuteReport"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:ViewMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SwitchControlDesignMode"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SubReportInNewWindow"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ControlProperties"/>
+ <menu:menuitem menu:id=".uno:AddField"/>
+ <menu:menuitem menu:id=".uno:DbSortingAndGrouping"/>
+ <menu:menuitem menu:id=".uno:ReportNavigator"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AvailableToolbars"/>
+ <menu:menuitem menu:id=".uno:StatusBarVisible"/>
+ <menu:menuitem menu:id=".uno:ShowRuler"/>
+ <menu:menu menu:id=".uno:GridMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:GridVisible"/>
+ <menu:menuitem menu:id=".uno:GridUse"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:SnapLinesMenu">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:HelplinesMove"/>
+ </menu:menupopup>
+ </menu:menu>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:InsertMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:InsertPageNumberField"/>
+ <menu:menuitem menu:id=".uno:InsertDateTimeField"/>
+ <menu:menuseparator/>
+ <menu:menu menu:id=".uno:GraphicMenu">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:InsertGraphic"/>
+ </menu:menupopup>
+ </menu:menu>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:FormatMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:ConditionalFormatting"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:FontDialog"/>
+ <menu:menuitem menu:id=".uno:PageDialog"/>
+ <menu:menuseparator/>
+ <menu:menu menu:id=".uno:ArrangeMenu">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:BringToFront"/>
+ <menu:menuitem menu:id=".uno:ObjectBackOne"/>
+ <menu:menuitem menu:id=".uno:ObjectForwardOne"/>
+ <menu:menuitem menu:id=".uno:SendToBack"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SetObjectToForeground"/>
+ <menu:menuitem menu:id=".uno:SetObjectToBackground"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:ObjectAlign" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:ObjectAlignLeft"/>
+ <menu:menuitem menu:id=".uno:AlignCenter"/>
+ <menu:menuitem menu:id=".uno:ObjectAlignRight"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:AlignUp"/>
+ <menu:menuitem menu:id=".uno:AlignMiddle"/>
+ <menu:menuitem menu:id=".uno:AlignDown"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:ObjectResize" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SmallestWidth"/>
+ <menu:menuitem menu:id=".uno:GreatestWidth"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SmallestHeight"/>
+ <menu:menuitem menu:id=".uno:GreatestHeight"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Distribution"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:ToolsMenu" >
+ <menu:menupopup>
+ <menu:menu menu:id=".uno:MacrosMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:MacroRecorder"/>
+ <menu:menuitem menu:id=".uno:RunMacro"/>
+ <menu:menu menu:id=".uno:ScriptOrganizer"/>
+ <menu:menuitem menu:id=".uno:MacroSignature"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:MacroOrganizer?TabId:short=1"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menuitem menu:id="service:com.sun.star.deployment.ui.PackageManagerDialog"/>
+ <menu:menuitem menu:id=".uno:ConfigureDialog"/>
+ <menu:menuitem menu:id=".uno:OptionsTreeDialog"/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:WindowList" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:NewWindow"/>
+ <menu:menuitem menu:id=".uno:CloseWin"/>
+ <menu:menuseparator/>
+ </menu:menupopup>
+ </menu:menu>
+ <menu:menu menu:id=".uno:HelpMenu">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:HelpIndex"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ExtendedHelp"/>
+ <menu:menuitem menu:id=".uno:HelpTip"/>
+ <menu:menuitem menu:id=".uno:ActiveHelp"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:HelperDialog"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:HelpSupport"/>
+ <menu:menuitem menu:id=".uno:OnlineRegistrationDlg"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:About"/>
+ </menu:menupopup>
+ </menu:menu>
+</menu:menubar>
diff --git a/reportdesign/uiconfig/dbreport/statusbar/statusbar.xml b/reportdesign/uiconfig/dbreport/statusbar/statusbar.xml
new file mode 100644
index 000000000000..ca0ad5fbdaa6
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/statusbar/statusbar.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE statusbar:statusbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "statusbar.dtd">
+<statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <statusbar:statusbaritem xlink:href=".uno:DBStatusType" statusbar:align="left" statusbar:autosize="true" statusbar:width="50" statusbar:helpid="helpid:12308"/>
+ <statusbar:statusbaritem xlink:href=".uno:DBStatusDBName" statusbar:align="left" statusbar:autosize="true" statusbar:width="70" statusbar:helpid="helpid:12309"/>
+ <statusbar:statusbaritem xlink:href=".uno:DBStatusUserName" statusbar:align="left" statusbar:autosize="true" statusbar:width="70" statusbar:helpid="helpid:12310"/>
+ <statusbar:statusbaritem xlink:href=".uno:DBStatusHostName" statusbar:align="left" statusbar:autosize="true" statusbar:width="70" statusbar:helpid="helpid:12311"/>
+</statusbar:statusbar>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml b/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml
new file mode 100644
index 000000000000..33b874d89102
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <toolbar:toolbaritem xlink:href=".uno:SelectObject" toolbar:helpid="helpid:5552" toolbar:visible="false" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:CharFontName" toolbar:helpid="helpid:10007"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontHeight" toolbar:helpid="helpid:10015"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Bold" toolbar:helpid="helpid:10009"/>
+ <toolbar:toolbaritem xlink:href=".uno:Italic" toolbar:helpid="helpid:10008"/>
+ <toolbar:toolbaritem xlink:href=".uno:Underline" toolbar:helpid="helpid:10014"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:helpid="helpid:10028" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:helpid="helpid:10030" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:RightPara" toolbar:helpid="helpid:10029" toolbar:style="radio" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontColor" toolbar:helpid="helpid:10017" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:BackgroundColor" toolbar:helpid="helpid:10185" toolbar:style="dropdown" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontDialog" toolbar:helpid="helpid:10296" toolbar:visible="false" />
+</toolbar:toolbar>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/alignmentbar.xml b/reportdesign/uiconfig/dbreport/toolbar/alignmentbar.xml
new file mode 100644
index 000000000000..dbd7294e566c
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/alignmentbar.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:ObjectAlignLeft" toolbar:helpid="helpid:10131" />
+ <toolbar:toolbaritem xlink:href=".uno:AlignCenter" toolbar:helpid="helpid:10132" />
+ <toolbar:toolbaritem xlink:href=".uno:ObjectAlignRight" toolbar:helpid="helpid:10133" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:AlignUp" toolbar:helpid="helpid:10134" />
+ <toolbar:toolbaritem xlink:href=".uno:AlignMiddle" toolbar:helpid="helpid:10135" />
+ <toolbar:toolbaritem xlink:href=".uno:AlignDown" toolbar:helpid="helpid:10136" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/arrowshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/arrowshapes.xml
new file mode 100644
index 000000000000..4a53519494ea
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/arrowshapes.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-down-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.corner-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.striped-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.notched-right-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.pentagon-right" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.chevron" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow-callout" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.circular-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-round-arrow" toolbar:helpid="helpid:11004" />
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.s-sharped-arrow" toolbar:helpid="helpid:11004" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml
new file mode 100644
index 000000000000..e65778305788
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/basicshapes.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.rectangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-quadrat" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle-pie" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.isosceles-triangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.right-triangle" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.trapezoid" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.diamond" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.parallelogram" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.pentagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.hexagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.octagon" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cross" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ring" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.block-arc" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.can" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cube" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.paper" toolbar:helpid="helpid:11002" />
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.frame" toolbar:helpid="helpid:11002" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/calloutshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/calloutshapes.xml
new file mode 100644
index 000000000000..91b957fa697a
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/calloutshapes.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.rectangular-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.round-rectangular-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.round-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.cloud-callout" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-1" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-2" toolbar:helpid="helpid:11006" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-3" toolbar:helpid="helpid:11006" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/flowchartshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/flowchartshapes.xml
new file mode 100644
index 000000000000..bb1d1099dbd4
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/flowchartshapes.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-alternate-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-decision" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-data" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-predefined-process" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-internal-storage" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-document" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-multidocument" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-terminator" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-preparation" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-input" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-operation" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-connector" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-off-page-connector" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-card" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-punched-tape" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-summing-junction" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-or" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-collate" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sort" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-extract" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-merge" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-stored-data" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-delay" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sequential-access" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-magnetic-disk" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-direct-access-storage" toolbar:helpid="helpid:11005" />
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-display" toolbar:helpid="helpid:11005" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml b/reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml
new file mode 100644
index 000000000000..7de592943b43
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:SelectObject" toolbar:helpid="helpid:10128" toolbar:style="radio auto" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:ControlProperties" toolbar:helpid="helpid:10613" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Label" toolbar:helpid="helpid:10597" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:Edit" toolbar:helpid="helpid:10599" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:ImageControl" toolbar:style="radio auto" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:HFixedLine" toolbar:helpid="helpid:10928" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:VFixedLine" toolbar:helpid="helpid:10929" toolbar:style="radio" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes" toolbar:helpid="11002" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes" toolbar:helpid="11003" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes" toolbar:helpid="11004" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes" toolbar:helpid="11005" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes" toolbar:helpid="11006" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes" toolbar:helpid="11007" toolbar:style="dropdown"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:GridVisible" toolbar:helpid="helpid:27322" toolbar:style="radio auto" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:GridUse" toolbar:helpid="helpid:27154" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:HelplinesMove" toolbar:helpid="helpid:27153" toolbar:visible="false"/>
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/resizebar.xml b/reportdesign/uiconfig/dbreport/toolbar/resizebar.xml
new file mode 100644
index 000000000000..864f588b976b
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/resizebar.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:SmallestWidth"/>
+ <toolbar:toolbaritem xlink:href=".uno:GreatestWidth"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SmallestHeight"/>
+ <toolbar:toolbaritem xlink:href=".uno:GreatestHeight"/>
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml b/reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml
new file mode 100644
index 000000000000..7f21778b9d46
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignLeft" toolbar:helpid="helpid:10131" />
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignRight" toolbar:helpid="helpid:10133" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignTop" toolbar:helpid="helpid:10134" />
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignBottom" toolbar:helpid="helpid:10136" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/starshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/starshapes.xml
new file mode 100644
index 000000000000..a2ff874d2fe7
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/starshapes.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.bang" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star4" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star5" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star6" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star8" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star12" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star24" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.concave-star6" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.vertical-scroll" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.horizontal-scroll" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.signet" toolbar:helpid="helpid:11007" />
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.doorplate" toolbar:helpid="helpid:11007" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/symbolshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/symbolshapes.xml
new file mode 100644
index 000000000000..0fa6aee313db
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/symbolshapes.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar">
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.smiley" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.sun" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.moon" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.lightning" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.heart" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.flower" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.cloud" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.forbidden" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.puzzle" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.bracket-pair" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-bracket" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-bracket" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.brace-pair" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-brace" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-brace" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.quad-bevel" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.octagon-bevel" toolbar:helpid="helpid:11003" />
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.diamond-bevel" toolbar:helpid="helpid:11003" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/toolbar.xml b/reportdesign/uiconfig/dbreport/toolbar/toolbar.xml
new file mode 100644
index 000000000000..3894b36fd980
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/toolbar.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
+<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Cut" toolbar:helpid="5710"/>
+ <toolbar:toolbaritem xlink:href=".uno:Copy" toolbar:helpid="5711"/>
+ <toolbar:toolbaritem xlink:href=".uno:Paste" toolbar:helpid="helpid:5712" toolbar:text="" toolbar:style="dropdown" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Undo" toolbar:helpid="5701"/>
+ <toolbar:toolbaritem xlink:href=".uno:Redo" toolbar:helpid="5700"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:AddField" toolbar:helpid="helpid:10623" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:ReportNavigator" toolbar:helpid="helpid:12593" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:DbSortingAndGrouping" toolbar:helpid="helpid:12454" />
+ <toolbar:toolbaritem xlink:href=".uno:ExecuteReport" toolbar:helpid="helpid:12471" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
+ <toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
+</toolbar:toolbar>
diff --git a/reportdesign/util/description.xml b/reportdesign/util/description.xml
new file mode 100644
index 000000000000..920076b69f09
--- /dev/null
+++ b/reportdesign/util/description.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<description xmlns="http://openoffice.org/extensions/description/2006"
+ xmlns:d="http://openoffice.org/extensions/description/2006"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <registration>
+ <simple-license accept-by="admin" default-license-id="en-US" >
+ <license-text xlink:href="registration/license_de.txt" lang="de" />
+ <license-text xlink:href="registration/license_en_US.txt" lang="en-US" license-id="en-US" />
+ </simple-license>
+ </registration>
+
+
+ <version value="0.5.0"/>
+ <identifier value="com.sun.reportdesigner"/>
+
+ <dependencies>
+ <OpenOffice.org-minimal-version value="2.3" d:name="OpenOffice.org 2.3"/>
+ </dependencies>
+
+
+</description>
diff --git a/reportdesign/util/dll.pmk b/reportdesign/util/dll.pmk
new file mode 100644
index 000000000000..ed9b4e35d543
--- /dev/null
+++ b/reportdesign/util/dll.pmk
@@ -0,0 +1,51 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: dll.pmk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:40 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+# define REPORTDESIGN_DLLIMPLEMENTATION (see @ dllapi.h)
+CDEFS += -DREPORTDESIGN_DLLIMPLEMENTATION
+
+# set default symbol visibility / scope to hidden
+.IF "$(COMNAME)" == "gcc3"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+ CFLAGS += -fvisibility=hidden
+.ENDIF # HAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # gcc3
+
+.IF "$(COMNAME)" == "sunpro5"
+.IF "$(CCNUMVER)" >= "00050005"
+ CFLAGS += -xldscope=hidden
+.ENDIF # 5.5
+.ENDIF # sunpro5
+
diff --git a/reportdesign/util/hidother.src b/reportdesign/util/hidother.src
new file mode 100644
index 000000000000..34f65007ab49
--- /dev/null
+++ b/reportdesign/util/hidother.src
@@ -0,0 +1,139 @@
+/*************************************************************************
+*
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: hidother.src,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-09 11:56:40 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+************************************************************************/
+
+#include "../inc/helpids.hrc"
+#include "../inc/rptui_slotid.hrc"
+
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+
+hidspecial UID_RPT_APP_VIEW { HelpId = UID_RPT_APP_VIEW ; };
+hidspecial UID_SCROLLWINDOW { HelpId = UID_SCROLLWINDOW ; };
+hidspecial UID_REPORTWINDOW { HelpId = UID_REPORTWINDOW ; };
+hidspecial HID_HORZ_RULER { HelpId = HID_HORZ_RULER ; };
+hidspecial UID_SECTIONSWINDOW { HelpId = UID_SECTIONSWINDOW ; };
+hidspecial UID_VIEWSWINDOW { HelpId = UID_VIEWSWINDOW ; };
+hidspecial HID_ENDMARKER { HelpId = HID_ENDMARKER ; };
+hidspecial HID_SPLITTER { HelpId = HID_SPLITTER ; };
+hidspecial HID_REPORTSECTION { HelpId = HID_REPORTSECTION ; };
+hidspecial HID_HORZ_SCROLLBAR { HelpId = HID_HORZ_SCROLLBAR ; };
+hidspecial HID_VERT_SCROLLBAR { HelpId = HID_VERT_SCROLLBAR ; };
+hidspecial HID_STARTMARKER { HelpId = HID_STARTMARKER ; };
+
+hidspecial SID_RPT_SHOWREPORTEXPLORER { HelpId = SID_RPT_SHOWREPORTEXPLORER ; };
+hidspecial SID_PAGEHEADERFOOTER { HelpId = SID_PAGEHEADERFOOTER ; };
+hidspecial SID_REPORTHEADERFOOTER { HelpId = SID_REPORTHEADERFOOTER ; };
+hidspecial SID_SORTINGANDGROUPING { HelpId = SID_SORTINGANDGROUPING ; };
+hidspecial SID_INSERT_FLD_PGNUMBER { HelpId = SID_INSERT_FLD_PGNUMBER ; };
+hidspecial SID_CONDITIONALFORMATTING { HelpId = SID_CONDITIONALFORMATTING ; };
+hidspecial SID_PAGEDIALOG { HelpId = SID_PAGEDIALOG ; };
+hidspecial SID_SETCONTROLDEFAULTS { HelpId = SID_SETCONTROLDEFAULTS ; };
+hidspecial SID_INSERTBREAK { HelpId = SID_INSERTBREAK ; };
+hidspecial HID_FIELDEXPRESSION { HelpId = HID_FIELDEXPRESSION ; };
+hidspecial HID_SORTORDER { HelpId = HID_SORTORDER ; };
+hidspecial HID_GROUPSBRW { HelpId = HID_GROUPSBRW ; };
+hidspecial HID_GROUPSSORTING_DLG { HelpId = HID_GROUPSSORTING_DLG ; };
+hidspecial HID_PAGENUMBERS_DLG { HelpId = HID_PAGENUMBERS_DLG ; };
+hidspecial HID_DATETIME_DLG { HelpId = HID_DATETIME_DLG ; };
+hidspecial HID_CONDFORMAT_DLG { HelpId = HID_CONDFORMAT_DLG ; };
+hidspecial HID_CRTL_FORMAT_PREVIEW { HelpId = HID_CRTL_FORMAT_PREVIEW ; };
+hidspecial HID_COND_DLG { HelpId = HID_COND_DLG ; };
+hidspecial HID_RPT_POPUP_COLOR_CTRL { HelpId = HID_RPT_POPUP_COLOR_CTRL ; };
+hidspecial HID_RPT_POPUP_COLOR { HelpId = HID_RPT_POPUP_COLOR ; };
+hidspecial SID_ESCAPE { HelpId = SID_ESCAPE ; };
+hidspecial HID_PROPDLG_TAB_GENERAL { HelpId = HID_PROPDLG_TAB_GENERAL ; };
+hidspecial HID_PROPDLG_TAB_DATA { HelpId = HID_PROPDLG_TAB_DATA ; };
+
+hidspecial HID_PROP_FORCENEWPAGE { HelpId = HID_PROP_FORCENEWPAGE; };
+hidspecial HID_PROP_NEWROWORCOL { HelpId = HID_PROP_NEWROWORCOL; };
+hidspecial HID_PROP_KEEPTOGETHER { HelpId = HID_PROP_KEEPTOGETHER; };
+hidspecial HID_PROP_CANGROW { HelpId = HID_PROP_CANGROW; };
+hidspecial HID_PROP_CANSHRINK { HelpId = HID_PROP_CANSHRINK; };
+hidspecial HID_PROP_REPEATSECTION { HelpId = HID_PROP_REPEATSECTION; };
+hidspecial HID_PROP_PRINTREPEATEDVALUES { HelpId = HID_PROP_PRINTREPEATEDVALUES; };
+hidspecial HID_PROP_CONDITIONALPRINTEXPRESSION { HelpId = HID_PROP_CONDITIONALPRINTEXPRESSION; };
+hidspecial HID_PROP_STARTNEWCOLUMN { HelpId = HID_PROP_STARTNEWCOLUMN; };
+hidspecial HID_PROP_STARTNEWPAGE { HelpId = HID_PROP_STARTNEWPAGE; };
+hidspecial HID_PROP_RESETPAGENUMBER { HelpId = HID_PROP_RESETPAGENUMBER; };
+hidspecial HID_PROP_MINHEIGHTNEWPAGE { HelpId = HID_PROP_MINHEIGHTNEWPAGE; };
+hidspecial HID_PROP_PRINTWHENGROUPCHANGE { HelpId = HID_PROP_PRINTWHENGROUPCHANGE; };
+hidspecial HID_PROP_VISIBLE { HelpId = HID_PROP_VISIBLE; };
+hidspecial HID_PROP_GROUPKEEPTOGETHER { HelpId = HID_PROP_GROUPKEEPTOGETHER; };
+hidspecial HID_PROP_PAGEHEADEROPTION { HelpId = HID_PROP_PAGEHEADEROPTION; };
+hidspecial HID_PROP_PAGEFOOTEROPTION { HelpId = HID_PROP_PAGEFOOTEROPTION; };
+hidspecial UID_PROP_DLG_LINE_STYLE { HelpId = UID_PROP_DLG_LINE_STYLE; };
+hidspecial HID_PROP_RPT_POSITIONX { HelpId = HID_PROP_RPT_POSITIONX; };
+hidspecial HID_PROP_RPT_POSITIONY { HelpId = HID_PROP_RPT_POSITIONY; };
+hidspecial HID_PROP_RPT_WIDTH { HelpId = HID_PROP_RPT_WIDTH; };
+hidspecial HID_PROP_RPT_HEIGHT { HelpId = HID_PROP_RPT_HEIGHT; };
+hidspecial HID_START_TITLE { HelpId = HID_START_TITLE; };
+hidspecial HID_START_IMAGE { HelpId = HID_START_IMAGE; };
+hidspecial SID_EXECUTE_REPORT { HelpId = SID_EXECUTE_REPORT; };
+
+hidspecial SID_RPT_TEXTDOCUMENT { HelpId = SID_RPT_TEXTDOCUMENT; };
+hidspecial SID_RPT_SPREADSHEET { HelpId = SID_RPT_SPREADSHEET; };
+hidspecial HID_PROP_DEEPTRAVERSING { HelpId = HID_PROP_DEEPTRAVERSING; };
+hidspecial HID_PROP_PREEVALUATED { HelpId = HID_PROP_PREEVALUATED; };
+hidspecial HID_NAVIGATOR_DLG { HelpId = HID_NAVIGATOR_DLG; };
+hidspecial HID_REPORT_NAVIGATOR_TREE { HelpId = HID_REPORT_NAVIGATOR_TREE; };
+hidspecial SID_RPT_NEW_FUNCTION { HelpId = SID_RPT_NEW_FUNCTION; };
+hidspecial HID_PROP_FORMULA { HelpId = HID_PROP_FORMULA; };
+hidspecial HID_PROP_INITIALFORMULA { HelpId = HID_PROP_INITIALFORMULA; };x
+hidspecial HID_PROP_DATAFIELD { HelpId = HID_PROP_DATAFIELD; };
+hidspecial HID_PROP_RPT_FONT { HelpId = HID_PROP_RPT_FONT; };
+hidspecial UID_RPT_PROP_DLG_FONT_TYPE { HelpId = UID_RPT_PROP_DLG_FONT_TYPE; };
+hidspecial HID_PROP_BACKCOLOR { HelpId = HID_PROP_BACKCOLOR; };
+hidspecial HID_PROP_PRESERVEIRI { HelpId = HID_PROP_PRESERVEIRI; };
+
+hidspecial SID_OBJECT_SMALLESTWIDTH { HelpId = SID_OBJECT_SMALLESTWIDTH; };
+hidspecial SID_OBJECT_SMALLESTHEIGHT { HelpId = SID_OBJECT_SMALLESTHEIGHT; };
+hidspecial SID_OBJECT_GREATESTWIDTH { HelpId = SID_OBJECT_GREATESTWIDTH; };
+hidspecial SID_OBJECT_GREATESTHEIGHT { HelpId = SID_OBJECT_GREATESTHEIGHT; };
+
+hidspecial HID_PROP_BACKTRANSPARENT { HelpId = HID_PROP_BACKTRANSPARENT; };
+hidspecial HID_PROP_CONTROLBACKGROUNDTRANSPARENT { HelpId = HID_PROP_CONTROLBACKGROUNDTRANSPARENT; };
+
+hidspecial SID_ARRANGEMENU { HelpId = SID_ARRANGEMENU; };
+hidspecial SID_SELECTALL_IN_SECTION { HelpId = SID_SELECTALL_IN_SECTION; };
+hidspecial SID_SECTION_ALIGN { HelpId = SID_SECTION_ALIGN; };
+hidspecial SID_SECTION_ALIGN_LEFT { HelpId = SID_SECTION_ALIGN_LEFT; };
+hidspecial SID_SECTION_ALIGN_CENTER { HelpId = SID_SECTION_ALIGN_CENTER; };
+hidspecial SID_SECTION_ALIGN_RIGHT { HelpId = SID_SECTION_ALIGN_RIGHT; };
+hidspecial SID_SECTION_ALIGN_UP { HelpId = SID_SECTION_ALIGN_UP; };
+hidspecial SID_SECTION_ALIGN_MIDDLE { HelpId = SID_SECTION_ALIGN_MIDDLE; };
+hidspecial SID_SECTION_ALIGN_DOWN { HelpId = SID_SECTION_ALIGN_DOWN; };
+hidspecial SID_NEXT_MARK { HelpId = SID_NEXT_MARK; };
+hidspecial SID_PREV_MARK { HelpId = SID_PREV_MARK; };
diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk
new file mode 100644
index 000000000000..797d736c61ff
--- /dev/null
+++ b/reportdesign/util/makefile.mk
@@ -0,0 +1,259 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:41 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+PRJ=..
+PRJNAME=reportdesign
+TARGET=rpt
+TARGET2=$(TARGET)ui
+# USE_DEFFILE=TRUE
+GEN_HID=TRUE
+GEN_HID_OTHER=TRUE
+# ???
+no_common_build_zip=true
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+# ------------------------------------------------------------------
+
+# --- reportdesign core (rpt) -----------------------------------
+
+LIB1TARGET=$(SLB)$/$(TARGET).lib
+LIB1FILES=\
+ $(SLB)$/api.lib \
+ $(SLB)$/coreshared.lib \
+ $(SLB)$/core_resource.lib \
+ $(SLB)$/core_sdr.lib
+
+SHL1TARGET=$(TARGET)$(UPD)$(DLLPOSTFIX)
+
+SHL1STDLIBS= \
+ $(SVXLIB) \
+ $(SFXLIB) \
+ $(TOOLSLIB) \
+ $(SVLLIB) \
+ $(SVTOOLLIB) \
+ $(UNOTOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(VCLLIB) \
+ $(TKLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="WNT"
+SHL1STDLIBS+= \
+ idbu.lib
+.ELSE
+SHL1STDLIBS+= \
+ -ldbu$(UPD)$(DLLPOSTFIX)
+.ENDIF
+
+SHL1IMPLIB=i$(TARGET)
+SHL1USE_EXPORTS=ordinal
+SHL1LIBS=$(LIB1TARGET)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)
+
+# --- .res file ----------------------------------------------------------
+
+RES1FILELIST=\
+ $(SRS)$/core_strings.srs
+
+RESLIB1NAME=$(TARGET)
+RESLIB1IMAGES=$(PRJ)$/res
+RESLIB1SRSFILES=$(RES1FILELIST)
+
+
+# --- reportdesign UI core (rptui) -----------------------------------
+LIB2TARGET=$(SLB)$/$(TARGET2).lib
+LIB2FILES=\
+ $(SLB)$/uimisc.lib \
+ $(SLB)$/uidlg.lib \
+ $(SLB)$/uishared.lib \
+ $(SLB)$/ui_inspection.lib \
+ $(SLB)$/report.lib
+
+SHL2TARGET=$(TARGET2)$(UPD)$(DLLPOSTFIX)
+
+SHL2STDLIBS= \
+ $(SVXLIB) \
+ $(SFXLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SO2LIB) \
+ $(I18NISOLANGLIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="WNT"
+SHL2STDLIBS+= \
+ idbu.lib \
+ i$(TARGET).lib
+.ELSE
+SHL2STDLIBS+= \
+ -ldbu$(UPD)$(DLLPOSTFIX) \
+ -l$(TARGET)$(UPD)$(DLLPOSTFIX)
+.ENDIF
+
+SHL2DEPN=$(SHL1TARGETN)
+SHL2LIBS=$(LIB2TARGET)
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+DEF2NAME=$(SHL2TARGET)
+SHL2VERSIONMAP=$(TARGET2).map
+
+# --- .res file ----------------------------------------------------------
+
+RES2FILELIST=\
+ $(SRS)$/uidlg.srs \
+ $(SRS)$/ui_inspection.srs \
+ $(SRS)$/report.srs
+
+
+RESLIB2NAME=$(TARGET2)
+RESLIB2IMAGES=$(PRJ)$/res
+RESLIB2SRSFILES=$(RES2FILELIST)
+
+# ------------------- rptxml -------------------
+TARGET3=rptxml
+# --- Library -----------------------------------
+LIB3TARGET=$(SLB)$/rpt_flt.lib
+LIB3FILES=\
+ $(SLB)$/xmlshared.lib \
+ $(SLB)$/$(TARGET3).lib
+
+SHL3TARGET=$(TARGET3)$(UPD)$(DLLPOSTFIX)
+
+SHL3STDLIBS=\
+ $(SVXLIB) \
+ $(XMLOFFLIB) \
+ $(VCLLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(UCBHELPERLIB) \
+ $(SFXLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(SO2LIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="WNT"
+SHL3STDLIBS+= \
+ irpt.lib
+.ELSE
+SHL3STDLIBS+= \
+ -l$(TARGET)$(UPD)$(DLLPOSTFIX)
+.ENDIF
+
+
+SHL3DEPN=
+SHL3LIBS=$(LIB3TARGET)
+SHL3IMPLIB= i$(SHL3TARGET)
+SHL3VERSIONMAP=rptui.map
+SHL3DEF= $(MISC)$/$(SHL3TARGET).def
+
+DEF3NAME=$(SHL3TARGET)
+
+# create Extension -----------------------------
+
+ZIP1TARGET=reportdesign
+ZIP1FLAGS=-r
+ZIP1DIR=$(OUT)$/zip
+ZIP1LIST=*
+ZIP1EXT=.oxt
+
+XMLFILES := $(ZIP1DIR)$/description.xml \
+ $(ZIP1DIR)$/META-INF$/manifest.xml
+
+TXTFILES := $(ZIP1DIR)$/registration$/license_de.txt \
+ $(ZIP1DIR)$/registration$/license_en_US.txt
+
+HTMLFILES := $(ZIP1DIR)$/THIRDPARTYREADMELICENSE.html
+
+REPRORTJARFILES := \
+ $(ZIP1DIR)$/jcommon-1.0.10.jar \
+ $(ZIP1DIR)$/sac.jar \
+ $(ZIP1DIR)$/libxml-0.9.5.jar \
+ $(ZIP1DIR)$/flute-1.3-jfree-20061107.jar \
+ $(ZIP1DIR)$/jfreereport-0.9.0-05.jar \
+ $(ZIP1DIR)$/liblayout-0.2.6.jar \
+ $(ZIP1DIR)$/libloader-0.3.4.jar \
+ $(ZIP1DIR)$/libformula-0.1.8.jar \
+ $(ZIP1DIR)$/librepository-0.1.1.jar \
+ $(ZIP1DIR)$/libfonts-0.2.6.jar \
+ $(ZIP1DIR)$/jcommon-serializer-0.1.0.jar \
+ $(ZIP1DIR)$/reportdesign.jar
+
+.INCLUDE : target.mk
+# --- Targets ----------------------------------
+.IF "$(ZIP1TARGETN)"!=""
+$(ZIP1TARGETN) : $(TXTFILES) $(XMLFILES) $(HTMLFILES) $(REPRORTJARFILES)
+.ENDIF # "$(ZIP1TARGETN)"!=""
+
+$(ZIP1DIR)$/%.xml : %.xml
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(ZIP1DIR)$/%.jar : $(SOLARBINDIR)$/%.jar
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(ZIP1DIR)$/%.jar : $(CLASSDIR)$/%.jar
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(ZIP1DIR)$/META-INF$/%.xml : %.xml
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(ZIP1DIR)$/registration$/%.txt : %.txt
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(ZIP1DIR)$/THIRDPARTYREADMELICENSE.html : THIRDPARTYREADMELICENSE.html
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
diff --git a/reportdesign/util/makefile.pmk b/reportdesign/util/makefile.pmk
new file mode 100644
index 000000000000..285156437cbe
--- /dev/null
+++ b/reportdesign/util/makefile.pmk
@@ -0,0 +1,61 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.pmk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:41 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+
+XSLDIR=$(SOLARXMLDIR)$/processing
+XCSROOT=$(SOLARXMLDIR)
+DTDDIR=$(SOLARXMLDIR)
+PROCESSOUT=$(MISC)
+PROCESSORDIR=$(SOLARBINDIR)
+
+JAVAPREPRO=
+.IF "$(JDK_VERSION)" == "110"
+JAVAPREPRO=-jdk11
+.ENDIF
+.IF "$(PRODUCT)" != ""
+JAVAPREPRO=$(JAVAPREPRO) + " -product"
+.ENDIF
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+NOUNODOC=
+BUILD_URD_ONLY=TRUE
+LOCALIDLFILES=TRUE
+URDDOC=TRUE
+
+.IF "$(OS)"=="SOLARIS" || "$(OS)"=="FREEBSD"
+.IF "$(CPU)"=="I"
+UNOIDL=unoidl
+.ENDIF
+.ENDIF
+
diff --git a/reportdesign/util/manifest.xml b/reportdesign/util/manifest.xml
new file mode 100644
index 000000000000..2367ccb20863
--- /dev/null
+++ b/reportdesign/util/manifest.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Java" manifest:full-path="reportdesign.jar"/>
+</manifest:manifest>
diff --git a/reportdesign/util/rpt.map b/reportdesign/util/rpt.map
new file mode 100644
index 000000000000..82864090dff7
--- /dev/null
+++ b/reportdesign/util/rpt.map
@@ -0,0 +1,9 @@
+UDK_3_0_0 {
+ global:
+ component_getFactory;
+ component_getImplementationEnvironment;
+ component_writeInfo;
+
+ local:
+ *;
+};
diff --git a/reportdesign/util/rptui.map b/reportdesign/util/rptui.map
new file mode 100644
index 000000000000..b34eff63c44f
--- /dev/null
+++ b/reportdesign/util/rptui.map
@@ -0,0 +1,8 @@
+UDK_3_0_0 {
+ global:
+ component_getFactory;
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ local:
+ *;
+};
diff --git a/reportdesign/util/target.pmk b/reportdesign/util/target.pmk
new file mode 100644
index 000000000000..a124144d3575
--- /dev/null
+++ b/reportdesign/util/target.pmk
@@ -0,0 +1,42 @@
+#*************************************************************************
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: target.pmk,v $
+#
+# $Revision: 1.2 $
+#
+# last change: $Author: rt $ $Date: 2007-07-09 11:56:41 $
+#
+# The Contents of this file are made available subject to
+# the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2005 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#*************************************************************************
+REGISTRYCHECKFLAG=$(MISC)$/registrycheck.flag
+$(OUT)$/misc$/$(TARGET).idls: makefile.mk
+ +-$(RM) $@
+ +-$(RM) $(REGISTRYCHECKFLAG)
+ +$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+
+ALLTAR: $(OUT)$/misc$/$(TARGET).idls
+