summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/images/em42.pngbin0 -> 1965 bytes
-rw-r--r--reportdesign/images/em42_hc.pngbin0 -> 1160 bytes
-rw-r--r--reportdesign/inc/ModuleHelper.hxx100
-rw-r--r--reportdesign/inc/PropertyForward.hxx92
-rw-r--r--reportdesign/inc/ReportDefinition.hxx395
-rw-r--r--reportdesign/inc/ReportHelperDefines.hxx195
-rw-r--r--reportdesign/inc/ReportVisitor.hxx67
-rw-r--r--reportdesign/inc/RptDef.hxx120
-rw-r--r--reportdesign/inc/RptModel.hxx103
-rw-r--r--reportdesign/inc/RptObject.hxx286
-rw-r--r--reportdesign/inc/RptPage.hxx98
-rw-r--r--reportdesign/inc/RptResId.hrc298
-rw-r--r--reportdesign/inc/UndoActions.hxx300
-rw-r--r--reportdesign/inc/UndoEnv.hxx150
-rw-r--r--reportdesign/inc/conditionalexpression.hxx123
-rw-r--r--reportdesign/inc/dllapi.h41
-rw-r--r--reportdesign/inc/helpids.hrc122
-rw-r--r--reportdesign/inc/makefile.mk47
-rw-r--r--reportdesign/inc/pch/precompiled_reportdesign.cxx29
-rw-r--r--reportdesign/inc/pch/precompiled_reportdesign.hxx45
-rw-r--r--reportdesign/inc/reportformula.hxx134
-rw-r--r--reportdesign/inc/rptui_slotid.hrc212
-rw-r--r--reportdesign/prj/build.lst18
-rw-r--r--reportdesign/prj/d.lst24
-rw-r--r--reportdesign/prj/rpt.xml14
-rw-r--r--reportdesign/qa/complex/reportdesign/FileURL.java62
-rwxr-xr-xreportdesign/qa/complex/reportdesign/ReportDesignerTest.java652
-rw-r--r--reportdesign/qa/complex/reportdesign/TestDocument.java41
-rwxr-xr-xreportdesign/qa/complex/reportdesign/makefile.mk62
-rw-r--r--reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl9
-rwxr-xr-xreportdesign/qa/complex/reportdesign/runner.props22
-rwxr-xr-xreportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odbbin0 -> 6715 bytes
-rwxr-xr-xreportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odbbin0 -> 5762 bytes
-rw-r--r--reportdesign/source/core/api/FixedLine.cxx585
-rw-r--r--reportdesign/source/core/api/FixedText.cxx347
-rw-r--r--reportdesign/source/core/api/FormatCondition.cxx166
-rw-r--r--reportdesign/source/core/api/FormattedField.cxx387
-rw-r--r--reportdesign/source/core/api/Function.cxx222
-rw-r--r--reportdesign/source/core/api/Functions.cxx204
-rw-r--r--reportdesign/source/core/api/Group.cxx357
-rw-r--r--reportdesign/source/core/api/Groups.cxx217
-rw-r--r--reportdesign/source/core/api/ImageControl.cxx505
-rw-r--r--reportdesign/source/core/api/ReportComponent.cxx153
-rw-r--r--reportdesign/source/core/api/ReportControlModel.cxx158
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx2939
-rw-r--r--reportdesign/source/core/api/ReportEngineJFree.cxx426
-rw-r--r--reportdesign/source/core/api/ReportVisitor.cxx93
-rw-r--r--reportdesign/source/core/api/Section.cxx723
-rw-r--r--reportdesign/source/core/api/Shape.cxx522
-rw-r--r--reportdesign/source/core/api/Tools.cxx77
-rw-r--r--reportdesign/source/core/api/makefile.mk63
-rw-r--r--reportdesign/source/core/api/services.cxx93
-rw-r--r--reportdesign/source/core/inc/FixedLine.hxx175
-rw-r--r--reportdesign/source/core/inc/FixedText.hxx160
-rw-r--r--reportdesign/source/core/inc/FormatCondition.hxx117
-rw-r--r--reportdesign/source/core/inc/FormattedField.hxx167
-rw-r--r--reportdesign/source/core/inc/Function.hxx129
-rw-r--r--reportdesign/source/core/inc/Functions.hxx105
-rw-r--r--reportdesign/source/core/inc/Group.hxx163
-rw-r--r--reportdesign/source/core/inc/Groups.hxx108
-rw-r--r--reportdesign/source/core/inc/ImageControl.hxx164
-rw-r--r--reportdesign/source/core/inc/ReportComponent.hxx88
-rw-r--r--reportdesign/source/core/inc/ReportControlModel.hxx137
-rw-r--r--reportdesign/source/core/inc/ReportDrawPage.hxx50
-rw-r--r--reportdesign/source/core/inc/ReportEngineJFree.hxx138
-rw-r--r--reportdesign/source/core/inc/ReportHelperImpl.hxx1291
-rw-r--r--reportdesign/source/core/inc/ReportUndoFactory.hxx85
-rw-r--r--reportdesign/source/core/inc/RptObjectListener.hxx63
-rw-r--r--reportdesign/source/core/inc/Section.hxx208
-rw-r--r--reportdesign/source/core/inc/Shape.hxx182
-rw-r--r--reportdesign/source/core/inc/Tools.hxx183
-rw-r--r--reportdesign/source/core/inc/conditionupdater.hxx75
-rw-r--r--reportdesign/source/core/inc/core_resource.hrc59
-rw-r--r--reportdesign/source/core/inc/core_resource.hxx78
-rw-r--r--reportdesign/source/core/misc/conditionalexpression.cxx204
-rw-r--r--reportdesign/source/core/misc/conditionupdater.cxx135
-rw-r--r--reportdesign/source/core/misc/makefile.mk46
-rw-r--r--reportdesign/source/core/misc/reportformula.cxx183
-rw-r--r--reportdesign/source/core/resource/core_resource.cxx90
-rw-r--r--reportdesign/source/core/resource/makefile.mk48
-rw-r--r--reportdesign/source/core/resource/strings.src95
-rw-r--r--reportdesign/source/core/sdr/ModuleHelper.cxx141
-rw-r--r--reportdesign/source/core/sdr/PropertyForward.cxx205
-rw-r--r--reportdesign/source/core/sdr/ReportDrawPage.cxx156
-rw-r--r--reportdesign/source/core/sdr/ReportUndoFactory.cxx181
-rw-r--r--reportdesign/source/core/sdr/RptModel.cxx233
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx1256
-rw-r--r--reportdesign/source/core/sdr/RptObjectListener.cxx95
-rw-r--r--reportdesign/source/core/sdr/RptPage.cxx251
-rw-r--r--reportdesign/source/core/sdr/UndoActions.cxx449
-rw-r--r--reportdesign/source/core/sdr/UndoEnv.cxx705
-rw-r--r--reportdesign/source/core/sdr/formatnormalizer.cxx279
-rw-r--r--reportdesign/source/core/sdr/formatnormalizer.hxx94
-rw-r--r--reportdesign/source/core/sdr/makefile.mk52
-rw-r--r--reportdesign/source/filter/xml/dbloader2.cxx125
-rw-r--r--reportdesign/source/filter/xml/dbloader2.hxx102
-rw-r--r--reportdesign/source/filter/xml/makefile.mk70
-rw-r--r--reportdesign/source/filter/xml/xmlAutoStyle.cxx99
-rw-r--r--reportdesign/source/filter/xml/xmlAutoStyle.hxx61
-rw-r--r--reportdesign/source/filter/xml/xmlCell.cxx293
-rw-r--r--reportdesign/source/filter/xml/xmlCell.hxx74
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.cxx190
-rw-r--r--reportdesign/source/filter/xml/xmlColumn.hxx64
-rw-r--r--reportdesign/source/filter/xml/xmlComponent.cxx117
-rw-r--r--reportdesign/source/filter/xml/xmlComponent.hxx60
-rw-r--r--reportdesign/source/filter/xml/xmlCondPrtExpr.cxx103
-rw-r--r--reportdesign/source/filter/xml/xmlCondPrtExpr.hxx58
-rw-r--r--reportdesign/source/filter/xml/xmlControlProperty.cxx360
-rw-r--r--reportdesign/source/filter/xml/xmlControlProperty.hxx86
-rw-r--r--reportdesign/source/filter/xml/xmlEnums.hxx179
-rw-r--r--reportdesign/source/filter/xml/xmlExport.cxx1672
-rw-r--r--reportdesign/source/filter/xml/xmlExport.hxx281
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx455
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx105
-rw-r--r--reportdesign/source/filter/xml/xmlFixedContent.cxx241
-rw-r--r--reportdesign/source/filter/xml/xmlFixedContent.hxx71
-rw-r--r--reportdesign/source/filter/xml/xmlFormatCondition.cxx118
-rw-r--r--reportdesign/source/filter/xml/xmlFormatCondition.hxx57
-rw-r--r--reportdesign/source/filter/xml/xmlFormattedField.cxx105
-rw-r--r--reportdesign/source/filter/xml/xmlFormattedField.hxx55
-rw-r--r--reportdesign/source/filter/xml/xmlFunction.cxx141
-rw-r--r--reportdesign/source/filter/xml/xmlFunction.hxx67
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx279
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.hxx66
-rw-r--r--reportdesign/source/filter/xml/xmlHelper.cxx418
-rw-r--r--reportdesign/source/filter/xml/xmlHelper.hxx93
-rw-r--r--reportdesign/source/filter/xml/xmlImage.cxx130
-rw-r--r--reportdesign/source/filter/xml/xmlImage.hxx55
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx397
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx105
-rw-r--r--reportdesign/source/filter/xml/xmlMasterFields.cxx121
-rw-r--r--reportdesign/source/filter/xml/xmlMasterFields.hxx57
-rw-r--r--reportdesign/source/filter/xml/xmlPropertyHandler.cxx57
-rw-r--r--reportdesign/source/filter/xml/xmlPropertyHandler.hxx49
-rw-r--r--reportdesign/source/filter/xml/xmlReport.cxx236
-rw-r--r--reportdesign/source/filter/xml/xmlReport.hxx70
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.cxx143
-rw-r--r--reportdesign/source/filter/xml/xmlReportElement.hxx58
-rw-r--r--reportdesign/source/filter/xml/xmlReportElementBase.cxx115
-rw-r--r--reportdesign/source/filter/xml/xmlReportElementBase.hxx76
-rw-r--r--reportdesign/source/filter/xml/xmlRow.cxx184
-rw-r--r--reportdesign/source/filter/xml/xmlRow.hxx63
-rw-r--r--reportdesign/source/filter/xml/xmlSection.cxx158
-rw-r--r--reportdesign/source/filter/xml/xmlSection.hxx64
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.cxx459
-rw-r--r--reportdesign/source/filter/xml/xmlStyleImport.hxx166
-rw-r--r--reportdesign/source/filter/xml/xmlSubDocument.cxx164
-rw-r--r--reportdesign/source/filter/xml/xmlSubDocument.hxx71
-rw-r--r--reportdesign/source/filter/xml/xmlTable.cxx323
-rw-r--r--reportdesign/source/filter/xml/xmlTable.hxx99
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.cxx1137
-rw-r--r--reportdesign/source/filter/xml/xmlfilter.hxx247
-rw-r--r--reportdesign/source/filter/xml/xmlservices.cxx94
-rw-r--r--reportdesign/source/inc/GroupProperties.hxx54
-rw-r--r--reportdesign/source/inc/constasciistring.hxx61
-rw-r--r--reportdesign/source/inc/corestrings.hrc41
-rw-r--r--reportdesign/source/inc/stringconstants.hrc288
-rw-r--r--reportdesign/source/inc/uistrings.hrc78
-rw-r--r--reportdesign/source/inc/xmlstrings.hrc56
-rw-r--r--reportdesign/source/shared/corestrings.cxx35
-rw-r--r--reportdesign/source/shared/makefile.mk67
-rw-r--r--reportdesign/source/shared/stringconstants.cxx276
-rw-r--r--reportdesign/source/shared/uistrings.cxx69
-rw-r--r--reportdesign/source/shared/xmlstrings.cxx45
-rw-r--r--reportdesign/source/ui/dlg/AddField.cxx574
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx625
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.hrc87
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.src445
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx740
-rw-r--r--reportdesign/source/ui/dlg/Condition.hxx198
-rw-r--r--reportdesign/source/ui/dlg/DateTime.cxx273
-rw-r--r--reportdesign/source/ui/dlg/DateTime.hrc55
-rw-r--r--reportdesign/source/ui/dlg/DateTime.src132
-rw-r--r--reportdesign/source/ui/dlg/Formula.cxx273
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.cxx76
-rw-r--r--reportdesign/source/ui/dlg/GroupExchange.hxx53
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx1562
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.hrc79
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.src502
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx986
-rw-r--r--reportdesign/source/ui/dlg/Navigator.src182
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.cxx162
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.hrc59
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.src170
-rw-r--r--reportdesign/source/ui/dlg/dlgpage.cxx93
-rw-r--r--reportdesign/source/ui/dlg/dlgpage.src304
-rw-r--r--reportdesign/source/ui/dlg/makefile.mk77
-rw-r--r--reportdesign/source/ui/inc/AddField.hxx143
-rw-r--r--reportdesign/source/ui/inc/ColorChanger.hxx70
-rw-r--r--reportdesign/source/ui/inc/ColorListener.hxx84
-rw-r--r--reportdesign/source/ui/inc/ColumnInfo.hxx57
-rw-r--r--reportdesign/source/ui/inc/CondFormat.hxx186
-rw-r--r--reportdesign/source/ui/inc/DataProviderHandler.hxx129
-rw-r--r--reportdesign/source/ui/inc/DateTime.hxx109
-rw-r--r--reportdesign/source/ui/inc/DefaultInspection.hxx111
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx298
-rw-r--r--reportdesign/source/ui/inc/EndMarker.hxx53
-rw-r--r--reportdesign/source/ui/inc/FixedTextColor.hxx73
-rw-r--r--reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx70
-rw-r--r--reportdesign/source/ui/inc/Formula.hxx112
-rw-r--r--reportdesign/source/ui/inc/FunctionHelper.hxx112
-rw-r--r--reportdesign/source/ui/inc/GeometryHandler.hxx321
-rw-r--r--reportdesign/source/ui/inc/GroupsSorting.hxx204
-rw-r--r--reportdesign/source/ui/inc/IReportControllerObserver.hxx54
-rw-r--r--reportdesign/source/ui/inc/InsertFunctions.hxx46
-rw-r--r--reportdesign/source/ui/inc/MarkedSection.hxx60
-rw-r--r--reportdesign/source/ui/inc/Navigator.hxx55
-rw-r--r--reportdesign/source/ui/inc/PageNumber.hxx88
-rw-r--r--reportdesign/source/ui/inc/ReportComponentHandler.hxx115
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx487
-rw-r--r--reportdesign/source/ui/inc/ReportControllerObserver.hxx132
-rw-r--r--reportdesign/source/ui/inc/ReportDefines.hxx39
-rw-r--r--reportdesign/source/ui/inc/ReportRuler.hxx63
-rw-r--r--reportdesign/source/ui/inc/ReportSection.hxx173
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx238
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx229
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx77
-rw-r--r--reportdesign/source/ui/inc/SectionWindow.hxx140
-rw-r--r--reportdesign/source/ui/inc/StartMarker.hxx88
-rw-r--r--reportdesign/source/ui/inc/UITools.hxx189
-rw-r--r--reportdesign/source/ui/inc/Undo.hxx153
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx361
-rw-r--r--reportdesign/source/ui/inc/dlgedclip.hxx86
-rw-r--r--reportdesign/source/ui/inc/dlgedfac.hxx50
-rw-r--r--reportdesign/source/ui/inc/dlgedfunc.hxx160
-rw-r--r--reportdesign/source/ui/inc/dlgpage.hxx54
-rw-r--r--reportdesign/source/ui/inc/metadata.hxx162
-rw-r--r--reportdesign/source/ui/inc/propbrw.hxx118
-rw-r--r--reportdesign/source/ui/inc/statusbarcontroller.hxx92
-rw-r--r--reportdesign/source/ui/inc/toolboxcontroller.hxx91
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx565
-rw-r--r--reportdesign/source/ui/inspection/DefaultInspection.cxx284
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2246
-rw-r--r--reportdesign/source/ui/inspection/ReportComponentHandler.cxx232
-rw-r--r--reportdesign/source/ui/inspection/inspection.src394
-rw-r--r--reportdesign/source/ui/inspection/makefile.mk53
-rw-r--r--reportdesign/source/ui/inspection/metadata.cxx339
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx97
-rw-r--r--reportdesign/source/ui/misc/FunctionHelper.cxx257
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx1084
-rw-r--r--reportdesign/source/ui/misc/Undo.cxx416
-rw-r--r--reportdesign/source/ui/misc/makefile.mk62
-rw-r--r--reportdesign/source/ui/misc/rptuiservices.cxx82
-rw-r--r--reportdesign/source/ui/misc/statusbarcontroller.cxx230
-rw-r--r--reportdesign/source/ui/misc/toolboxcontroller.cxx360
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx787
-rw-r--r--reportdesign/source/ui/report/EndMarker.cxx104
-rw-r--r--reportdesign/source/ui/report/FixedTextColor.cxx283
-rw-r--r--reportdesign/source/ui/report/FormattedFieldBeautifier.cxx203
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx4391
-rw-r--r--reportdesign/source/ui/report/ReportControllerObserver.cxx462
-rw-r--r--reportdesign/source/ui/report/ReportRuler.cxx63
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx878
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx444
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx416
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx274
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx418
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx324
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx1869
-rw-r--r--reportdesign/source/ui/report/dlgedclip.cxx107
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx113
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx1119
-rw-r--r--reportdesign/source/ui/report/makefile.mk72
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx619
-rw-r--r--reportdesign/source/ui/report/report.src682
-rw-r--r--reportdesign/uiconfig/dbreport/menubar/menubar.xml422
-rw-r--r--reportdesign/uiconfig/dbreport/statusbar/statusbar.xml6
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/Formatting.xml23
-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/drawbar.xml10
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/flowchartshapes.xml36
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml19
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/resizebar.xml9
-rw-r--r--reportdesign/uiconfig/dbreport/toolbar/sectionalignmentbar.xml9
-rwxr-xr-xreportdesign/uiconfig/dbreport/toolbar/sectionshrinkbar.xml7
-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/dll.pmk31
-rw-r--r--reportdesign/util/hidother.src175
-rw-r--r--reportdesign/util/makefile.mk253
-rw-r--r--reportdesign/util/rpt.component58
-rw-r--r--reportdesign/util/rptui.component52
-rw-r--r--reportdesign/util/rptxml.component73
287 files changed, 68253 insertions, 0 deletions
diff --git a/reportdesign/images/em42.png b/reportdesign/images/em42.png
new file mode 100644
index 000000000000..31f48ea8fb69
--- /dev/null
+++ b/reportdesign/images/em42.png
Binary files differ
diff --git a/reportdesign/images/em42_hc.png b/reportdesign/images/em42_hc.png
new file mode 100644
index 000000000000..3870cc4709d4
--- /dev/null
+++ b/reportdesign/images/em42_hc.png
Binary files differ
diff --git a/reportdesign/inc/ModuleHelper.hxx b/reportdesign/inc/ModuleHelper.hxx
new file mode 100644
index 000000000000..79d3b996db81
--- /dev/null
+++ b/reportdesign/inc/ModuleHelper.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RPTUI_MODULE_HELPER_RPT_HXX_
+#define _RPTUI_MODULE_HELPER_RPT_HXX_
+
+#include "dllapi.h"
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <tools/resmgr.hxx>
+
+//.........................................................................
+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:
+ inline OModuleClient() { OModule::registerClient(); }
+ inline ~OModuleClient() { OModule::revokeClient(); }
+ };
+
+ //=========================================================================
+ //= ModuleRes
+ //=========================================================================
+ /** specialized ResId, using the ressource manager provided by the global module
+ */
+ class REPORTDESIGN_DLLPUBLIC ModuleRes : public ::ResId
+ {
+ public:
+ inline 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..9dfea3011eb3
--- /dev/null
+++ b/reportdesign/inc/PropertyForward.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_PROPERTYSETFORWARD_HXX
+#define RPTUI_PROPERTYSETFORWARD_HXX
+
+#include "dllapi.h"
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <cppuhelper/compbase1.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include "RptDef.hxx"
+
+
+//........................................................................
+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..d932110bc5f3
--- /dev/null
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -0,0 +1,395 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef REPORTDESIGN_API_REPORTDEFINITION_HXX
+#define REPORTDESIGN_API_REPORTDEFINITION_HXX
+
+#include "dllapi.h"
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <cppuhelper/compbase12.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#include <com/sun/star/frame/XUntitledNumbers.hpp>
+#include <com/sun/star/frame/XModule.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <cppuhelper/propertysetmixin.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/embeddedobjectcontainer.hxx>
+#include <svx/unomod.hxx>
+
+#include "ReportHelperDefines.hxx"
+#include <boost/shared_ptr.hpp>
+
+
+namespace rptui
+{
+ class OReportModel;
+}
+namespace comphelper
+{
+ class MediaDescriptor;
+}
+namespace reportdesign
+{
+ class OReportComponentProperties;
+ typedef ::cppu::WeakComponentImplHelper12< 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
+ ,com::sun::star::util::XNumberFormatsSupplier
+ ,::com::sun::star::frame::XTitle
+ ,::com::sun::star::frame::XTitleChangeBroadcaster
+ ,::com::sun::star::frame::XUntitledNumbers
+ ,::com::sun::star::document::XDocumentPropertiesSupplier
+ ,::com::sun::star::datatransfer::XTransferable
+ ,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,
+ public ::comphelper::IEmbeddedHelper
+ {
+ ::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);
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitle > impl_getTitleHelper_throw();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XUntitledNumbers > impl_getUntitledHelper_throw();
+
+ /** loads the report definition from the given storage
+ @precond
+ our mutex is locked
+ @throws
+ */
+ void impl_loadFromStorage_nolck_throw(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxStorage,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rArguments
+ );
+
+ 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);
+
+ 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::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(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition);
+ private:
+ 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);
+
+ // 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 ::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 ::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 ::rtl::OUString SAL_CALL getDataSourceName() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDataSourceName( const ::rtl::OUString& _datasourcename ) 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);
+
+ // XModifiable2
+ virtual ::sal_Bool SAL_CALL disableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL enableSetModified( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isSetModifiedEnabled( ) throw (::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);
+
+ // XNumberFormatsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getNumberFormatSettings( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL getNumberFormats( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTitle
+ virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTitleChangeBroadcaster
+ virtual void SAL_CALL addTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XUntitledNumbers
+ virtual ::sal_Int32 SAL_CALL leaseNumber( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xComponent ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL releaseNumber( ::sal_Int32 nNumber ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL releaseNumberForComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xComponent ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getUntitledPrefix( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XDocumentPropertiesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > SAL_CALL getDocumentProperties( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XTransferable
+ virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw (::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw (::com::sun::star::uno::RuntimeException);
+
+ // comphelper::IEmbeddedHelper
+ virtual com::sun::star::uno::Reference < com::sun::star::embed::XStorage > getStorage() const;
+ virtual ::comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > getInteractionHandler() const;
+ virtual bool isEnableSetModified() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const;
+ };
+// =============================================================================
+} // 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..5fc58bef1691
--- /dev/null
+++ b/reportdesign/inc/ReportHelperDefines.hxx
@@ -0,0 +1,195 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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::Sequence< ::rtl::OUString > SAL_CALL getMasterFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setMasterFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _masterfields ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); \
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getDetailFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); \
+ virtual void SAL_CALL setDetailFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _detailfields ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); \
+ 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::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setControlBackground( ::sal_Int32 _controlbackground ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getControlBackgroundTransparent() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setControlBackgroundTransparent( ::sal_Bool _controlbackgroundtransparent ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getParaAdjust() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setParaAdjust( ::sal_Int16 _paraadjust ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setFontDescriptor( const ::com::sun::star::awt::FontDescriptor& _fontdescriptor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptorAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setFontDescriptorAsian( const ::com::sun::star::awt::FontDescriptor& _fontdescriptor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptorComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setFontDescriptorComplex( const ::com::sun::star::awt::FontDescriptor& _fontdescriptor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getControlTextEmphasis() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setControlTextEmphasis( ::sal_Int16 _controltextemphasis ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharEmphasis() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharEmphasis( ::sal_Int16 _charemphasis ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharCombineIsOn() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharCombineIsOn( ::sal_Bool _charcombineison ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharCombinePrefix() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharCombinePrefix( const ::rtl::OUString& _charcombineprefix ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharCombineSuffix() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharCombineSuffix( const ::rtl::OUString& _charcombinesuffix ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharHidden() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharHidden( ::sal_Bool _charhidden ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharShadowed() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharShadowed( ::sal_Bool _charshadowed ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharContoured() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharContoured( ::sal_Bool _charcontoured ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharCaseMap() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharCaseMap( ::sal_Int16 _charcasemap ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::lang::Locale SAL_CALL getCharLocale() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharLocale( const ::com::sun::star::lang::Locale& _charlocale ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharEscapement() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharEscapement( ::sal_Int16 _charescapement ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int8 SAL_CALL getCharEscapementHeight() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharEscapementHeight( ::sal_Int8 _charescapementheight ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharAutoKerning() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharAutoKerning( ::sal_Bool _charautokerning ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharKerning() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharKerning( ::sal_Int16 _charkerning ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharFlash() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFlash( ::sal_Bool _charflash ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharRelief() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharRelief( ::sal_Int16 _charrelief ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontName() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontName( const ::rtl::OUString& _charfontname ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontStyleName() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontStyleName( const ::rtl::OUString& _charfontstylename ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontFamily() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontFamily( ::sal_Int16 _charfontfamily ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontCharSet() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontCharSet( ::sal_Int16 _charfontcharset ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontPitch() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontPitch( ::sal_Int16 _charfontpitch ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int32 SAL_CALL getCharColor() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharColor( ::sal_Int32 _charcolor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int32 SAL_CALL getCharUnderlineColor() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharUnderlineColor( ::sal_Int32 _charunderlinecolor ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharHeight() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharHeight( float _charheight ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharUnderline() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharUnderline( ::sal_Int16 _charunderline ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharWeight() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharWeight( float _charweight ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontSlant SAL_CALL getCharPosture() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharPosture( ::com::sun::star::awt::FontSlant _charposture ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharStrikeout() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharStrikeout( ::sal_Int16 _charstrikeout ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Bool SAL_CALL getCharWordMode() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharWordMode( ::sal_Bool _charwordmode ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharRotation() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharRotation( ::sal_Int16 _charrotation ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharScaleWidth() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharScaleWidth( ::sal_Int16 _charscalewidth ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::style::VerticalAlignment SAL_CALL getVerticalAlign() throw (::com::sun::star::beans::UnknownPropertyException,::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setVerticalAlign( ::com::sun::star::style::VerticalAlignment _paravertalignment ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getHyperLinkURL() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setHyperLinkURL( const ::rtl::OUString& _hyperlinkurl ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getHyperLinkTarget() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setHyperLinkTarget( const ::rtl::OUString& _hyperlinktarget ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getHyperLinkName() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setHyperLinkName( const ::rtl::OUString& _hyperlinkname ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getVisitedCharStyleName() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setVisitedCharStyleName( const ::rtl::OUString& _visitedcharstylename ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getUnvisitedCharStyleName() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setUnvisitedCharStyleName( const ::rtl::OUString& _unvisitedcharstylename ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharHeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharHeightAsian( float _charheightasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharWeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharWeightAsian( float _charweightasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontNameAsian( const ::rtl::OUString& _charfontnameasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontStyleNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontStyleNameAsian( const ::rtl::OUString& _charfontstylenameasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontFamilyAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontFamilyAsian( ::sal_Int16 _charfontfamilyasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontCharSetAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontCharSetAsian( ::sal_Int16 _charfontcharsetasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontPitchAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontPitchAsian( ::sal_Int16 _charfontpitchasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontSlant SAL_CALL getCharPostureAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharPostureAsian( ::com::sun::star::awt::FontSlant _charpostureasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::lang::Locale SAL_CALL getCharLocaleAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharLocaleAsian( const ::com::sun::star::lang::Locale& _charlocaleasian ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharHeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharHeightComplex( float _charheightcomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual float SAL_CALL getCharWeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharWeightComplex( float _charweightcomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontNameComplex( const ::rtl::OUString& _charfontnamecomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::rtl::OUString SAL_CALL getCharFontStyleNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontStyleNameComplex( const ::rtl::OUString& _charfontstylenamecomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontFamilyComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontFamilyComplex( ::sal_Int16 _charfontfamilycomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontCharSetComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontCharSetComplex( ::sal_Int16 _charfontcharsetcomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::sal_Int16 SAL_CALL getCharFontPitchComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharFontPitchComplex( ::sal_Int16 _charfontpitchcomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::awt::FontSlant SAL_CALL getCharPostureComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharPostureComplex( ::com::sun::star::awt::FontSlant _charposturecomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual ::com::sun::star::lang::Locale SAL_CALL getCharLocaleComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);\
+ virtual void SAL_CALL setCharLocaleComplex( const ::com::sun::star::lang::Locale& _charlocalecomplex ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
+
+
+
+#endif // INCLUDED_REPORTHELPERDEFINES_HXX
+
diff --git a/reportdesign/inc/ReportVisitor.hxx b/reportdesign/inc/ReportVisitor.hxx
new file mode 100644
index 000000000000..fd6ec9131c8f
--- /dev/null
+++ b/reportdesign/inc/ReportVisitor.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORT_VISTITOR_HXX
+#define INCLUDED_REPORT_VISTITOR_HXX
+
+#include "dllapi.h"
+#include <com/sun/star/report/XReportDefinition.hpp>
+
+
+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..6a1fbf7a27ce
--- /dev/null
+++ b/reportdesign/inc/RptDef.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_RPTUIDEF_HXX
+#define _REPORT_RPTUIDEF_HXX
+
+#include "dllapi.h"
+#include <tools/solar.h>
+#include <svx/svdobj.hxx>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/uno3.hxx>
+#include <svx/fmglob.hxx>
+#include <boost/shared_ptr.hpp>
+
+
+FORWARD_DECLARE_INTERFACE(report,XReportComponent)
+FORWARD_DECLARE_INTERFACE(report,XReportDefinition)
+FORWARD_DECLARE_INTERFACE(style,XStyle)
+FORWARD_DECLARE_INTERFACE(beans,XPropertySet)
+
+namespace rptui
+{
+// not all used at the moment
+#define RPT_LAYER_FRONT 0
+#define RPT_LAYER_BACK 1
+#define RPT_LAYER_HIDDEN 2
+
+
+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)
+#define OBJ_DLG_SUBREPORT ((UINT16) OBJ_MAXI + 6)
+
+// 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;
+}
+
+class AnyConverter : public ::std::binary_function< ::rtl::OUString,::com::sun::star::uno::Any,::com::sun::star::uno::Any >
+{
+public:
+ virtual ~AnyConverter(){}
+ virtual ::com::sun::star::uno::Any operator() (const ::rtl::OUString& /*_sPropertyName*/,const ::com::sun::star::uno::Any& lhs) const
+ {
+ return lhs;
+ }
+};
+/** 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);
+typedef ::std::pair< ::rtl::OUString, ::boost::shared_ptr<AnyConverter> > TPropertyConverter;
+DECLARE_STL_USTRINGACCESS_MAP(TPropertyConverter , TPropertyNamePair);
+/** returns the 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 = T();
+ ::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..872938426259
--- /dev/null
+++ b/reportdesign/inc/RptModel.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORT_RPTMODEL_HXX
+#define REPORT_RPTMODEL_HXX
+
+#include "dllapi.h"
+#include <svx/svdmodel.hxx>
+#include <com/sun/star/report/XReportDefinition.hpp>
+
+
+class Window;
+namespace dbaui
+{
+ class OSingleDocumentController;
+}
+namespace reportdesign
+{
+ class OReportDefinition;
+}
+namespace rptui
+{
+//============================================================================
+// OReportModel
+//============================================================================
+
+class OReportPage;
+class OXUndoEnvironment;
+
+class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel
+{
+ friend class OReportPage;
+
+private:
+ OXUndoEnvironment* m_pUndoEnv;
+ ::dbaui::OSingleDocumentController* m_pController;
+ ::reportdesign::OReportDefinition* m_pReportDefinition;
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel();
+
+ OReportModel( const OReportModel& );
+ void operator=(const OReportModel& rSrcModel);
+public:
+ TYPEINFO();
+
+ OReportModel(::reportdesign::OReportDefinition* _pReportDefinition);
+ 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;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createShape(const ::rtl::OUString& aServiceSpecifier,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _rShape,sal_Int32 nOrientation = -1);
+};
+}
+#endif
+
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
new file mode 100644
index 000000000000..5c920947990b
--- /dev/null
+++ b/reportdesign/inc/RptObject.hxx
@@ -0,0 +1,286 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIOBJ_HXX
+#define _REPORT_RPTUIOBJ_HXX
+
+#include "dllapi.h"
+#include <svx/svdoole2.hxx>
+#include <svx/svdouno.hxx>
+
+
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <svx/svdocirc.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdoashp.hxx>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/implementationreference.hxx>
+
+
+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 );
+ 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);
+
+ virtual void SetSnapRectImpl(const Rectangle& _rRect) = 0;
+ virtual SdrPage* GetImplPage() const = 0;
+ virtual void SetObjectItemHelper(const SfxPoolItem& rItem);
+
+ /** 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 );
+
+private:
+ static void ensureSdrObjectOwnership(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxShape );
+
+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);
+ virtual void initializeOle() {}
+
+ sal_Bool supportsService( const ::rtl::OUString& _sServiceName ) 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;
+ inline const ::rtl::OUString getServiceName() const { return m_sComponentName; }
+
+ /** 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 DlgEdFactory;
+
+public:
+ static OCustomShape* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent )
+ {
+ return new OCustomShape( _xComponent );
+ }
+
+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 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent();
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
+ virtual UINT16 GetObjIdentifier() const;
+ virtual UINT32 GetObjInventor() const;
+};
+
+//============================================================================
+// OOle2Obj
+//============================================================================
+class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase
+{
+ friend class OReportPage;
+ friend class DlgEdFactory;
+
+ UINT16 m_nType;
+ bool m_bOnlyOnce;
+ void impl_createDataProvider_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
+public:
+ static OOle2Obj* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,UINT16 _nType )
+ {
+ return new OOle2Obj( _xComponent,_nType );
+ }
+protected:
+ OOle2Obj(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,UINT16 _nType);
+ OOle2Obj(const ::rtl::OUString& _sComponentName,UINT16 _nType);
+
+
+ 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 ~OOle2Obj();
+
+ virtual sal_Int32 GetStep() 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();
+ virtual UINT16 GetObjIdentifier() const;
+ virtual UINT32 GetObjInventor() const;
+ // Clone() soll eine komplette Kopie des Objektes erzeugen.
+ virtual SdrObject* Clone() const;
+ virtual void initializeOle();
+
+ void initializeChart( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel);
+};
+
+//============================================================================
+// OUnoObject
+//============================================================================
+class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
+{
+ friend class OReportPage;
+ friend class OObjectBase;
+ friend class DlgEdFactory;
+
+ sal_uInt16 m_nObjectType;
+protected:
+ 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 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();
+
+ static ::rtl::OUString GetDefaultName(const OUnoObject* _pObj);
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape();
+ virtual UINT16 GetObjIdentifier() const;
+ virtual UINT32 GetObjInventor() const;
+ virtual SdrObject* Clone() const;
+
+private:
+ void impl_setReportComponent_nothrow();
+ void impl_initializeModel_nothrow();
+};
+
+//============================================================================
+} // rptui
+//============================================================================
+#endif // _REPORT_RPTUIOBJ_HXX
+
diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx
new file mode 100644
index 000000000000..f890264d6dc0
--- /dev/null
+++ b/reportdesign/inc/RptPage.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIPAGE_HXX
+#define _REPORT_RPTUIPAGE_HXX
+
+#include "dllapi.h"
+#include "svx/svdpage.hxx"
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <com/sun/star/report/XSection.hpp>
+
+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;
+ bool m_bSpecialInsertMode;
+ std::vector<SdrObject*> m_aTemporaryObjectList;
+
+ OReportPage(const OReportPage&);
+
+ // methode to remove temporary objects, created by 'special mode'
+ // (BegDragObj)
+ void removeTempObject(SdrObject *_pToRemoveObj);
+
+ virtual ~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 SdrPage* Clone() const;
+ using SdrPage::Clone;
+
+ virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason);
+ virtual SdrObject* RemoveObject(ULONG nObjNum);
+
+ /** returns the 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);
+
+ void setSpecialMode() {m_bSpecialInsertMode = true;}
+ bool getSpecialMode() {return m_bSpecialInsertMode;}
+ // all temporary objects will remove and destroy
+ void resetSpecialMode();
+
+ /** 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);
+
+ ::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..3c5920f37a59
--- /dev/null
+++ b/reportdesign/inc/RptResId.hrc
@@ -0,0 +1,298 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _RPTUI_DLGRESID_HRC
+#define _RPTUI_DLGRESID_HRC
+
+// include -----------------------------------------------------------
+
+#ifndef _SOLAR_HRC
+#include <svl/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 )
+// free
+
+#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_DETAIL (RID_STRING_START + 106)
+#define RID_STR_PAGE_HEADER (RID_STRING_START + 107)
+#define RID_STR_GROUPKEEPTOGETHER (RID_STRING_START + 108)
+#define RID_STR_PAGE_FOOTER (RID_STRING_START + 109)
+#define RID_STR_PAGEHEADEROPTION (RID_STRING_START + 110)
+#define RID_STR_PAGEFOOTEROPTION (RID_STRING_START + 111)
+#define RID_STR_REPORT_HEADER (RID_STRING_START + 112)
+#define RID_STR_REPORT_FOOTER (RID_STRING_START + 113)
+#define RID_STR_SCOPE_GROUP (RID_STRING_START + 114)
+#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_FORMULALIST (RID_STRING_START + 140)
+#define RID_STR_SCOPE (RID_STRING_START + 141)
+#define RID_STR_TYPE (RID_STRING_START + 142)
+#define RID_STR_MIMETYPE (RID_STRING_START + 143)
+#define RID_STR_CHARTTYPE (RID_STRING_START + 144)
+#define RID_STR_MASTERFIELDS (RID_STRING_START + 145)
+#define RID_STR_DETAILFIELDS (RID_STRING_START + 146)
+#define RID_STR_EXPLANATION (RID_STRING_START + 147)
+#define RID_STR_DETAILLABEL (RID_STRING_START + 148)
+#define RID_STR_MASTERLABEL (RID_STRING_START + 149)
+#define RID_STR_PREVIEW_COUNT (RID_STRING_START + 150)
+#define RID_ERR_NO_COMMAND (RID_STRING_START + 151)
+#define RID_ERR_NO_OBJECTS (RID_STRING_START + 152)
+#define RID_STR_AREA (RID_STRING_START + 153)
+#define RID_STR_INSERT (RID_STRING_START + 154)
+#define RID_STR_UNDO_SHRINK (RID_STRING_START + 155)
+#define RID_STR_F_COUNTER (RID_STRING_START + 156)
+#define RID_STR_F_ACCUMULATION (RID_STRING_START + 157)
+#define RID_STR_F_MINIMUM (RID_STRING_START + 158)
+#define RID_STR_F_MAXIMUM (RID_STRING_START + 159)
+#define RID_STR_VERTICALALIGN (RID_STRING_START + 160)
+#define RID_STR_PARAADJUST (RID_STRING_START + 161)
+
+
+// #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 )
+#define RID_TB_SORTING ( RID_MENU_START + 3 )
+
+// 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)
+#define IMGLST_GROUPSORT_DLG_SC (RID_IMAGELIST_START + 6)
+#define IMGLST_GROUPSORT_DLG_SCH (RID_IMAGELIST_START + 7)
+#define IMG_ADDFIELD_DLG_SC (RID_IMAGELIST_START + 8)
+#define IMG_ADDFIELD_DLG_SCH (RID_IMAGELIST_START + 9)
+#define IMG_ADDFIELD_DLG_LC (RID_IMAGELIST_START + 10)
+#define IMG_ADDFIELD_DLG_LCH (RID_IMAGELIST_START + 11)
+
+#define ADDFIELD_FL_HELP_SEPARATOR (RID_IMAGELIST_START + 12)
+#define ADDFIELD_HELP_FIELD (RID_IMAGELIST_START + 13)
+
+// untyped ---------------------------------------------------------------------
+#define RID_STR_BOOL (RID_UNTYPED_START + 0 )
+#define RID_STR_FORCENEWPAGE_CONST (RID_UNTYPED_START + 1 )
+#define RID_STR_KEEPTOGETHER_CONST (RID_UNTYPED_START + 2)
+#define RID_STR_GROUPKEEPTOGETHER_CONST (RID_UNTYPED_START + 3)
+#define RID_STR_REPORTPRINTOPTION_CONST (RID_UNTYPED_START + 4)
+#define RID_STR_SECTIONPAGEBREAK_CONST (RID_UNTYPED_START + 5)
+#define RID_STR_TYPE_CONST (RID_UNTYPED_START + 6)
+#define RID_STR_VERTICAL_ALIGN_CONST (RID_UNTYPED_START + 7)
+#define RID_STR_PARAADJUST_CONST (RID_UNTYPED_START + 8)
+
+// toolbox lists ---------------------------------------------------------------------
+
+#define SID_RPT_GROUPSORT_MOVE_UP ( RID_TOOLBOX_START + 0 )
+#define SID_RPT_GROUPSORT_MOVE_DOWN ( RID_TOOLBOX_START + 1 )
+#define SID_RPT_GROUPSORT_DELETE ( RID_TOOLBOX_START + 2 )
+
+#endif // _RPTUI_DLGRESID_HRC
+
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx
new file mode 100644
index 000000000000..180fa616cf39
--- /dev/null
+++ b/reportdesign/inc/UndoActions.hxx
@@ -0,0 +1,300 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_UNDOACTIONS_HXX
+#define RPTUI_UNDOACTIONS_HXX
+
+#include "dllapi.h"
+#include <svx/svdundo.hxx>
+#include <tools/string.hxx>
+/** === begin UNO includes === **/
+#include <com/sun/star/util/XModifyListener.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/script/ScriptEvent.hpp>
+#include <com/sun/star/script/XScriptListener.hpp>
+#include <com/sun/star/script/ScriptEventDescriptor.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/ContainerEvent.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XGroup.hpp>
+/** === end UNO includes === **/
+#include <cppuhelper/implbase3.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/sequence.hxx>
+#include <svl/lstner.hxx>
+#include <svx/svdouno.hxx>
+#include "RptModel.hxx"
+
+#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(); }
+
+ inline ::sal_Bool getReportHeaderOn() { return m_xReport->getReportHeaderOn(); }
+ inline ::sal_Bool getReportFooterOn() { return m_xReport->getReportFooterOn(); }
+ inline ::sal_Bool getPageHeaderOn() { return m_xReport->getPageHeaderOn(); }
+ inline ::sal_Bool getPageFooterOn() { return m_xReport->getPageFooterOn(); }
+
+ 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 UndoManagerListAction
+ {
+ private:
+ SfxUndoManager& m_rManager;
+
+ public:
+ UndoManagerListAction( SfxUndoManager& _rManager, const String& _rListActionComment )
+ :m_rManager( _rManager )
+ {
+ m_rManager.EnterListAction( _rListActionComment, String() );
+ }
+ ~UndoManagerListAction()
+ {
+ m_rManager.LeaveListAction();
+ }
+ };
+
+ 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 ~OCommentUndoAction();
+
+ 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..aba6f31970e9
--- /dev/null
+++ b/reportdesign/inc/UndoEnv.hxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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>
+#include <svl/lstner.hxx>
+
+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();
+
+ void SetUndoMode(sal_Bool _bUndo);
+
+ public:
+ OXUndoEnvironment(OReportModel& _rModel);
+
+ /**
+ Create an object ob OUndoEnvLock locks the undo possibility
+ As long as in the OUndoEnvLock scope, no undo is possible for manipulated object.
+ */
+ class OUndoEnvLock
+ {
+ OXUndoEnvironment& m_rUndoEnv;
+ public:
+ OUndoEnvLock(OXUndoEnvironment& _rUndoEnv): m_rUndoEnv(_rUndoEnv){m_rUndoEnv.Lock();}
+ ~OUndoEnvLock(){ m_rUndoEnv.UnLock(); }
+ };
+
+ /**
+ This is near the same as OUndoEnvLock but it is also possible to ask for the current mode.
+ UndoMode will set if SID_UNDO is called in execute()
+ */
+ class OUndoMode
+ {
+ OXUndoEnvironment& m_rUndoEnv;
+ public:
+ OUndoMode(OXUndoEnvironment& _rUndoEnv)
+ :m_rUndoEnv(_rUndoEnv)
+ {
+ m_rUndoEnv.Lock();
+ m_rUndoEnv.SetUndoMode(sal_True);
+ }
+ ~OUndoMode()
+ {
+ m_rUndoEnv.SetUndoMode(sal_False);
+ m_rUndoEnv.UnLock();
+ }
+ };
+
+ void Lock();
+ void UnLock();
+ sal_Bool IsLocked() const;
+
+ // returns sal_True is we are in UNDO
+ sal_Bool IsUndoMode() 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);
+
+ 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/conditionalexpression.hxx b/reportdesign/inc/conditionalexpression.hxx
new file mode 100644
index 000000000000..372cb65a924b
--- /dev/null
+++ b/reportdesign/inc/conditionalexpression.hxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef CONDITIONALEXPRESSION_HXX
+#define CONDITIONALEXPRESSION_HXX
+
+#include "dllapi.h"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <rtl/ustring.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+#include <map>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ // =============================================================================
+ // = ConditionalExpression
+ // =============================================================================
+ class REPORTDESIGN_DLLPUBLIC ConditionalExpression
+ {
+ private:
+ const ::rtl::OUString m_sPattern;
+
+ public:
+ ConditionalExpression( const sal_Char* _pAsciiPattern );
+
+ /** assembles an expression string from a field data source, and one or two operands
+ */
+ ::rtl::OUString assembleExpression( const ::rtl::OUString& _rFieldDataSource, const ::rtl::OUString& _rLHS, const ::rtl::OUString& _rRHS ) const;
+
+ /** matches the given expression string to the expression pattern represented by the object
+ @param _rExpression
+ the expression to match
+ @param _rFieldDataSource
+ the field data source
+ @param _out_rLHS
+ output parameter taking the left hand side operand, if successful
+ @param _out_rRHS
+ output parameter taking the right hand side operand, if successful
+ @return
+ <TRUE/> if and only if the expression string could be successfully matched to
+ the pattern.
+ */
+ bool matchExpression( const ::rtl::OUString& _rExpression, const ::rtl::OUString& _rFieldDataSource, ::rtl::OUString& _out_rLHS, ::rtl::OUString& _out_rRHS ) const;
+ };
+
+ //========================================================================
+ //= 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
+ };
+
+ typedef ::boost::shared_ptr< ConditionalExpression > PConditionalExpression;
+ typedef ::std::map< ComparisonOperation, PConditionalExpression > ConditionalExpressions;
+
+ // =============================================================================
+ // = ConditionalExpressionFactory
+ // =============================================================================
+ class REPORTDESIGN_DLLPUBLIC ConditionalExpressionFactory
+ {
+ public:
+ /// fills the given map with all ConditionalExpressions which we know
+ static size_t getKnownConditionalExpressions( ConditionalExpressions& _out_rCondExp );
+
+ private:
+ ConditionalExpressionFactory(); // never implemented
+ ConditionalExpressionFactory( const ConditionalExpressionFactory& ); // never implemented
+ ConditionalExpressionFactory& operator=( const ConditionalExpressionFactory& ); // never implemented
+ };
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // CONDITIONALEXPRESSION_HXX
diff --git a/reportdesign/inc/dllapi.h b/reportdesign/inc/dllapi.h
new file mode 100644
index 000000000000..162338860bc9
--- /dev/null
+++ b/reportdesign/inc/dllapi.h
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_REPORTDESIGNDLLAPI_H
+#define INCLUDED_REPORTDESIGNDLLAPI_H
+
+#include "sal/types.h"
+
+#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_REPORTDESIGNDLLAPI_H */
+
diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc
new file mode 100644
index 000000000000..7b543169e032
--- /dev/null
+++ b/reportdesign/inc/helpids.hrc
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#define RTPUI_REPORTDESIGN_HELPID_HRC
+
+#define UID_RPT_PROP_FORMULA "REPORTDESIGN_UID_RPT_PROP_FORMULA"
+#define UID_RPT_RPT_PROP_DLG_FONT_TYPE "REPORTDESIGN_UID_RPT_RPT_PROP_DLG_FONT_TYPE"
+#define UID_RPT_RPT_PROP_DLG_AREA "REPORTDESIGN_UID_RPT_RPT_PROP_DLG_AREA"
+#define UID_RPT_PROP_CHARTTYPE_DLG "REPORTDESIGN_UID_RPT_PROP_CHARTTYPE_DLG"
+#define UID_RPT_PROP_DLG_LINKFIELDS "REPORTDESIGN_UID_RPT_PROP_DLG_LINKFIELDS"
+
+#define UID_RPT_RPT_APP_VIEW "REPORTDESIGN_UID_RPT_RPT_APP_VIEW"
+#define UID_RPT_SCROLLWINDOW "REPORTDESIGN_UID_RPT_SCROLLWINDOW"
+#define UID_RPT_REPORTWINDOW "REPORTDESIGN_UID_RPT_REPORTWINDOW"
+#define HID_RPT_HORZ_RULER "REPORTDESIGN_HID_RPT_HORZ_RULER"
+#define UID_RPT_SECTIONSWINDOW "REPORTDESIGN_UID_RPT_SECTIONSWINDOW"
+#define UID_RPT_VIEWSWINDOW "REPORTDESIGN_UID_RPT_VIEWSWINDOW"
+#define HID_RPT_ENDMARKER "REPORTDESIGN_HID_RPT_ENDMARKER"
+#define HID_RPT_SPLITTER "REPORTDESIGN_HID_RPT_SPLITTER"
+#define HID_REPORTSECTION "REPORTDESIGN_HID_REPORTSECTION"
+#define HID_RPT_HORZ_SCROLLBAR "REPORTDESIGN_HID_RPT_HORZ_SCROLLBAR"
+#define HID_RPT_VERT_SCROLLBAR "REPORTDESIGN_HID_RPT_VERT_SCROLLBAR"
+#define HID_RPT_STARTMARKER "REPORTDESIGN_HID_RPT_STARTMARKER"
+#define HID_RPT_FIELDEXPRESSION "REPORTDESIGN_HID_RPT_FIELDEXPRESSION"
+#define HID_RPT_SORTORDER "REPORTDESIGN_HID_RPT_SORTORDER"
+#define HID_RPT_GROUPSBRW "REPORTDESIGN_HID_RPT_GROUPSBRW"
+#define HID_RPT_GROUPSSORTING_DLG "REPORTDESIGN_HID_RPT_GROUPSSORTING_DLG"
+#define HID_RPT_PAGENUMBERS_DLG "REPORTDESIGN_HID_RPT_PAGENUMBERS_DLG"
+#define HID_RPT_DATETIME_DLG "REPORTDESIGN_HID_RPT_DATETIME_DLG"
+#define HID_RPT_CONDFORMAT_DLG "REPORTDESIGN_HID_RPT_CONDFORMAT_DLG"
+#define HID_RPT_CONDFORMAT_TB "REPORTDESIGN_HID_RPT_CONDFORMAT_TB"
+#define HID_RPT_CRTL_FORMAT_PREVIEW "REPORTDESIGN_HID_RPT_CRTL_FORMAT_PREVIEW"
+#define HID_RPT_COND_DLG "REPORTDESIGN_HID_RPT_COND_DLG"
+#define HID_RPT_POPUP_COLOR_CTRL "REPORTDESIGN_HID_RPT_POPUP_COLOR_CTRL"
+#define HID_RPT_POPUP_COLOR "REPORTDESIGN_HID_RPT_POPUP_COLOR"
+#define HID_RPT_FIELD_SEL "REPORTDESIGN_HID_RPT_FIELD_SEL"
+#define HID_RPT_FIELD_SEL_WIN "REPORTDESIGN_HID_RPT_FIELD_SEL_WIN"
+#define HID_RPT_PROPDLG_TAB_GENERAL "REPORTDESIGN_HID_RPT_PROPDLG_TAB_GENERAL"
+#define HID_RPT_PROPDLG_TAB_DATA "REPORTDESIGN_HID_RPT_PROPDLG_TAB_DATA"
+
+#define HID_RPT_PROP_FORCENEWPAGE "REPORTDESIGN_HID_RPT_PROP_FORCENEWPAGE"
+#define HID_RPT_PROP_NEWROWORCOL "REPORTDESIGN_HID_RPT_PROP_NEWROWORCOL"
+#define HID_RPT_PROP_KEEPTOGETHER "REPORTDESIGN_HID_RPT_PROP_KEEPTOGETHER"
+#define HID_RPT_PROP_CANGROW "REPORTDESIGN_HID_RPT_PROP_CANGROW"
+#define HID_RPT_PROP_CANSHRINK "REPORTDESIGN_HID_RPT_PROP_CANSHRINK"
+#define HID_RPT_PROP_REPEATSECTION "REPORTDESIGN_HID_RPT_PROP_REPEATSECTION"
+#define HID_RPT_PROP_FORMULALIST "REPORTDESIGN_HID_RPT_PROP_FORMULALIST"
+#define HID_RPT_PROP_SCOPE "REPORTDESIGN_HID_RPT_PROP_SCOPE"
+#define HID_RPT_PROP_TYPE "REPORTDESIGN_HID_RPT_PROP_TYPE"
+#define HID_RPT_PROP_MASTERFIELDS "REPORTDESIGN_HID_RPT_PROP_MASTERFIELDS"
+#define HID_RPT_PROP_DETAILFIELDS "REPORTDESIGN_HID_RPT_PROP_DETAILFIELDS"
+#define HID_RPT_PROP_AREA "REPORTDESIGN_HID_RPT_PROP_AREA"
+#define HID_RPT_PROP_MIMETYPE "REPORTDESIGN_HID_RPT_PROP_MIMETYPE"
+// free
+// free
+#define HID_RPT_PROP_PRINTREPEATEDVALUES "REPORTDESIGN_HID_RPT_PROP_PRINTREPEATEDVALUES"
+#define HID_RPT_PROP_CONDITIONALPRINTEXPRESSION "REPORTDESIGN_HID_RPT_PROP_CONDITIONALPRINTEXPRESSION"
+#define HID_RPT_PROP_VERTICALALIGN "REPORTDESIGN_HID_RPT_PROP_VERTICALALIGN"
+#define HID_RPT_PROP_STARTNEWCOLUMN "REPORTDESIGN_HID_RPT_PROP_STARTNEWCOLUMN"
+#define HID_RPT_PROP_STARTNEWPAGE "REPORTDESIGN_HID_RPT_PROP_STARTNEWPAGE"
+#define HID_RPT_PROP_RESETPAGENUMBER "REPORTDESIGN_HID_RPT_PROP_RESETPAGENUMBER"
+#define HID_RPT_PROP_PARAADJUST "REPORTDESIGN_HID_RPT_PROP_PARAADJUST"
+#define HID_RPT_PROP_MINHEIGHTNEWPAGE "REPORTDESIGN_HID_RPT_PROP_MINHEIGHTNEWPAGE"
+#define HID_RPT_PROP_PRINTWHENGROUPCHANGE "REPORTDESIGN_HID_RPT_PROP_PRINTWHENGROUPCHANGE"
+#define HID_RPT_PROP_CHARTTYPE "REPORTDESIGN_HID_RPT_PROP_CHARTTYPE"
+// free
+// free
+#define HID_RPT_PROP_VISIBLE "REPORTDESIGN_HID_RPT_PROP_VISIBLE"
+#define HID_RPT_PROP_GROUPKEEPTOGETHER "REPORTDESIGN_HID_RPT_PROP_GROUPKEEPTOGETHER"
+#define HID_RPT_PROP_PAGEHEADEROPTION "REPORTDESIGN_HID_RPT_PROP_PAGEHEADEROPTION"
+#define HID_RPT_PROP_PAGEFOOTEROPTION "REPORTDESIGN_HID_RPT_PROP_PAGEFOOTEROPTION"
+#define UID_RPT_PROP_DLG_LINE_STYLE "REPORTDESIGN_UID_RPT_PROP_DLG_LINE_STYLE"
+#define HID_RPT_PROP_PREVIEW_COUNT "REPORTDESIGN_HID_RPT_PROP_PREVIEW_COUNT"
+#define HID_RPT_PROP_DATAFIELD "REPORTDESIGN_HID_RPT_PROP_DATAFIELD"
+#define HID_RPT_PROP_BACKCOLOR "REPORTDESIGN_HID_RPT_PROP_BACKCOLOR"
+#define HID_RPT_PROP_RPT_POSITIONX "REPORTDESIGN_HID_RPT_PROP_RPT_POSITIONX"
+#define HID_RPT_PROP_RPT_POSITIONY "REPORTDESIGN_HID_RPT_PROP_RPT_POSITIONY"
+#define HID_RPT_PROP_RPT_WIDTH "REPORTDESIGN_HID_RPT_PROP_RPT_WIDTH"
+#define HID_RPT_PROP_RPT_HEIGHT "REPORTDESIGN_HID_RPT_PROP_RPT_HEIGHT"
+#define HID_RPT_START_TITLE "REPORTDESIGN_HID_RPT_START_TITLE"
+#define HID_RPT_START_IMAGE "REPORTDESIGN_HID_RPT_START_IMAGE"
+#define HID_RPT_PROP_DEEPTRAVERSING "REPORTDESIGN_HID_RPT_PROP_DEEPTRAVERSING"
+#define HID_RPT_PROP_PREEVALUATED "REPORTDESIGN_HID_RPT_PROP_PREEVALUATED"
+#define HID_RPT_NAVIGATOR_DLG "REPORTDESIGN_HID_RPT_NAVIGATOR_DLG"
+#define HID_REPORT_NAVIGATOR_TREE "REPORTDESIGN_HID_REPORT_NAVIGATOR_TREE"
+#define HID_RPT_PROP_FORMULA "REPORTDESIGN_HID_RPT_PROP_FORMULA"
+#define HID_RPT_PROP_INITIALFORMULA "REPORTDESIGN_HID_RPT_PROP_INITIALFORMULA"
+#define HID_RPT_PROP_RPT_FONT "REPORTDESIGN_HID_RPT_PROP_RPT_FONT"
+#define HID_RPT_PROP_PRESERVEIRI "REPORTDESIGN_HID_RPT_PROP_PRESERVEIRI"
+#define HID_RPT_PROP_BACKTRANSPARENT "REPORTDESIGN_HID_RPT_PROP_BACKTRANSPARENT"
+#define HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT "REPORTDESIGN_HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT"
+
+#define HID_RPT_GROUPSORT_MOVE_UP "REPORTDESIGN_HID_RPT_GROUPSORT_MOVE_UP"
+#define HID_RPT_GROUPSORT_MOVE_DOWN "REPORTDESIGN_HID_RPT_GROUPSORT_MOVE_DOWN"
+#define HID_RPT_GROUPSORT_DELETE "REPORTDESIGN_HID_RPT_GROUPSORT_DELETE"
+
+#endif //RTPUI_REPORTDESIGN_HELPID_HRC
+
diff --git a/reportdesign/inc/makefile.mk b/reportdesign/inc/makefile.mk
new file mode 100644
index 000000000000..b24d73a7cd92
--- /dev/null
+++ b/reportdesign/inc/makefile.mk
@@ -0,0 +1,47 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+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..d22a705b51a9
--- /dev/null
+++ b/reportdesign/inc/pch/precompiled_reportdesign.cxx
@@ -0,0 +1,29 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "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..aa6cd18038fe
--- /dev/null
+++ b/reportdesign/inc/pch/precompiled_reportdesign.hxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:38.561560
+
+#ifdef PRECOMPILED_HEADERS
+#include "com/sun/star/sdb/CommandType.hpp"
+//#include "com/sun/star/chart2/data/DatabaseDataProvider.hpp"
+#include "com/sun/star/chart2/data/XDataReceiver.hpp"
+#include "com/sun/star/reflection/XProxyFactory.hpp"
+#include "com/sun/star/sdb/CommandType.hpp"
+#include "comphelper/sequence.hxx"
+#include "comphelper/sequenceashashmap.hxx"
+#include "comphelper/documentconstants.hxx"
+#include "xmloff/attrlist.hxx"
+#include "xmloff/xmltoken.hxx"
+#include "xmloff/xmlement.hxx"
+#include "xmloff/xmluconv.hxx"
+#include "xmloff/xmltkmap.hxx"
+#include "xmloff/xmlnmspe.hxx"
+#endif
diff --git a/reportdesign/inc/reportformula.hxx b/reportdesign/inc/reportformula.hxx
new file mode 100644
index 000000000000..fa809d237c75
--- /dev/null
+++ b/reportdesign/inc/reportformula.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef REPORTFORMULA_HXX
+#define REPORTFORMULA_HXX
+
+#include "dllapi.h"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/Any.hxx>
+/** === end UNO includes === **/
+
+#include <osl/diagnose.h>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ //====================================================================
+ //= ReportFormula
+ //====================================================================
+ class REPORTDESIGN_DLLPUBLIC ReportFormula
+ {
+ public:
+ enum BindType
+ {
+ Expression,
+ Field,
+
+ Invalid
+ };
+
+ private:
+ BindType m_eType;
+ ::rtl::OUString m_sCompleteFormula;
+ ::rtl::OUString m_sUndecoratedContent;
+
+ public:
+ /// constructs a ReportFormula object from a string
+ ReportFormula( const ::rtl::OUString& _rFormula );
+
+ /// constructs a ReportFormula by BindType
+ ReportFormula( const BindType _eType, const ::rtl::OUString& _rFieldOrExpression );
+ ~ReportFormula();
+
+ ReportFormula& operator=(class ReportFormula const &);
+
+ /// returns whether the object denotes a valid formula
+ bool isValid() const;
+
+ /// returns the type of the binding represented by the formula
+ inline BindType getType() const { return m_eType; }
+
+ /// returns the complete formula represented by the object
+ const ::rtl::OUString&
+ getCompleteFormula() const;
+
+ /** gets the <em>undecorated formula</em> content
+
+ If the formula denotes a field binding, the <em>undecorated content</em> is the
+ field name.
+
+ If the formula denotes an expression, then the <em>undecorated content</em> is the expression
+ itself.
+ */
+ const ::rtl::OUString& getUndecoratedContent() const;// { return m_sUndecoratedContent; }
+
+ /// convenience alias for <code>getUndecoratedContent</code>, which asserts (in a non-product build) when used on an expression
+ inline ::rtl::OUString getFieldName() const;
+
+ /**
+ @returns "=" + getFieldName()
+ */
+ ::rtl::OUString getEqualUndecoratedContent() const;
+
+ /// convenience alias for <code>getUndecoratedContent</code>, which asserts (in a non-product build) when used on a field
+ inline ::rtl::OUString getExpression() const;
+
+ /** returns a bracketed field name of the formula denotes a field reference,
+ or the undecorated expression if the formula denotes an expression.
+
+ Effectively, this means the method returns the complete formular, stripped by the prefix
+ which indicates a field or a expression.
+ */
+ ::rtl::OUString getBracketedFieldOrExpression() const;
+
+ private:
+ void impl_construct( const ::rtl::OUString& _rFormula );
+ };
+
+ //--------------------------------------------------------------------
+ inline ::rtl::OUString ReportFormula::getFieldName() const
+ {
+ OSL_PRECOND( getType() == Field, "ReportFormula::getFieldName: not bound to a field!" );
+ return getUndecoratedContent();
+ }
+
+ //--------------------------------------------------------------------
+ inline ::rtl::OUString ReportFormula::getExpression() const
+ {
+ OSL_PRECOND( getType() == Expression, "ReportFormula::getExpression: not bound to an expression!" );
+ return getUndecoratedContent();
+ }
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // REPORTFORMULA_HXX
diff --git a/reportdesign/inc/rptui_slotid.hrc b/reportdesign/inc/rptui_slotid.hrc
new file mode 100644
index 000000000000..18ab6d5b0181
--- /dev/null
+++ b/reportdesign/inc/rptui_slotid.hrc
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _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 )
+
+#define SID_SELECT_ALL_LABELS ( SID_RPTUI_START + 161 )
+#define SID_SELECT_ALL_EDITS ( SID_RPTUI_START + 162 )
+
+#define SID_SECTION_SHRINK ( SID_RPTUI_START + 163 )
+#define SID_SECTION_SHRINK_TOP ( SID_RPTUI_START + 164 )
+#define SID_SECTION_SHRINK_BOTTOM ( SID_RPTUI_START + 165 )
+#define SID_SECTION_SHRINK_MENU ( SID_RPTUI_START + 166 )
+
+#define SID_COLLAPSE_SECTION ( SID_RPTUI_START + 167 )
+#define SID_EXPAND_SECTION ( SID_RPTUI_START + 168 )
+
+#endif // _RPTUI_SLOTID_HRC_
diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst
new file mode 100644
index 000000000000..d4e26e51acdc
--- /dev/null
+++ b/reportdesign/prj/build.lst
@@ -0,0 +1,18 @@
+rd reportdesign : l10n BOOST:boost comphelper dbaccess formula LIBXSLT:libxslt NULL
+rd reportdesign usr1 - all rd_mkout NULL
+rd reportdesign\inc nmake - all rd_inc NULL
+rd reportdesign\source\core\api nmake - all rd_api rd_inc NULL
+rd reportdesign\source\core\resource nmake - all rd_res rd_inc NULL
+rd reportdesign\source\core\sdr nmake - all rd_sdr rd_inc NULL
+rd reportdesign\source\core\misc nmake - all rd_misc rd_inc NULL
+rd reportdesign\source\shared nmake - all rd_shared rd_inc NULL
+rd reportdesign\source\ui\misc nmake - all rd_uimisc rd_inc NULL
+rd reportdesign\source\ui\dlg nmake - all rd_uidlg rd_inc NULL
+rd reportdesign\source\ui\report nmake - all rd_uireport rd_inc NULL
+rd reportdesign\source\ui\inspection nmake - all rd_uiinspection rd_inc NULL
+rd reportdesign\source\filter\xml nmake - all rd_filter_xml rd_inc NULL
+rd reportdesign\util nmake - all rd_util rd_api rd_res rd_shared rd_uimisc rd_uidlg rd_uireport rd_uiinspection rd_sdr rd_misc rd_filter_xml NULL
+
+# has problems in m78, in m83 also
+# rd reportdesign\qa\complex\reportdesign nmake - all rd_qa_complex NULL
+
diff --git a/reportdesign/prj/d.lst b/reportdesign/prj/d.lst
new file mode 100644
index 000000000000..d7cc5fad6396
--- /dev/null
+++ b/reportdesign/prj/d.lst
@@ -0,0 +1,24 @@
+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\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
+
+..\%__SRC%\misc\rpt.component %_DEST%\xml%_EXT%\rpt.component
+..\%__SRC%\misc\rptui.component %_DEST%\xml%_EXT%\rptui.component
+..\%__SRC%\misc\rptxml.component %_DEST%\xml%_EXT%\rptxml.component
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/qa/complex/reportdesign/FileURL.java b/reportdesign/qa/complex/reportdesign/FileURL.java
new file mode 100644
index 000000000000..9d2cdb89bd0e
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/FileURL.java
@@ -0,0 +1,62 @@
+/*
+ * ************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ * ************************************************************************
+ */
+
+package complex.reportdesign;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ *
+ * @author ll93751
+ */
+public class FileURL
+{
+ String m_sFileURL;
+
+ public FileURL(String _sFileURL)
+ {
+ m_sFileURL = _sFileURL;
+ }
+ public boolean exists()
+ {
+ try
+ {
+ final URI aURI = new URI(m_sFileURL);
+ final File aFile = new File(aURI);
+ return aFile.exists();
+ }
+ catch (URISyntaxException ex)
+ {
+ System.out.println("Error: URI is wrong. '" + m_sFileURL + "': " + ex.getMessage());
+ }
+ return false;
+ }
+}
diff --git a/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java
new file mode 100755
index 000000000000..346c28569929
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java
@@ -0,0 +1,652 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+package complex.reportdesign;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.frame.XComponentLoader;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XModel;
+import com.sun.star.frame.XStorable;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.sdb.XDocumentDataSource;
+import com.sun.star.sdb.XOfficeDatabaseDocument;
+import com.sun.star.sdb.XReportDocumentsSupplier;
+import com.sun.star.sdb.application.XDatabaseDocumentUI;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XInterface;
+import com.sun.star.util.XCloseable;
+
+// import util.BasicMacroTools;
+// import util.DesktopTools;
+// import util.dbg;
+// import complexlib.ComplexTestCase;
+// import util.utils;
+import helper.OfficeProvider;
+import helper.URLHelper;
+// import helper.OfficeWatcher;
+
+import convwatch.DB;
+
+// import java.util.Date;
+// import java.text.SimpleDateFormat;
+// import java.text.ParsePosition;
+// import java.sql.Time;
+//
+// import java.io.BufferedReader;
+// import java.io.File;
+// import java.io.FileReader;
+// import java.io.IOException;
+// import java.io.FilenameFilter;
+//
+// import java.util.Vector;
+//
+// import helper.AppProvider;
+// import java.text.DecimalFormat;
+// import util.DynamicClassLoader;
+// import java.util.StringTokenizer;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openoffice.test.OfficeConnection;
+import static org.junit.Assert.*;
+
+
+class PropertySetHelper
+{
+ XPropertySet m_xPropertySet;
+ public PropertySetHelper(Object _aObj)
+ {
+ m_xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _aObj);
+ }
+
+ /**
+ get a property and don't convert it
+ @param _sName the string name of the property
+ @return the object value of the property without any conversion
+ */
+ public Object getPropertyValueAsObject(String _sName)
+ {
+ Object aObject = null;
+
+ if (m_xPropertySet != null)
+ {
+ try
+ {
+ aObject = m_xPropertySet.getPropertyValue(_sName);
+ }
+ catch (com.sun.star.beans.UnknownPropertyException e)
+ {
+ System.out.println("ERROR: UnknownPropertyException caught. '" + _sName + "'");
+ System.out.println("Message: " + e.getMessage());
+ }
+ catch (com.sun.star.lang.WrappedTargetException e)
+ {
+ System.out.println("ERROR: WrappedTargetException caught.");
+ System.out.println("Message: " + e.getMessage());
+ }
+ }
+ return aObject;
+ }
+}
+
+class PropertyHelper
+{
+ /**
+ Create a PropertyValue[] from a ArrayList
+ @param _aArrayList
+ @return a PropertyValue[]
+ */
+ public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList)
+ {
+ // copy the whole PropertyValue List to an PropertyValue Array
+ PropertyValue[] aSaveProperties = null;
+
+ if (_aPropertyList == null)
+ {
+ aSaveProperties = new PropertyValue[0];
+ }
+ else
+ {
+ if (_aPropertyList.size() > 0)
+ {
+ aSaveProperties = new PropertyValue[_aPropertyList.size()];
+ for (int i = 0;i<_aPropertyList.size(); i++)
+ {
+ aSaveProperties[i] = (PropertyValue) _aPropertyList.get(i);
+ }
+ }
+ else
+ {
+ aSaveProperties = new PropertyValue[0];
+ }
+ }
+ return aSaveProperties;
+ }
+}
+
+public class ReportDesignerTest
+{
+
+ String mTestDocumentPath;
+
+// public String[] getTestMethodNames()
+// {
+// return new String[] {"firsttest"};
+// }
+
+ @Before public void before()
+ {
+ System.out.println("before");
+ // String tempdir = System.getProperty("java.io.tmpdir");
+ //
+ int dummy = 0;
+ // m_xXMultiServiceFactory = getMSF();
+ }
+
+ @After public void after()
+ {
+ System.out.println("after");
+ }
+
+// private void checkIfOfficeExists(String _sOfficePathWithTrash)
+// {
+// String sOfficePath = "";
+// int nIndex = _sOfficePathWithTrash.indexOf("soffice.exe");
+// if (nIndex > 0)
+// {
+// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 11);
+// }
+// else
+// {
+// nIndex = _sOfficePathWithTrash.indexOf("soffice");
+// if (nIndex > 0)
+// {
+// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 7);
+// }
+// }
+//
+// System.out.println(sOfficePath);
+// File sOffice = new File(sOfficePath);
+// if (! sOffice.exists())
+// {
+// System.out.println("ERROR: There exists no office installation at given path: '" + sOfficePath + "'");
+// System.exit(0);
+// }
+// }
+
+
+ private XDesktop m_xDesktop = null;
+ public XDesktop getXDesktop()
+ {
+
+ if (m_xDesktop == null)
+ {
+ try
+ {
+ XInterface xInterface = (XInterface) getMSF().createInstance( "com.sun.star.frame.Desktop" );
+ m_xDesktop = UnoRuntime.queryInterface(XDesktop.class, xInterface);
+ assertNotNull("Can't get XDesktop", m_xDesktop);
+ }
+ catch (com.sun.star.uno.Exception e)
+ {
+ System.out.println("ERROR: uno.Exception caught");
+ System.out.println("Message: " + e.getMessage());
+ }
+ }
+ return m_xDesktop;
+ }
+
+ private void showElements(XNameAccess _xNameAccess)
+ {
+ if (_xNameAccess != null)
+ {
+ String[] sElementNames = _xNameAccess.getElementNames();
+ for(int i=0;i<sElementNames.length; i++)
+ {
+ System.out.println("Value: [" + i + "] := " + sElementNames[i]);
+ }
+ }
+ else
+ {
+ System.out.println("Warning: Given object is null.");
+ }
+ }
+
+
+ private OfficeProvider m_aProvider = null;
+// private void startOffice()
+// {
+// // int tempTime = param.getInt("SingleTimeOut");
+// param.put("TimeOut", new Integer(300000));
+// System.out.println("TimeOut: " + param.getInt("TimeOut"));
+// System.out.println("ThreadTimeOut: " + param.getInt("ThreadTimeOut"));
+//
+// // OfficeProvider aProvider = null;
+// m_aProvider = new OfficeProvider();
+// m_xXMultiServiceFactory = (XMultiServiceFactory) m_aProvider.getManager(param);
+// param.put("ServiceFactory", m_xXMultiServiceFactory);
+// }
+//
+// private void stopOffice()
+// {
+// if (m_aProvider != null)
+// {
+// m_aProvider.closeExistingOffice(param, true);
+// m_aProvider = null;
+// }
+// }
+
+ private String m_sMailAddress = null;
+ private String m_sUPDMinor;
+ private String m_sCWS_WORK_STAMP;
+
+ private static final int WRITER = 1;
+ private static final int CALC = 2;
+
+ @Test public void firsttest()
+ {
+ // convwatch.GlobalLogWriter.set(log);
+
+ // -------------------- preconditions, try to find an office --------------------
+
+// String sAppExecutionCommand = (String) param.get("AppExecutionCommand");
+
+ String sUser = System.getProperty("user.name");
+ System.out.println("user.name='" + sUser + "'");
+
+ String sVCSID = System.getProperty("VCSID");
+ System.out.println("VCSID='" + sVCSID + "'");
+ m_sMailAddress = sVCSID + "@openoffice.org";
+ System.out.println("Assumed mail address: " + m_sMailAddress);
+
+ m_sUPDMinor = System.getProperty("UPDMINOR");
+ m_sCWS_WORK_STAMP = System.getProperty("CWS_WORK_STAMP");
+ // createDBEntry();
+ System.out.println("Current CWS: " + m_sCWS_WORK_STAMP);
+ System.out.println("Current MWS: " + m_sUPDMinor);
+
+ // System.exit(1);
+
+// sAppExecutionCommand = sAppExecutionCommand.replaceAll( "\\$\\{USERNAME\\}", sUser);
+// System.out.println("sAppExecutionCommand='" + sAppExecutionCommand + "'");
+//
+ // an other way to replace strings
+ // sAppExecutionCommand = utils.replaceAll13(sAppExecutionCommand, "${USERNAME}", sUser);
+
+// checkIfOfficeExists(sAppExecutionCommand);
+// param.put("AppExecutionCommand", new String(sAppExecutionCommand));
+
+ // --------------------------- Start the given Office ---------------------------
+
+// startOffice();
+
+ // ------------------------------ Start a test run ------------------------------
+
+// String sCurrentDirectory = System.getProperty("user.dir");
+// System.out.println("Current Dir: " + sCurrentDirectory);
+//
+ String sWriterDocument = TestDocument.getUrl("RPTWriterTests.odb");
+ startTestForFile(sWriterDocument, WRITER);
+
+ String sCalcDocument = TestDocument.getUrl("RPTCalcTests.odb");
+ startTestForFile(sCalcDocument, CALC);
+// catch (AssureException e)
+// {
+// stopOffice();
+// throw new AssureException(e.getMessage());
+// }
+//
+ // ------------------------------ Office shutdown ------------------------------
+// stopOffice();
+ }
+
+// -----------------------------------------------------------------------------
+ private void startTestForFile(String _sDocument, int _nType)
+ {
+ FileURL aFileURL = new FileURL(_sDocument);
+ assertTrue("Test File doesn't '" + _sDocument + "'exist.", aFileURL.exists());
+
+ String sFileURL = _sDocument; // URLHelper.getFileURLFromSystemPath(_sDocument);
+ System.out.println("File URL: " + sFileURL);
+
+ XComponent xDocComponent = loadComponent(sFileURL, getXDesktop(), null);
+ System.out.println("Load done");
+ assertNotNull("Can't load document ", xDocComponent);
+
+ // context = createUnoService("com.sun.star.sdb.DatabaseContext")
+// oDataBase = context.getByName("hh")
+// oDBDoc = oDataBase.DatabaseDocument
+//
+// dim args(1) as new com.sun.star.beans.PropertyValue
+// args(0).Name = "ActiveConnection"
+// args(0).Value = oDBDoc.getCurrentController().getPropertyValue("ActiveConnection")
+// reportContainer = oDBDoc.getReportDocuments()
+// report = reportContainer.loadComponentFromURL("Report40","",0,args)
+
+ try
+ {
+ XInterface x = (XInterface)getMSF().createInstance("com.sun.star.sdb.DatabaseContext");
+ assertNotNull("can't create instance of com.sun.star.sdb.DatabaseContext", x);
+ System.out.println("createInstance com.sun.star.sdb.DatabaseContext done");
+
+ XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, x);
+ showElements(xNameAccess);
+ Object aObj = xNameAccess.getByName(sFileURL);
+// System.out.println("1");
+
+ // PropertySetHelper aHelper = new PropertySetHelper(aObj);
+ XDocumentDataSource xDataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
+// Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument");
+ XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument();
+
+ // XOfficeDatabaseDocument xOfficeDBDoc = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, aDatabaseDocument);
+ assertNotNull("can't access DatabaseDocument", xOfficeDBDoc);
+// System.out.println("2");
+
+ XModel xDBSource = UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc);
+ Object aController = xDBSource.getCurrentController();
+ assertNotNull("Controller of xOfficeDatabaseDocument is empty!", aController);
+// System.out.println("3");
+
+ XDatabaseDocumentUI aDBDocUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController);
+ /* boolean isConnect = */
+// TODO: throws an exception in DEV300m78
+ aDBDocUI.connect();
+// if (isConnect)
+// {
+// System.out.println("true");
+// }
+// else
+// {
+// System.out.println("false");
+// }
+// System.out.println("4");
+
+ // aHelper = new PropertySetHelper(aController);
+
+ // Object aActiveConnectionObj = aHelper.getPropertyValueAsObject("ActiveConnection");
+ Object aActiveConnectionObj = aDBDocUI.getActiveConnection();
+ assertNotNull("ActiveConnection is empty", aActiveConnectionObj);
+// System.out.println("5");
+
+ XReportDocumentsSupplier xSupplier = UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc);
+ xNameAccess = xSupplier.getReportDocuments();
+ assertNotNull("xOfficeDatabaseDocument returns no Report Document", xNameAccess);
+// System.out.println("5");
+
+ showElements(xNameAccess);
+
+ ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>();
+
+ PropertyValue aActiveConnection = new PropertyValue();
+ aActiveConnection.Name = "ActiveConnection";
+ aActiveConnection.Value = aActiveConnectionObj;
+ aPropertyList.add(aActiveConnection);
+
+ loadAndStoreReports(xNameAccess, aPropertyList, _nType);
+ createDBEntry(_nType);
+ }
+ catch(com.sun.star.uno.Exception e)
+ {
+ fail("ERROR: Exception caught" + e.getMessage());
+ }
+
+ // String mTestDocumentPath = (String) param.get("TestDocumentPath");
+ // System.out.println("mTestDocumentPath: '" + mTestDocumentPath + "'");
+ // // workaround for issue using deprecated "DOCPTH" prop
+ // System.setProperty("DOCPTH", mTestDocumentPath);
+
+ // Close the document
+ closeComponent(xDocComponent);
+ }
+
+ private String getDocumentPoolName(int _nType)
+ {
+ return getFileFormat(_nType);
+ }
+
+// -----------------------------------------------------------------------------
+ private void createDBEntry(int _nType)
+ {
+ // try to connect the database
+ String sDBConnection = ""; // (String)param.get( convwatch.PropertyName.DB_CONNECTION_STRING );
+ System.out.println("DBConnection: " + sDBConnection);
+ DB.init(sDBConnection);
+ String sDestinationVersion = m_sCWS_WORK_STAMP;
+ if (sDestinationVersion.length() == 0)
+ {
+ sDestinationVersion = m_sUPDMinor;
+ }
+ String sDestinationName = "";
+ String sDestinationCreatorType = "";
+ String sDocumentPoolDir = getOutputPath(_nType);
+ String sDocumentPoolName = getDocumentPoolName(_nType);
+ String sSpecial = "";
+
+ String sFixRefSubDirectory = "ReportDesign_qa_complex_" + getFileFormat(_nType);
+// DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref",
+// sDestinationVersion, sDestinationName, sDestinationCreatorType,
+// sDocumentPoolDir, sDocumentPoolName, m_sMailAddress,
+// sSpecial);
+ // DB.test();
+ // System.exit(1);
+ }
+
+ private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList _aPropertyList, int _nType)
+ {
+ if (_xNameAccess != null)
+ {
+ String[] sElementNames = _xNameAccess.getElementNames();
+ for(int i=0;i<sElementNames.length; i++)
+ {
+ String sReportName = sElementNames[i];
+ XComponent xDoc = loadComponent(sReportName, _xNameAccess, _aPropertyList);
+ // print? or store?
+ storeComponent(sReportName, xDoc, _nType);
+ closeComponent(xDoc);
+ }
+ }
+ }
+
+ private String getFormatExtension(int _nType)
+ {
+ String sExtension;
+ switch(_nType)
+ {
+ case WRITER:
+ sExtension = ".odt";
+ break;
+ case CALC:
+ sExtension = ".ods";
+ break;
+ default:
+ sExtension = ".UNKNOWN";
+ }
+ return sExtension;
+ }
+ private String getFileFormat(int _nType)
+ {
+ String sFileType;
+ switch(_nType)
+ {
+ case WRITER:
+ sFileType = "writer8";
+ break;
+ case CALC:
+ sFileType = "calc8";
+ break;
+ default:
+ sFileType = "UNKNOWN";
+ }
+ return sFileType;
+ }
+
+ private String getOutputPath(int _nType)
+ {
+ String sOutputPath = util.utils.getOfficeTemp/*Dir*/(getMSF());// (String)param.get( convwatch.PropertyName.DOC_COMPARATOR_OUTPUT_PATH );
+
+ if (!sOutputPath.endsWith("/") || // construct the output file name
+ !sOutputPath.endsWith("\\"))
+ {
+ sOutputPath += System.getProperty("file.separator");
+ }
+ sOutputPath += "tmp_123";
+ sOutputPath += System.getProperty("file.separator");
+
+ // sOutputPath += getFileFormat(_nType);
+ // sOutputPath += System.getProperty("file.separator");
+
+ File aOutputFile = new File(sOutputPath); // create the directory of the given output path
+ aOutputFile.mkdirs();
+
+ return sOutputPath;
+ }
+
+ /*
+ store given _xComponent under the given Name in DOC_COMPARATOR_INPUTPATH
+ */
+ private void storeComponent(String _sName, Object _xComponent, int _nType)
+ {
+ String sOutputPath = getOutputPath(_nType);
+
+ // add DocumentPoolName
+ sOutputPath += getDocumentPoolName(_nType);
+ sOutputPath += System.getProperty("file.separator");
+
+ File aOutputFile = new File(sOutputPath); // create the directory of the given output path
+ aOutputFile.mkdirs();
+
+ sOutputPath += _sName;
+ sOutputPath += getFormatExtension(_nType);
+
+ String sOutputURL = URLHelper.getFileURLFromSystemPath(sOutputPath);
+
+ ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); // set some properties for storeAsURL
+
+ PropertyValue aFileFormat = new PropertyValue();
+ aFileFormat.Name = "FilterName";
+ aFileFormat.Value = getFileFormat(_nType);
+ aPropertyList.add(aFileFormat);
+
+ PropertyValue aOverwrite = new PropertyValue(); // always overwrite already exist files
+ aOverwrite.Name = "Overwrite";
+ aOverwrite.Value = Boolean.TRUE;
+ aPropertyList.add(aOverwrite);
+
+ // store the document in an other directory
+ XStorable aStorable = UnoRuntime.queryInterface(XStorable.class, _xComponent);
+ if (aStorable != null)
+ {
+ System.out.println("store document as URL: '" + sOutputURL + "'");
+ try
+ {
+ aStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList));
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ System.out.println("ERROR: Exception caught");
+ System.out.println("Can't write document URL: '" + sOutputURL + "'");
+ System.out.println("Message: " + e.getMessage());
+ }
+ }
+ }
+
+ private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList)
+ {
+ XComponent xDocComponent = null;
+ XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, _xComponent);
+
+ try
+ {
+ PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList);
+ System.out.println("Load component: '" + _sName + "'");
+ xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties);
+ }
+ catch (com.sun.star.io.IOException e)
+ {
+ System.out.println("ERROR: Exception caught");
+ System.out.println("Can't load document '" + _sName + "'");
+ System.out.println("Message: " + e.getMessage());
+ }
+ catch (com.sun.star.lang.IllegalArgumentException e)
+ {
+ System.out.println("ERROR: Exception caught");
+ System.out.println("Illegal Arguments given to loadComponentFromURL.");
+ System.out.println("Message: " + e.getMessage());
+ }
+ return xDocComponent;
+ }
+
+ private void closeComponent(XComponent _xDoc)
+ {
+ // Close the document
+ XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, _xDoc);
+ try
+ {
+ xCloseable.close(true);
+ }
+ catch (com.sun.star.util.CloseVetoException e)
+ {
+ System.out.println("ERROR: CloseVetoException caught");
+ System.out.println("CloseVetoException occured Can't close document.");
+ System.out.println("Message: " + e.getMessage());
+ }
+ }
+
+
+ private XMultiServiceFactory getMSF()
+ {
+ final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager());
+ return xMSF1;
+ }
+
+ // setup and close connections
+ @BeforeClass public static void setUpConnection() throws Exception {
+ System.out.println("setUpConnection()");
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ System.out.println("tearDownConnection()");
+ connection.tearDown();
+ }
+
+ private static final OfficeConnection connection = new OfficeConnection();
+
+}
diff --git a/reportdesign/qa/complex/reportdesign/TestDocument.java b/reportdesign/qa/complex/reportdesign/TestDocument.java
new file mode 100644
index 000000000000..a6e294d4d3ec
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/TestDocument.java
@@ -0,0 +1,41 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+package complex.reportdesign;
+
+import java.io.File;
+import org.openoffice.test.OfficeFileUrl;
+
+final class TestDocument
+{
+ public static String getUrl(String name)
+ {
+ return OfficeFileUrl.getAbsolute(new File("test_documents", name));
+ }
+
+ private TestDocument() {}
+}
diff --git a/reportdesign/qa/complex/reportdesign/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk
new file mode 100755
index 000000000000..4174eb02ce3a
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/makefile.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../../..
+PRJNAME = reportdesign
+TARGET = qa_complex_reportdesign
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = complex/reportdesign
+
+# here store only Files which contain a @Test
+JAVATESTFILES = \
+ ReportDesignerTest.java
+
+# put here all other files
+JAVAFILES = $(JAVATESTFILES) \
+ TestDocument.java \
+ FileURL.java
+
+JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+
+# Sample how to debug
+# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y
+
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl
new file mode 100644
index 000000000000..6eefe2bb0639
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl
@@ -0,0 +1,9 @@
+eval 'exec perl -wS $0 ${1+\"$@\"}'
+ if 0;
+
+my $sMySQLConnector = $ARGV[0];
+if (! -e $sMySQLConnector)
+{
+ exit 1;
+}
+exit 0;
diff --git a/reportdesign/qa/complex/reportdesign/runner.props b/reportdesign/qa/complex/reportdesign/runner.props
new file mode 100755
index 000000000000..d894366ce006
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/runner.props
@@ -0,0 +1,22 @@
+# where to store created documents
+wntmsci.DOC_COMPARATOR_OUTPUT_PATH=\\\\so-gfxcmp-lin\\doc-pool\\reporttest
+unxlngi.DOC_COMPARATOR_OUTPUT_PATH=/net/so-gfxcmp-lin/export/gfxcmp/document-pool/reporttest
+
+DB_CONNECTION_STRING=server:jakobus,db:jobs_convwatch,user:admin,passwd:admin
+
+# Set path to an existing office installation
+wntmsci.AppExecutionCommand=C:\\home\\${USERNAME}\\staroffice8\\program\\soffice.exe -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp;
+unxlngi.AppExecutionCommand=/opt/staroffice8/program/soffice -norestore -nocrashreport -accept=socket,host=localhost,port=8100;urp;
+
+# Set the 'Continue' Property to true, to leave out already done tests.
+Continue=true
+
+TestBase=java_complex
+TestJob=-o complex.ReportDesignerTest
+DebugIsActive=true
+ThreadTimeOut=400000
+SingleTimeOut=300000
+
+# don't start office automatically
+NoOffice=true
+
diff --git a/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb
new file mode 100755
index 000000000000..0e91d633d4e7
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb
Binary files differ
diff --git a/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb
new file mode 100755
index 000000000000..7099b1abf2b5
--- /dev/null
+++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb
Binary files differ
diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx
new file mode 100644
index 000000000000..6c24ed17955a
--- /dev/null
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -0,0 +1,585 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "FixedLine.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include <comphelper/sequence.hxx>
+#include <tools/debug.hxx>
+#include <comphelper/property.hxx>
+#include "Tools.hxx"
+#include "FormatCondition.hxx"
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <boost/bind.hpp>
+#include "ReportHelperImpl.hxx"
+
+#define MIN_WIDTH 80
+#define MIN_HEIGHT 20
+// =============================================================================
+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_FONTDESCRIPTORASIAN
+ ,PROPERTY_FONTDESCRIPTORCOMPLEX
+ ,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
+ ,PROPERTY_PRINTREPEATEDVALUES
+ ,PROPERTY_CONDITIONALPRINTEXPRESSION
+ ,PROPERTY_PRINTWHENGROUPCHANGE
+ ,PROPERTY_MASTERFIELDS
+ ,PROPERTY_DETAILFIELDS
+ ,PROPERTY_PARAADJUST
+
+ , PROPERTY_CHAREMPHASISASIAN
+ , PROPERTY_CHARFONTNAMEASIAN
+ , PROPERTY_CHARFONTSTYLENAMEASIAN
+ , PROPERTY_CHARFONTFAMILYASIAN
+ , PROPERTY_CHARFONTCHARSETASIAN
+ , PROPERTY_CHARFONTPITCHASIAN
+ , PROPERTY_CHARHEIGHTASIAN
+ , PROPERTY_CHARUNDERLINEASIAN
+ , PROPERTY_CHARWEIGHTASIAN
+ , PROPERTY_CHARPOSTUREASIAN
+ , PROPERTY_CHARWORDMODEASIAN
+ , PROPERTY_CHARROTATIONASIAN
+ , PROPERTY_CHARSCALEWIDTHASIAN
+ , PROPERTY_CHARLOCALEASIAN
+ , PROPERTY_CHAREMPHASISCOMPLEX
+ , PROPERTY_CHARFONTNAMECOMPLEX
+ , PROPERTY_CHARFONTSTYLENAMECOMPLEX
+ , PROPERTY_CHARFONTFAMILYCOMPLEX
+ , PROPERTY_CHARFONTCHARSETCOMPLEX
+ , PROPERTY_CHARFONTPITCHCOMPLEX
+ , PROPERTY_CHARHEIGHTCOMPLEX
+ , PROPERTY_CHARUNDERLINECOMPLEX
+ , PROPERTY_CHARWEIGHTCOMPLEX
+ , PROPERTY_CHARPOSTURECOMPLEX
+ , PROPERTY_CHARWORDMODECOMPLEX
+ , PROPERTY_CHARROTATIONCOMPLEX
+ , PROPERTY_CHARSCALEWIDTHCOMPLEX
+ , PROPERTY_CHARLOCALECOMPLEX
+
+
+ };
+ 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 = MIN_WIDTH;
+}
+// -----------------------------------------------------------------------------
+OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContext
+ ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
+ ,uno::Reference< drawing::XShape >& _xShape
+ ,sal_Int32 _nOrientation)
+: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(_nOrientation)
+,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 );
+ try
+ {
+ awt::Size aSize = _xShape->getSize();
+ if ( m_nOrientation == 1 )
+ {
+ if ( aSize.Width < MIN_WIDTH )
+ {
+ aSize.Width = MIN_WIDTH;
+ _xShape->setSize(aSize);
+ }
+ }
+ else if ( MIN_HEIGHT > aSize.Height )
+ {
+ aSize.Height = MIN_HEIGHT;
+ _xShape->setSize(aSize);
+ }
+ m_aProps.aComponent.setShape(_xShape,this,m_refCount);
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"OFixedLine::OFixedLine: Exception caught!");
+ }
+ 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_IMPL3(OFixedLine,m_aProps.aComponent)
+REPORTCOMPONENT_NOMASTERDETAIL(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_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)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setPrintWhenGroupChange( ::sal_Bool /*_printwhengroupchange*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OFixedLine::getConditionalPrintExpression() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OFixedLine::setConditionalPrintExpression( const ::rtl::OUString& /*_conditionalprintexpression*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+// -----------------------------------------------------------------------------
+// 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 < MIN_WIDTH && m_nOrientation == 1) || (aSize.Height < MIN_HEIGHT && m_nOrientation == 0) )
+ 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)
+
+::sal_Bool SAL_CALL OFixedLine::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+void SAL_CALL OFixedLine::setPrintRepeatedValues( ::sal_Bool /*_printrepeatedvalues*/ ) throw (beans::UnknownPropertyException, uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException();
+}
+
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/FixedText.cxx b/reportdesign/source/core/api/FixedText.cxx
new file mode 100644
index 000000000000..7e535f0ee40f
--- /dev/null
+++ b/reportdesign/source/core/api/FixedText.cxx
@@ -0,0 +1,347 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "FixedText.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#include <com/sun/star/beans/XPropertyState.hpp>
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include <comphelper/sequence.hxx>
+#include "Tools.hxx"
+#include <tools/debug.hxx>
+#include <comphelper/property.hxx>
+#include "FormatCondition.hxx"
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+uno::Sequence< ::rtl::OUString > lcl_getFixedTextOptionals()
+{
+ ::rtl::OUString pProps[] = { PROPERTY_DATAFIELD,PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
+ 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)
+{
+ 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)
+{
+ 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;
+}
+// -----------------------------------------------------------------------------
+::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,m_aProps.aComponent)
+REPORTCOMPONENT_IMPL2(OFixedText,m_aProps.aComponent)
+REPORTCOMPONENT_NOMASTERDETAIL(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);
+}
+// -----------------------------------------------------------------------------
+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..95e6e4e87574
--- /dev/null
+++ b/reportdesign/source/core/api/FormatCondition.cxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "FormatCondition.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#include <tools/debug.hxx>
+#include <connectivity/dbtools.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/property.hxx>
+#include "Tools.hxx"
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#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..ee94e7a97d10
--- /dev/null
+++ b/reportdesign/source/core/api/FormattedField.cxx
@@ -0,0 +1,387 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "FormattedField.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include <comphelper/sequence.hxx>
+#include <tools/debug.hxx>
+#include <connectivity/dbtools.hxx>
+#include <comphelper/property.hxx>
+#include "Tools.hxx"
+#include "FormatCondition.hxx"
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#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));
+}
+
+uno::Sequence< ::rtl::OUString > lcl_getFormattedFieldOptionals()
+{
+ ::rtl::OUString pProps[] = { PROPERTY_MASTERFIELDS,PROPERTY_DETAILFIELDS };
+ return uno::Sequence< ::rtl::OUString >(pProps,sizeof(pProps)/sizeof(pProps[0]));
+}
+DBG_NAME( rpt_OFormattedField )
+// -----------------------------------------------------------------------------
+OFormattedField::OFormattedField(uno::Reference< uno::XComponentContext > const & _xContext)
+:FormattedFieldBase(m_aMutex)
+,FormattedFieldPropertySet(_xContext,static_cast< Implements >(IMPLEMENTS_PROPERTY_SET),lcl_getFormattedFieldOptionals())
+,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),lcl_getFormattedFieldOptionals())
+,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();
+ m_xFormatsSupplier.clear();
+ m_xFunction.clear();
+}
+// -----------------------------------------------------------------------------
+::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,m_aProps.aComponent)
+REPORTCOMPONENT_IMPL2(OFormattedField,m_aProps.aComponent)
+REPORTCOMPONENT_NOMASTERDETAIL(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< report::XSection> xSection = getSection();
+ if ( xSection.is() )
+ m_xFormatsSupplier.set(xSection->getReportDefinition(),uno::UNO_QUERY);
+ 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..506d70e8adcc
--- /dev/null
+++ b/reportdesign/source/core/api/Function.cxx
@@ -0,0 +1,222 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Function.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#include <tools/debug.hxx>
+#include <connectivity/dbtools.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/property.hxx>
+#include "Tools.hxx"
+#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_bDeepTraversing);
+}
+// -----------------------------------------------------------------------------
+
+::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..9ae266d254c3
--- /dev/null
+++ b/reportdesign/source/core/api/Functions.cxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Functions.hxx"
+#include "Function.hxx"
+#include <tools/debug.hxx>
+#include "core_resource.hxx"
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include <comphelper/property.hxx>
+#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);
+}
+//--------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+OFunctions::~OFunctions()
+{
+ DBG_DTOR( rpt_OFunctions,NULL);
+}
+//--------------------------------------------------------------------------
+void SAL_CALL OFunctions::dispose() throw(uno::RuntimeException)
+{
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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..8f5200746191
--- /dev/null
+++ b/reportdesign/source/core/api/Group.cxx
@@ -0,0 +1,357 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Group.hxx"
+#include "Section.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/report/GroupOn.hpp>
+#include <com/sun/star/report/KeepTogether.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include "Tools.hxx"
+#include <tools/debug.hxx>
+#include <comphelper/property.hxx>
+#include "Functions.hxx"
+
+// =============================================================================
+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 );
+}
+//--------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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();
+}
+// -----------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+void SAL_CALL OGroup::disposing()
+{
+ m_xHeader.clear();
+ m_xFooter.clear();
+ //::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..f180471de400
--- /dev/null
+++ b/reportdesign/source/core/api/Groups.cxx
@@ -0,0 +1,217 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Groups.hxx"
+#include "Group.hxx"
+#include <tools/debug.hxx>
+#include "core_resource.hxx"
+#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);
+}
+//--------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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();
+}
+// -----------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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..131c5e372aa5
--- /dev/null
+++ b/reportdesign/source/core/api/ImageControl.cxx
@@ -0,0 +1,505 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ImageControl.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include <comphelper/sequence.hxx>
+#include "Tools.hxx"
+#include <tools/debug.hxx>
+#include <comphelper/property.hxx>
+#include "FormatCondition.hxx"
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#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_FONTDESCRIPTORASIAN
+ ,PROPERTY_FONTDESCRIPTORCOMPLEX
+ ,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
+ ,PROPERTY_MASTERFIELDS
+ ,PROPERTY_DETAILFIELDS
+ ,PROPERTY_PARAADJUST
+ , PROPERTY_CHAREMPHASISASIAN
+ , PROPERTY_CHARFONTNAMEASIAN
+ , PROPERTY_CHARFONTSTYLENAMEASIAN
+ , PROPERTY_CHARFONTFAMILYASIAN
+ , PROPERTY_CHARFONTCHARSETASIAN
+ , PROPERTY_CHARFONTPITCHASIAN
+ , PROPERTY_CHARHEIGHTASIAN
+ , PROPERTY_CHARUNDERLINEASIAN
+ , PROPERTY_CHARWEIGHTASIAN
+ , PROPERTY_CHARPOSTUREASIAN
+ , PROPERTY_CHARWORDMODEASIAN
+ , PROPERTY_CHARROTATIONASIAN
+ , PROPERTY_CHARSCALEWIDTHASIAN
+ , PROPERTY_CHARLOCALEASIAN
+ , PROPERTY_CHAREMPHASISCOMPLEX
+ , PROPERTY_CHARFONTNAMECOMPLEX
+ , PROPERTY_CHARFONTSTYLENAMECOMPLEX
+ , PROPERTY_CHARFONTFAMILYCOMPLEX
+ , PROPERTY_CHARFONTCHARSETCOMPLEX
+ , PROPERTY_CHARFONTPITCHCOMPLEX
+ , PROPERTY_CHARHEIGHTCOMPLEX
+ , PROPERTY_CHARUNDERLINECOMPLEX
+ , PROPERTY_CHARWEIGHTCOMPLEX
+ , PROPERTY_CHARPOSTURECOMPLEX
+ , PROPERTY_CHARWORDMODECOMPLEX
+ , PROPERTY_CHARROTATIONCOMPLEX
+ , PROPERTY_CHARSCALEWIDTHCOMPLEX
+ , PROPERTY_CHARLOCALECOMPLEX
+
+ };
+ 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_nScaleMode(awt::ImageScaleMode::None)
+,m_bPreserveIRI(sal_True)
+{
+ 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_nScaleMode(awt::ImageScaleMode::None)
+,m_bPreserveIRI(sal_True)
+{
+ 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();
+}
+// -----------------------------------------------------------------------------
+::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,m_aProps.aComponent)
+REPORTCOMPONENT_IMPL2(OImageControl,m_aProps.aComponent)
+REPORTCOMPONENT_NOMASTERDETAIL(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_Int32 SAL_CALL OImageControl::getControlBackground() throw (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)
+{
+ sal_Bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);
+ setControlBackgroundTransparent(bTransparent);
+ if ( !bTransparent )
+ 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);
+ if ( _controlbackgroundtransparent )
+ set(PROPERTY_CONTROLBACKGROUND,static_cast<sal_Int32>(COL_TRANSPARENT),m_aProps.aFormatProperties.nBackgroundColor);
+}
+
+// -----------------------------------------------------------------------------
+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
+// -----------------------------------------------------------------------------
+::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_Int16 SAL_CALL OImageControl::getScaleMode() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nScaleMode;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OImageControl::setScaleMode( ::sal_Int16 _scalemode ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( _scalemode < awt::ImageScaleMode::None ||_scalemode > awt::ImageScaleMode::Anisotropic )
+ throw lang::IllegalArgumentException();
+ set(PROPERTY_SCALEMODE,_scalemode,m_nScaleMode);
+}
+// -----------------------------------------------------------------------------
+::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..f9ab9471ce3b
--- /dev/null
+++ b/reportdesign/source/core/api/ReportComponent.cxx
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ReportComponent.hxx"
+
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#include <vcl/svapp.hxx>
+#include <vcl/outdev.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/debug.hxx>
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontWidth.hpp>
+#include "ReportControlModel.hxx"
+#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/i18n/ScriptType.hpp>
+#include <editeng/unolingu.hxx>
+#include <unotools/syslocale.hxx>
+#include <unotools/lingucfg.hxx>
+#include <i18npool/mslangid.hxx>
+
+// =============================================================================
+namespace reportdesign
+{
+// =============================================================================
+ using namespace com::sun::star;
+ using namespace comphelper;
+
+void lcl_getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont,LanguageType _eLatin,LanguageType _eCJK,LanguageType _eCTL )
+{
+ LanguageType eLatin = _eLatin;
+
+ // #108374# / #107782#: If the UI language is Korean, the default Latin font has to
+ // be queried for Korean, too (the Latin language from the document can't be Korean).
+ // This is the same logic as in SwDocShell::InitNew.
+ LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
+ switch( eUiLanguage )
+ {
+ case LANGUAGE_KOREAN:
+ case LANGUAGE_KOREAN_JOHAB:
+ eLatin = eUiLanguage;
+ break;
+ }
+
+ rLatinFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_PRESENTATION, eLatin, DEFAULTFONT_FLAGS_ONLYONE );
+ rCJKFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_PRESENTATION, _eCJK, DEFAULTFONT_FLAGS_ONLYONE );
+ rCTLFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_PRESENTATION, _eCTL, DEFAULTFONT_FLAGS_ONLYONE ) ;
+}
+OFormatProperties::OFormatProperties()
+ :nAlign(style::ParagraphAdjust_LEFT)
+ ,nFontEmphasisMark(0)
+ ,nFontRelief(0)
+ ,nTextColor(0)
+ ,nTextLineColor(0)
+ ,nCharUnderlineColor(0xFFFFFFFF)
+ ,nBackgroundColor(COL_TRANSPARENT)
+ ,aVerticalAlignment( style::VerticalAlignment_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)
+{
+ try
+ {
+ SvtLinguConfig aLinguConfig;
+ using namespace ::com::sun::star::i18n::ScriptType;
+
+ aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale"))) >>= aCharLocale;
+ LanguageType eCurLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocale), LATIN);
+ aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CJK"))) >>= aCharLocaleAsian;
+ LanguageType eCurLangCJK = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocaleAsian), ASIAN);
+ aLinguConfig.GetProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultLocale_CTL"))) >>= aCharLocaleComplex;
+ LanguageType eCurLangCTL = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aCharLocaleComplex), COMPLEX);
+
+ Font aLatin,aCJK,aCTL;
+ lcl_getDefaultFonts(aLatin,aCJK,aCTL,eCurLang,eCurLangCJK,eCurLangCTL);
+ aFontDescriptor = VCLUnoHelper::CreateFontDescriptor(aLatin);
+ aAsianFontDescriptor = VCLUnoHelper::CreateFontDescriptor(aCJK);
+ aComplexFontDescriptor = VCLUnoHelper::CreateFontDescriptor(aCTL);
+ }
+ catch(const uno::Exception&)
+ {
+ }
+ aFontDescriptor.Weight = awt::FontWeight::NORMAL;
+ aFontDescriptor.CharacterWidth = awt::FontWidth::NORMAL;
+ // aCharLocale = SvtSysLocale().GetLocaleData().getLocale();
+}
+// -----------------------------------------------------------------------------
+void OReportComponentProperties::setShape(uno::Reference< drawing::XShape >& _xShape,const uno::Reference< report::XReportComponent>& _xTunnel,oslInterlockedCount& _rRefCount)
+{
+ osl_incrementInterlockedCount( &_rRefCount );
+ {
+ 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 );
+ }
+ osl_decrementInterlockedCount( &_rRefCount );
+}
+// -----------------------------------------------------------------------------
+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..8d97f7abada0
--- /dev/null
+++ b/reportdesign/source/core/api/ReportControlModel.cxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ReportControlModel.hxx"
+#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();
+}
+// -----------------------------------------------------------------------------
+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..2cf848dc0c84
--- /dev/null
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -0,0 +1,2939 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ReportDefinition.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/report/GroupKeepTogether.hpp>
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#include <com/sun/star/report/XFunction.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/table/ShadowFormat.hpp>
+#include <com/sun/star/style/PageStyleLayout.hpp>
+#include <com/sun/star/style/GraphicLocation.hpp>
+#include <com/sun/star/xml/AttributeData.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/numberedcollection.hxx>
+#include <comphelper/propertystatecontainer.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/propertysetinfo.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/seqstream.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
+#include <vos/mutex.hxx>
+#include <com/sun/star/beans/XMultiPropertyStates.hpp>
+#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/EmbedMapUnits.hpp>
+#include <com/sun/star/embed/EntryInitModes.hpp>
+#include <com/sun/star/embed/Aspects.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/io/XSeekable.hpp>
+#include <com/sun/star/embed/XEmbedPersist.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/task/ErrorCodeIOException.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include "corestrings.hrc"
+#include "Groups.hxx"
+#include "RptDef.hxx"
+#include "Section.hxx"
+#include "FixedLine.hxx"
+#include "core_resource.hrc"
+#include "core_resource.hxx"
+#include "Tools.hxx"
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <unotools/streamwrap.hxx>
+#include <connectivity/CommonTools.hxx>
+#include <connectivity/dbconversion.hxx>
+#include <framework/titlehelper.hxx>
+#include <connectivity/dbtools.hxx>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include "Functions.hxx"
+#include <boost/mem_fn.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+#include <unotools/saveopt.hxx>
+#include "RptModel.hxx"
+#include "UndoEnv.hxx"
+#include "FormattedField.hxx"
+#include "FixedText.hxx"
+#include "ImageControl.hxx"
+#include "Shape.hxx"
+#include "ReportHelperImpl.hxx"
+#include <svl/itempool.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <osl/thread.hxx>
+
+#include <editeng/paperinf.hxx>
+#include <svx/svdlayer.hxx>
+#include <svx/xmleohlp.hxx>
+#include <svx/xmlgrhlp.hxx>
+#include <svx/unofill.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/exc_hlp.hxx>
+#include "ReportComponent.hxx"
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/style/NumberingType.hpp>
+
+#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!" );
+// DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+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 ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
+ m_aSize.Height = aDefaultSize.Height();
+ m_aSize.Width = aDefaultSize.Width();
+
+ 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;
+}
+namespace
+{
+ class FactoryLoader : public ::osl::Thread
+ {
+ ::rtl::OUString m_sMimeType;
+ uno::Reference< uno::XComponentContext > m_xContext;
+ public:
+ FactoryLoader(const ::rtl::OUString& _sMimeType,uno::Reference< uno::XComponentContext > const & _xContext)
+ :m_sMimeType(_sMimeType)
+ ,m_xContext(_xContext)
+ {}
+
+ protected:
+ virtual ~FactoryLoader(){}
+
+ /// Working method which should be overridden.
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL onTerminated();
+ };
+
+ void SAL_CALL FactoryLoader::run()
+ {
+ try
+ {
+ uno::Reference<frame::XComponentLoader> xFrameLoad( m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))
+ ,m_xContext)
+ ,uno::UNO_QUERY);
+ ::rtl::OUString sTarget(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( 3);
+ 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;
+
+ aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
+ aArgs[nLen++].Value <<= sal_True;
+
+ uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY);
+ ::comphelper::MimeConfigurationHelper aHelper(xFac);
+ SvtModuleOptions aModuleOptions;
+ uno::Reference< frame::XModel > xModel(xFrameLoad->loadComponentFromURL(
+ aModuleOptions.GetFactoryEmptyDocumentURL( aModuleOptions.ClassifyFactoryByServiceName( aHelper.GetDocServiceNameFromMediaType(m_sMimeType) )),
+ ::rtl::OUString(), // empty frame name
+ 0,
+ aArgs
+ ),uno::UNO_QUERY);
+ ::comphelper::disposeComponent(xModel);
+ }
+ }
+ catch(uno::Exception& ex)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ void SAL_CALL FactoryLoader::onTerminated()
+ {
+ delete this;
+ }
+}
+// -----------------------------------------------------------------------------
+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< 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< container::XIndexAccess > m_xViewData;
+ uno::Reference< container::XNameAccess > m_xStyles;
+ uno::Reference< container::XNameAccess> m_xXMLNamespaceMap;
+ uno::Reference< container::XNameAccess> m_xGradientTable;
+ uno::Reference< container::XNameAccess> m_xHatchTable;
+ uno::Reference< container::XNameAccess> m_xBitmapTable;
+ uno::Reference< container::XNameAccess> m_xTransparencyGradientTable;
+ uno::Reference< container::XNameAccess> m_xDashTable;
+ uno::Reference< container::XNameAccess> m_xMarkerTable;
+ uno::Reference< report::XFunctions > m_xFunctions;
+ uno::Reference< ui::XUIConfigurationManager> m_xUIConfigurationManager;
+ uno::Reference< util::XNumberFormatsSupplier> m_xNumberFormatsSupplier;
+ uno::Reference< sdbc::XConnection> m_xActiveConnection;
+ uno::Reference< frame::XTitle > m_xTitleHelper;
+ uno::Reference< frame::XUntitledNumbers > m_xNumberedControllers;
+ uno::Reference< document::XDocumentProperties > m_xDocumentProperties;
+
+ ::boost::shared_ptr< ::comphelper::EmbeddedObjectContainer>
+ m_pObjectContainer;
+ ::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;
+ ::rtl::OUString m_sDataSourceName;
+ 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;
+ sal_Bool m_bSetModifiedEnabled;
+ 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)
+ // default visual area is 8 x 7 cm
+ ,m_aVisualAreaSize( 8000, 7000 )
+ ,m_nAspect(embed::Aspects::MSOLE_CONTENT)
+ ,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)
+ ,m_bSetModifiedEnabled( 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)
+ {}
+ ~OReportDefinitionImpl();
+};
+OReportDefinitionImpl::~OReportDefinitionImpl()
+{
+}
+
+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))
+{
+ 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 >())
+,comphelper::IEmbeddedHelper()
+,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
+ {
+ static bool s_bFirstTime = sal_True;
+ if ( s_bFirstTime )
+ {
+ s_bFirstTime = false;
+ const uno::Sequence< ::rtl::OUString > aMimeTypes = getAvailableMimeTypes();
+ const ::rtl::OUString* pIter = aMimeTypes.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aMimeTypes.getLength();
+ for ( ; pIter != pEnd; ++pIter )
+ {
+ FactoryLoader* pCreatorThread = new FactoryLoader(*pIter,m_aProps->m_xContext);
+ pCreatorThread->createSuspended();
+ pCreatorThread->setPriority(osl_Thread_PriorityBelowNormal);
+ pCreatorThread->resume();
+ } // for ( ; pIter != pEnd; ++pIter )
+ }
+
+ m_pImpl->m_pReportModel.reset(new OReportModel(this));
+ m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
+ m_pImpl->m_pReportModel->SetScaleUnit( MAP_100TH_MM );
+ SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
+ rAdmin.NewStandardLayer(RPT_LAYER_FRONT);
+ rAdmin.NewLayer(UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "back" ) ), RPT_LAYER_BACK );
+ rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), RPT_LAYER_HIDDEN );
+
+ m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext);
+ if ( !m_pImpl->m_xStorage.is() )
+ m_pImpl->m_xStorage = ::comphelper::OStorageHelper::GetTemporaryStorage();
+
+ uno::Reference<beans::XPropertySet> xStorProps(m_pImpl->m_xStorage,uno::UNO_QUERY);
+ if ( xStorProps.is())
+ {
+ ::rtl::OUString sMediaType;
+ xStorProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType"))) >>= sMediaType;
+ if ( !sMediaType.getLength() )
+ xStorProps->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),uno::makeAny(MIMETYPE_OASIS_OPENDOCUMENT_REPORT));
+ }
+ m_pImpl->m_pObjectContainer.reset( new comphelper::EmbeddedObjectContainer(m_pImpl->m_xStorage , static_cast<cppu::OWeakObject*>(this) ) );
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Error!");
+ }
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::dispose() throw(uno::RuntimeException)
+{
+ ReportDefinitionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::disposing()
+{
+ notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
+
+ uno::Reference< frame::XModel > xHoldAlive( this );
+
+ 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 );
+
+ // SYNCHRONIZED --->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::ResettableMutexGuard aGuard(m_aMutex);
+
+ m_pImpl->m_aControllers.clear();
+
+ ::comphelper::disposeComponent(m_pImpl->m_xGroups);
+ m_pImpl->m_xReportHeader.clear();
+ m_pImpl->m_xReportFooter.clear();
+ m_pImpl->m_xPageHeader.clear();
+ m_pImpl->m_xPageFooter.clear();
+ m_pImpl->m_xDetail.clear();
+ //::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_xXMLNamespaceMap.clear();
+ m_pImpl->m_xGradientTable.clear();
+ m_pImpl->m_xHatchTable.clear();
+ m_pImpl->m_xBitmapTable.clear();
+ m_pImpl->m_xTransparencyGradientTable.clear();
+ m_pImpl->m_xDashTable.clear();
+ m_pImpl->m_xMarkerTable.clear();
+ m_pImpl->m_xUIConfigurationManager.clear();
+ m_pImpl->m_pReportModel.reset();
+ m_pImpl->m_pObjectContainer.reset();
+ m_pImpl->m_aArgs.realloc(0);
+ m_pImpl->m_xTitleHelper.clear();
+ m_pImpl->m_xNumberedControllers.clear();
+ // <--- SYNCHRONIZED
+}
+
+// -----------------------------------------------------------------------------
+::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);
+}
+// -----------------------------------------------------------------------------
+::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
+REPORTCOMPONENT_MASTERDETAIL(OReportDefinition,*m_aProps)
+REPORTCOMPONENT_IMPL(OReportDefinition,*m_aProps)
+REPORTCOMPONENT_IMPL2(OReportDefinition,*m_aProps)
+
+// -----------------------------------------------------------------------------
+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)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::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)
+{
+ // LLA: we had a deadlock problem in our context, so we get the SolarMutex earlier.
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ ::comphelper::MediaDescriptor aDescriptor( _aArguments );
+ fillArgs(aDescriptor);
+ m_pImpl->m_pReportModel->SetModified(sal_False);
+ 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() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) )
+ {
+ ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData );
+ m_pImpl->m_xActiveConnection = aComponentDataMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),m_pImpl->m_xActiveConnection);
+ m_pImpl->m_xNumberFormatsSupplier = dbtools::getNumberFormats(m_pImpl->m_xActiveConnection);
+ }
+ if ( !m_pImpl->m_xNumberFormatsSupplier.is() )
+ {
+ m_pImpl->m_xNumberFormatsSupplier.set(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatsSupplier")) ,m_aProps->m_xContext),
+ uno::UNO_QUERY_THROW
+ );
+ }
+ lcl_stripLoadArguments( _aDescriptor, m_pImpl->m_aArgs );
+ ::rtl::OUString sCaption;
+ sCaption = _aDescriptor.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")),sCaption);
+ setCaption(sCaption);
+}
+// -----------------------------------------------------------------------------
+::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 >();
+}
+// -----------------------------------------------------------------------------
+
+void OReportDefinition::impl_loadFromStorage_nolck_throw( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom,
+ const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor )
+{
+// ::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;
+
+ rptui::OXUndoEnvironment& rEnv = m_pImpl->m_pReportModel->GetUndoEnv();
+ rptui::OXUndoEnvironment::OUndoEnvLock aLock(rEnv);
+ {
+ 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);
+ m_pImpl->m_pObjectContainer->SwitchPersistence(m_pImpl->m_xStorage);
+ }
+}
+// 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);
+
+ impl_loadFromStorage_nolck_throw( _xStorageToLoadFrom, _aMediaDescriptor );
+}
+
+// -----------------------------------------------------------------------------
+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() || MIMETYPE_OASIS_OPENDOCUMENT_REPORT != sOldMediaType )
+ 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 },
+ { MAP_LEN( "StreamName") , 0,&::getCppuType( (::rtl::OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "StreamRelPath") , 0,&::getCppuType( (::rtl::OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "BaseURI") , 0,&::getCppuType( (::rtl::OUString *)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()));
+ if ( aSaveOpt.IsSaveRelFSys() )
+ {
+ const ::rtl::OUString sVal( aDescriptor.getUnpackedValueOrDefault(aDescriptor.PROP_DOCUMENTBASEURL(),::rtl::OUString()) );
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(sVal));
+ } // if ( aSaveOpt.IsSaveRelFSys() )
+ const ::rtl::OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),::rtl::OUString()) );
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), uno::makeAny(sHierarchicalDocumentName));
+
+
+ sal_Int32 nArgsLen = aDelegatorArguments.getLength();
+ aDelegatorArguments.realloc(nArgsLen+1);
+ aDelegatorArguments[nArgsLen++] <<= xInfoSet;
+
+ uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
+ uno::Reference< document::XGraphicObjectResolver > xGrfResolver;
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(_xStorageToSaveTo,GRAPHICHELPER_MODE_WRITE);
+ xGrfResolver = pGraphicHelper;
+ pGraphicHelper->release();
+ SvXMLEmbeddedObjectHelper* pEmbeddedObjectHelper = SvXMLEmbeddedObjectHelper::Create( _xStorageToSaveTo,*this, EMBEDDEDOBJECTHELPER_MODE_WRITE );
+ xObjectResolver = pEmbeddedObjectHelper;
+ pEmbeddedObjectHelper->release();
+
+ aDelegatorArguments.realloc(nArgsLen+2);
+ aDelegatorArguments[nArgsLen++] <<= xGrfResolver;
+ aDelegatorArguments[nArgsLen++] <<= xObjectResolver;
+
+ uno::Reference<XComponent> xCom(static_cast<OWeakObject*>(this),uno::UNO_QUERY);
+ if( !bErr )
+ {
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml"))));
+ 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 )
+ {
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml"))));
+ if( !WriteThroughComponent(
+ xCom, "meta.xml",
+ "com.sun.star.comp.report.XMLMetaExporter",
+ aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) )
+ {
+ if( !bWarn )
+ {
+ bWarn = sal_True;
+ sWarnFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml"));
+ }
+ }
+ } // if( !bErr )
+
+ if( !bErr )
+ {
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("styles.xml"))));
+ 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 )
+ {
+ xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamName")), uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"))));
+ 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 ( !bErr )
+
+ uno::Any aImage;
+ uno::Reference< embed::XVisualObject > xCurrentController(getCurrentController(),uno::UNO_QUERY);
+ if ( xCurrentController.is() )
+ {
+ xCurrentController->setVisualAreaSize(m_pImpl->m_nAspect,m_pImpl->m_aVisualAreaSize);
+ aImage = xCurrentController->getPreferredVisualRepresentation( m_pImpl->m_nAspect ).Data;
+ }
+ if ( aImage.hasValue() )
+ {
+ ::rtl::OUString sObject1(RTL_CONSTASCII_USTRINGPARAM("report"));
+ ::rtl::OUString sPng(RTL_CONSTASCII_USTRINGPARAM("image/png"));
+
+ uno::Sequence<sal_Int8> aSeq;
+ aImage >>= aSeq;
+ uno::Reference<io::XInputStream> xStream = new ::comphelper::SequenceInputStream( aSeq );
+ m_pImpl->m_pObjectContainer->InsertGraphicStreamDirectly(xStream,sObject1,sPng);
+ }
+
+ if ( !bErr )
+ {
+ sal_Bool bPersist = sal_False;
+ if ( _xStorageToSaveTo == m_pImpl->m_xStorage )
+ bPersist = m_pImpl->m_pObjectContainer->StoreChildren(sal_True,sal_False);
+ else
+ bPersist = m_pImpl->m_pObjectContainer->StoreAsChildren(sal_True,sal_True,_xStorageToSaveTo);
+
+ if( bPersist )
+ m_pImpl->m_pObjectContainer->SetPersistentEntries(m_pImpl->m_xStorage);
+ 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();
+ }
+
+ if ( _xStorageToSaveTo == m_pImpl->m_xStorage )
+ setModified(sal_False);
+ }
+ if ( xStatusIndicator.is() )
+ xStatusIndicator->end();
+}
+// -----------------------------------------------------------------------------
+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);
+ m_pImpl->m_pObjectContainer->SwitchPersistence(m_pImpl->m_xStorage);
+ }
+ // 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 >& _rArguments ) throw (frame::DoubleInitializationException, io::IOException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ // TODO: this code is pretty similar to what happens in ODatabaseModelImpl::getOrCreateRootStorage,
+ // perhaps we can share code here.
+
+ ::comphelper::NamedValueCollection aArguments( _rArguments );
+
+ // the source for the to-be-created storage: either an URL, or a stream
+ uno::Reference< io::XInputStream > xStream;
+ ::rtl::OUString sURL;
+
+ if ( aArguments.has( "Stream" ) )
+ {
+ aArguments.get_ensureType( "Stream", xStream );
+ aArguments.remove( "Stream" );
+ }
+ else if ( aArguments.has( "InputStream" ) )
+ {
+ aArguments.get_ensureType( "InputStream", xStream );
+ aArguments.remove( "InputStream" );
+ }
+
+ if ( aArguments.has( "FileName" ) )
+ {
+ aArguments.get_ensureType( "FileName", sURL );
+ aArguments.remove( "FileName" );
+ }
+ else if ( aArguments.has( "URL" ) )
+ {
+ aArguments.get_ensureType( "URL", sURL );
+ aArguments.remove( "URL" );
+ }
+
+ uno::Any aStorageSource;
+ if ( xStream.is() )
+ aStorageSource <<= aStorageSource;
+ else if ( sURL.getLength() )
+ aStorageSource <<= sURL;
+ else
+ // TODO: error message
+ throw lang::IllegalArgumentException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No input source (URL or InputStream) found." ) ),
+ // TODO: resource
+ *this,
+ 1
+ );
+
+ uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" ) ),
+ m_aProps->m_xContext ),
+ uno::UNO_QUERY_THROW
+ );
+
+ // open read-write per default, unless told otherwise in the MediaDescriptor
+ uno::Reference< embed::XStorage > xDocumentStorage;
+ const sal_Int32 nOpenModes[2] = {
+ embed::ElementModes::READWRITE,
+ embed::ElementModes::READ
+ };
+ size_t nFirstOpenMode = 0;
+ if ( aArguments.has( "ReadOnly" ) )
+ {
+ sal_Bool bReadOnly = sal_False;
+ aArguments.get_ensureType( "ReadOnly", bReadOnly );
+ nFirstOpenMode = bReadOnly ? 1 : 0;
+ }
+ const size_t nLastOpenMode = sizeof( nOpenModes ) / sizeof( nOpenModes[0] ) - 1;
+ for ( size_t i=nFirstOpenMode; i <= nLastOpenMode; ++i )
+ {
+ uno::Sequence< uno::Any > aStorageCreationArgs(2);
+ aStorageCreationArgs[0] = aStorageSource;
+ aStorageCreationArgs[1] <<= nOpenModes[i];
+
+ try
+ {
+ xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), uno::UNO_QUERY_THROW );
+ }
+ catch( const uno::Exception& )
+ {
+ if ( i == nLastOpenMode )
+ throw lang::WrappedTargetException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occured while creating the document storage." ) ),
+ // TODO: resource
+ *this,
+ ::cppu::getCaughtException()
+ );
+ }
+ }
+
+ if ( !xDocumentStorage.is() )
+ {
+ throw uno::RuntimeException();
+ }
+
+ impl_loadFromStorage_nolck_throw( xDocumentStorage, aArguments.getPropertyValues() );
+ // TODO: do we need to take ownership of the storage? In opposite to loadFromStorage, we created the storage
+ // ourself here, and perhaps this means we're also responsible for it ...?
+}
+// -----------------------------------------------------------------------------
+// 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);
+ //if( nAspect == embed::Aspects::MSOLE_CONTENT )
+ {
+ bool bChanged =
+ (m_pImpl->m_aVisualAreaSize.Width != _aSize.Width ||
+ m_pImpl->m_aVisualAreaSize.Height != _aSize.Height);
+ m_pImpl->m_aVisualAreaSize = _aSize;
+ if( bChanged )
+ setModified( sal_True );
+ }
+ 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 aResult;
+ ::rtl::OUString sImageName(RTL_CONSTASCII_USTRINGPARAM("report"));
+ ::rtl::OUString sMimeType;
+ uno::Reference<io::XInputStream> xStream = m_pImpl->m_pObjectContainer->GetGraphicStream(sImageName,&sMimeType);
+ if ( xStream.is() )
+ {
+ uno::Sequence<sal_Int8> aSeq;
+ xStream->readBytes(aSeq,xStream->available());
+ xStream->closeInput();
+ aResult.Data <<= aSeq;
+ aResult.Flavor.MimeType = sMimeType;
+ aResult.Flavor.DataType = ::getCppuType( &aSeq );
+ }
+
+ return aResult;
+}
+// -----------------------------------------------------------------------------
+::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::disableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_False;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::enableSetModified( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ const sal_Bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
+ m_pImpl->m_bSetModifiedEnabled = sal_True;
+ return bWasEnabled;
+}
+
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::isSetModifiedEnabled( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
+
+ return m_pImpl->m_bSetModifiedEnabled;
+}
+
+// -----------------------------------------------------------------------------
+// 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_bSetModifiedEnabled )
+ return;
+
+ if ( m_pImpl->m_pReportModel->IsReadOnly() && _bModified )
+ throw beans::PropertyVetoException();
+ if ( m_pImpl->m_bModified != _bModified )
+ {
+ m_pImpl->m_bModified = _bModified;
+ if ( m_pImpl->m_pReportModel->IsChanged() != _bModified )
+ m_pImpl->m_pReportModel->SetChanged(_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);
+ aGuard.clear();
+ 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)
+{
+ sal_Int64 nRet = 0;
+ if (rId.getLength() == 16 && 0 == rtl_compareMemory(getUnoTunnelImplementationId().getConstArray(), rId.getConstArray(), 16 ) )
+ nRet = reinterpret_cast<sal_Int64>(this);
+ else
+ {
+ uno::Reference< lang::XUnoTunnel> xUnoTunnel(m_pImpl->m_xNumberFormatsSupplier,uno::UNO_QUERY);
+ if ( xUnoTunnel.is() )
+ nRet = xUnoTunnel->getSomething(rId);
+ }
+ if ( !nRet )
+ {
+ uno::Reference< lang::XUnoTunnel> xTunnel;
+ ::comphelper::query_aggregation(m_aProps->m_xProxy,xTunnel);
+ if ( xTunnel.is() )
+ nRet = xTunnel->getSomething(rId);
+ }
+
+ return nRet;
+}
+// -----------------------------------------------------------------------------
+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(const 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< uno::XInterface > xRet;
+ if ( aServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ImportEmbeddedObjectResolver"))) == 0 )
+ {
+ uno::Reference< embed::XStorage > xStorage;
+ const uno::Any* pIter = _aArgs.getConstArray();
+ const uno::Any* pEnd = pIter + _aArgs.getLength();
+ for(;pIter != pEnd ;++pIter)
+ {
+ beans::NamedValue aValue;
+ *pIter >>= aValue;
+ if( aValue.Name.equalsAscii( "Storage" ) )
+ aValue.Value >>= xStorage;
+ } // for(;pIter != pEnd ;++pIter)
+ m_pImpl->m_pObjectContainer->SwitchPersistence(xStorage);
+ xRet = static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_READ ));
+ }
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+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 if ( aServiceSpecifier == SERVICE_FORMATTEDFIELD
+ || aServiceSpecifier == SERVICE_FIXEDTEXT
+ || aServiceSpecifier == SERVICE_FIXEDLINE
+ || aServiceSpecifier == SERVICE_IMAGECONTROL )
+ xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape")) ),uno::UNO_QUERY_THROW);
+ else
+ xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) ),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.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.style.PageStyle") ) == 0 ||
+ aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.style.FrameStyle") ) == 0 ||
+ aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("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.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.document.Settings") ) == 0 )
+ {
+ uno::Reference<beans::XPropertySet> xProp = new OStyle();
+
+ return xProp.get();
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.Defaults") ) == 0 )
+ {
+ uno::Reference<beans::XPropertySet> xProp = new OStyle();
+ return xProp.get();
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GradientTable") ) == 0 )
+ {
+ if ( !m_pImpl->m_xGradientTable.is() )
+ m_pImpl->m_xGradientTable.set(SvxUnoGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
+ //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get();
+ return m_pImpl->m_xGradientTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.HatchTable") ) == 0 )
+ {
+ if ( !m_pImpl->m_xHatchTable.is() )
+ m_pImpl->m_xHatchTable.set(SvxUnoHatchTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
+ //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::Hatch*) 0 ) ).get();
+ return m_pImpl->m_xHatchTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.BitmapTable") ) == 0 )
+ {
+ if ( !m_pImpl->m_xBitmapTable.is() )
+ m_pImpl->m_xBitmapTable.set(SvxUnoBitmapTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
+ //comphelper::NameContainer_createInstance( ::getCppuType( (const ::rtl::OUString*) 0 ) ).get();
+ return m_pImpl->m_xBitmapTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) == 0 )
+ {
+ if ( !m_pImpl->m_xTransparencyGradientTable.is() )
+ m_pImpl->m_xTransparencyGradientTable.set(SvxUnoTransGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
+ //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get();
+ return m_pImpl->m_xTransparencyGradientTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.DashTable") ) == 0 )
+ {
+ if ( !m_pImpl->m_xDashTable.is() )
+ m_pImpl->m_xDashTable.set(SvxUnoDashTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
+ //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::LineDash*) 0 ) ).get();
+ return m_pImpl->m_xDashTable;
+ }
+ else if( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MarkerTable") ) )
+ {
+ if( !m_pImpl->m_xMarkerTable.is() )
+ m_pImpl->m_xMarkerTable.set(SvxUnoMarkerTable_createInstance( m_pImpl->m_pReportModel.get() ),uno::UNO_QUERY);
+ return m_pImpl->m_xMarkerTable;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.document.ImportEmbeddedObjectResolver")) == 0 )
+ return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_READ ));
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.document.ExportEmbeddedObjectResolver")) == 0 )
+ return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_WRITE ));
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.document.ImportGraphicObjectResolver")) == 0 )
+ {
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE);
+ uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper));
+ pGraphicHelper->release();
+ return xRet;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.document.ExportGraphicObjectResolver")) == 0 )
+ {
+ SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE);
+ uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper));
+ pGraphicHelper->release();
+ return xRet;
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.chart2.data.DataProvider")) == 0 )
+ {
+ uno::Reference<chart2::data::XDatabaseDataProvider> xDataProvider(chart2::data::DatabaseDataProvider::createWithConnection( m_aProps->m_xContext, m_pImpl->m_xActiveConnection ));
+ xDataProvider->setRowLimit(10);
+ uno::Reference< container::XChild > xChild(xDataProvider,uno::UNO_QUERY);
+ if ( xChild.is() )
+ xChild->setParent(*this);
+ return uno::Reference< uno::XInterface >(xDataProvider,uno::UNO_QUERY);
+ }
+ else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.xml.NamespaceMap")) == 0 )
+ {
+ if ( !m_pImpl->m_xXMLNamespaceMap.is() )
+ m_pImpl->m_xXMLNamespaceMap = comphelper::NameContainer_createInstance( ::getCppuType( (const ::rtl::OUString*) 0 ) ).get();
+ return m_pImpl->m_xXMLNamespaceMap;
+ }
+ else
+ xShape.set(SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ),uno::UNO_QUERY_THROW);
+
+ return m_pImpl->m_pReportModel->createShape(aServiceSpecifier,xShape);
+}
+//-----------------------------------------------------------------------------
+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")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ImportEmbeddedObjectResolver")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportEmbeddedObjectResolver")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ImportGraphicObjectResolver")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportGraphicObjectResolver")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.NamespaceMap")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.Settings")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.BitmapTable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable"))
+ };
+
+ 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
+ virtual uno::Type SAL_CALL getElementType( ) throw(uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(uno::RuntimeException);
+ // container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw(uno::RuntimeException);
+ virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException);
+
+ // container::XNameAccess
+ virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
+ virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(uno::RuntimeException);
+ virtual 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 (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 (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ m_pImpl->m_sIdentifier = Identifier;
+}
+// -----------------------------------------------------------------------------
+// XNumberFormatsSupplier
+uno::Reference< beans::XPropertySet > SAL_CALL OReportDefinition::getNumberFormatSettings( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_pImpl->m_xNumberFormatsSupplier.is() )
+ return m_pImpl->m_xNumberFormatsSupplier->getNumberFormatSettings();
+ return uno::Reference< beans::XPropertySet >();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< util::XNumberFormats > SAL_CALL OReportDefinition::getNumberFormats( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ if ( m_pImpl->m_xNumberFormatsSupplier.is() )
+ return m_pImpl->m_xNumberFormatsSupplier->getNumberFormats();
+ return uno::Reference< util::XNumberFormats >();
+}
+// -----------------------------------------------------------------------------
+::comphelper::EmbeddedObjectContainer& OReportDefinition::getEmbeddedObjectContainer() const
+{
+ return *m_pImpl->m_pObjectContainer;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< embed::XStorage > OReportDefinition::getStorage() const
+{
+ return m_pImpl->m_xStorage;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< task::XInteractionHandler > OReportDefinition::getInteractionHandler() const
+{
+ uno::Reference< task::XInteractionHandler > xRet( m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler")) ,m_aProps->m_xContext),uno::UNO_QUERY);
+ return xRet;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sdbc::XConnection > SAL_CALL OReportDefinition::getActiveConnection() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_pImpl->m_xActiveConnection;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setActiveConnection( const uno::Reference< sdbc::XConnection >& _activeconnection ) throw (lang::IllegalArgumentException, uno::RuntimeException)
+{
+ if ( !_activeconnection.is() )
+ throw lang::IllegalArgumentException();
+ set(PROPERTY_ACTIVECONNECTION,_activeconnection,m_pImpl->m_xActiveConnection);
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString SAL_CALL OReportDefinition::getDataSourceName() throw (uno::RuntimeException)
+{
+ osl::MutexGuard g(m_aMutex);
+ return m_pImpl->m_sDataSourceName;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportDefinition::setDataSourceName(const ::rtl::OUString& the_value) throw (uno::RuntimeException)
+{
+ set(PROPERTY_DATASOURCENAME,the_value,m_pImpl->m_sDataSourceName);
+}
+// -----------------------------------------------------------------------------
+bool OReportDefinition::isEnableSetModified() const
+{
+ return true;
+}
+uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw()
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ if ( ! m_pImpl->m_xTitleHelper.is ())
+ {
+ uno::Reference< frame::XUntitledNumbers > xDesktop(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop")) ,m_aProps->m_xContext),uno::UNO_QUERY_THROW);
+ uno::Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
+
+ ::framework::TitleHelper* pHelper = new ::framework::TitleHelper(uno::Reference< lang::XMultiServiceFactory >(m_aProps->m_xContext->getServiceManager(),uno::UNO_QUERY));
+ m_pImpl->m_xTitleHelper = uno::Reference< frame::XTitle >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
+ pHelper->setOwner (xThis );
+ pHelper->connectWithUntitledNumbers (xDesktop);
+ }
+
+ return m_pImpl->m_xTitleHelper;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHelper_throw()
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ if ( ! m_pImpl->m_xNumberedControllers.is ())
+ {
+ uno::Reference< frame::XModel > xThis (static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
+ ::comphelper::NumberedCollection* pHelper = new ::comphelper::NumberedCollection();
+ m_pImpl->m_xNumberedControllers = uno::Reference< frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW);
+
+ pHelper->setOwner (xThis);
+ pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
+ }
+
+ return m_pImpl->m_xNumberedControllers;
+}
+// -----------------------------------------------------------------------------
+// css.frame.XTitle
+::rtl::OUString SAL_CALL OReportDefinition::getTitle()
+ throw (uno::RuntimeException)
+{
+ // SYNCHRONIZED ->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ return impl_getTitleHelper_throw()->getTitle ();
+}
+// -----------------------------------------------------------------------------
+// css.frame.XTitle
+void SAL_CALL OReportDefinition::setTitle( const ::rtl::OUString& sTitle )
+ throw (uno::RuntimeException)
+{
+ // SYNCHRONIZED ->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ impl_getTitleHelper_throw()->setTitle (sTitle);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XTitleChangeBroadcaster
+void SAL_CALL OReportDefinition::addTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
+ throw (uno::RuntimeException)
+{
+ // SYNCHRONIZED ->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
+ if (xBroadcaster.is ())
+ xBroadcaster->addTitleChangeListener (xListener);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XTitleChangeBroadcaster
+void SAL_CALL OReportDefinition::removeTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
+ throw (uno::RuntimeException)
+{
+ // SYNCHRONIZED ->
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
+ if (xBroadcaster.is ())
+ xBroadcaster->removeTitleChangeListener (xListener);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XUntitledNumbers
+::sal_Int32 SAL_CALL OReportDefinition::leaseNumber( const uno::Reference< uno::XInterface >& xComponent )
+ throw (lang::IllegalArgumentException,
+ uno::RuntimeException )
+{
+ // object already disposed?
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ return impl_getUntitledHelper_throw()->leaseNumber (xComponent);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XUntitledNumbers
+void SAL_CALL OReportDefinition::releaseNumber( ::sal_Int32 nNumber )
+ throw (lang::IllegalArgumentException,
+ uno::RuntimeException )
+{
+ // object already disposed?
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ impl_getUntitledHelper_throw()->releaseNumber (nNumber);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XUntitledNumbers
+void SAL_CALL OReportDefinition::releaseNumberForComponent( const uno::Reference< uno::XInterface >& xComponent )
+ throw (lang::IllegalArgumentException,
+ uno::RuntimeException )
+{
+ // object already disposed?
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ impl_getUntitledHelper_throw()->releaseNumberForComponent (xComponent);
+}
+// -----------------------------------------------------------------------------
+// css.frame.XUntitledNumbers
+::rtl::OUString SAL_CALL OReportDefinition::getUntitledPrefix()
+ throw (uno::RuntimeException)
+{
+ // object already disposed?
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+
+ return impl_getUntitledHelper_throw()->getUntitledPrefix ();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< document::XDocumentProperties > SAL_CALL OReportDefinition::getDocumentProperties( ) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
+ if ( !m_pImpl->m_xDocumentProperties.is() )
+ {
+ uno::Reference< lang::XInitialization > xDocProps(
+ m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.DocumentProperties")) ,m_aProps->m_xContext),
+ uno::UNO_QUERY_THROW);
+ m_pImpl->m_xDocumentProperties.set(xDocProps, uno::UNO_QUERY_THROW);
+ }
+ return m_pImpl->m_xDocumentProperties;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XComponentContext > OReportDefinition::getContext() const
+{
+ return m_aProps->m_xContext;
+}
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OReportDefinition::getTransferData( const datatransfer::DataFlavor& aFlavor ) throw (datatransfer::UnsupportedFlavorException, io::IOException, uno::RuntimeException)
+{
+ uno::Any aResult;
+ if( isDataFlavorSupported( aFlavor ) )
+ {
+ try
+ {
+ aResult <<= getPreferredVisualRepresentation(0).Data;
+ }
+ catch( uno::Exception & ex )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ (void)ex;
+ }
+ }
+ else
+ {
+ throw datatransfer::UnsupportedFlavorException(aFlavor.MimeType, static_cast< ::cppu::OWeakObject* >( this ));
+ }
+
+ return aResult;
+}
+// -----------------------------------------------------------------------------
+uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransferDataFlavors( ) throw (uno::RuntimeException)
+{
+ uno::Sequence< datatransfer::DataFlavor > aRet(1);
+
+ aRet[0] = datatransfer::DataFlavor( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PNG")),
+ ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
+
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OReportDefinition::isDataFlavorSupported( const datatransfer::DataFlavor& aFlavor ) throw (uno::RuntimeException)
+{
+ return aFlavor.MimeType.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png")));
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// =============================================================================
+}// namespace reportdesign
+// =============================================================================
+
diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx
new file mode 100644
index 000000000000..0a39b12455a5
--- /dev/null
+++ b/reportdesign/source/core/api/ReportEngineJFree.cxx
@@ -0,0 +1,426 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include "ReportEngineJFree.hxx"
+#include <comphelper/enumhelper.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <connectivity/dbtools.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/property.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
+#include <com/sun/star/sdb/XCompletedExecution.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/task/XJob.hpp>
+
+#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
+#include <unotools/useroptions.hxx>
+#include <unotools/tempfile.hxx>
+#include <unotools/sharedunocomponent.hxx>
+
+#include "Tools.hxx"
+#include "corestrings.hrc"
+#include "core_resource.hrc"
+#include "core_resource.hxx"
+
+#include <connectivity/CommonTools.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <sfx2/docfilt.hxx>
+// =============================================================================
+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)
+,m_nMaxRows(0)
+{
+ DBG_CTOR( rpt_OReportEngineJFree,NULL);
+}
+// -----------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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();
+ 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;
+ }
+ }
+ l.notify();
+}
+// -----------------------------------------------------------------------------
+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::getNewOutputName()
+{
+ ::rtl::OUString sOutputName;
+ {
+ ::osl::MutexGuard aGuard(m_aMutex);
+ ::connectivity::checkDisposed(ReportEngineBase::rBHelper.bDisposed);
+ if ( !m_xReport.is() || !m_xActiveConnection.is() )
+ throw lang::IllegalArgumentException();
+
+ static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
+ try
+ {
+ const uno::Reference< lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
+ MimeConfigurationHelper aConfighelper(xFactory);
+ const ::rtl::OUString sMimeType = m_xReport->getMimeType();
+ const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aConfighelper.GetDocServiceNameFromMediaType(sMimeType) );
+ String sExt;
+ if ( pFilter )
+ {
+ sExt = pFilter->GetDefaultExtension();
+ sExt.EraseLeadingChars( '*' );
+ }
+ else
+ sExt = String::CreateFromAscii(".rpt");
+
+ 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() )
+ {
+ xStorageProp->setPropertyValue( s_sMediaType, uno::makeAny(sMimeType));
+ }
+ 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(8);
+ sal_Int32 nPos = 0;
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStorage"));
+ aConvertedProperties[nPos++].Value <<= xTemp;
+ aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStorage"));
+
+ ::rtl::OUString sFileURL;
+ String sName = m_xReport->getCaption();
+ if ( !sName.Len() )
+ sName = m_xReport->getName();
+ {
+ ::utl::TempFile aTestFile(sName,sal_False,&sExt);
+ if ( !aTestFile.IsValid() )
+ {
+ sName = RPT_RESSTRING(RID_STR_REPORT,m_xContext->getServiceManager());
+ ::utl::TempFile aFile(sName,sal_False,&sExt);
+ sFileURL = aFile.GetURL();
+ }
+ else
+ sFileURL = aTestFile.GetURL();
+ }
+
+ uno::Reference< embed::XStorage > xOut = OStorageHelper::GetStorageFromURL(sFileURL,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() )
+ {
+ xStorageProp->setPropertyValue( s_sMediaType, uno::makeAny(sMimeType));
+ }
+
+ aConvertedProperties[nPos++].Value <<= xOut;
+
+ aConvertedProperties[nPos].Name = PROPERTY_REPORTDEFINITION;
+ aConvertedProperties[nPos++].Value <<= m_xReport;
+
+ aConvertedProperties[nPos].Name = PROPERTY_ACTIVECONNECTION;
+ aConvertedProperties[nPos++].Value <<= m_xActiveConnection;
+
+ aConvertedProperties[nPos].Name = PROPERTY_MAXROWS;
+ aConvertedProperties[nPos++].Value <<= m_nMaxRows;
+
+ // some meta data
+ SvtUserOptions aUserOpts;
+ ::rtl::OUStringBuffer sAuthor(aUserOpts.GetFirstName());
+ sAuthor.appendAscii(" ");
+ sAuthor.append(aUserOpts.GetLastName());
+ static const ::rtl::OUString s_sAuthor(RTL_CONSTASCII_USTRINGPARAM("Author"));
+ aConvertedProperties[nPos].Name = s_sAuthor;
+ aConvertedProperties[nPos++].Value <<= sAuthor.makeStringAndClear();
+
+ static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"));
+ aConvertedProperties[nPos].Name = s_sTitle;
+ aConvertedProperties[nPos++].Value <<= m_xReport->getCaption();
+
+ // create job factory and initialize
+ const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(xFactory);
+ uno::Reference<task::XJob> xJob(m_xContext->getServiceManager()->createInstanceWithContext(sReportEngineServiceName,m_xContext),uno::UNO_QUERY_THROW);
+ if ( m_xReport->getCommand().getLength() )
+ {
+ xJob->execute(aConvertedProperties);
+ if ( xStorageProp.is() )
+ {
+ //xStorageProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))) >>= sOutputName;
+ sOutputName = sFileURL;
+ }
+ }
+
+ 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)
+{
+ return createDocumentAlive(NULL,true);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive( const uno::Reference< frame::XFrame >& _frame ) throw (lang::DisposedException, lang::IllegalArgumentException, uno::Exception, uno::RuntimeException)
+{
+ return createDocumentAlive(_frame,false);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive( const uno::Reference< frame::XFrame >& _frame,bool _bHidden ) 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_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( _bHidden ? 3 : 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;
+
+ if ( _bHidden )
+ {
+ aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
+ 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);
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportEngineJFree::getMaxRows() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_nMaxRows;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportEngineJFree::setMaxRows( ::sal_Int32 _MaxRows ) throw (uno::RuntimeException)
+{
+ set(PROPERTY_MAXROWS,_MaxRows,m_nMaxRows);
+}
+// =============================================================================
+} // namespace reportdesign
+// =============================================================================
diff --git a/reportdesign/source/core/api/ReportVisitor.cxx b/reportdesign/source/core/api/ReportVisitor.cxx
new file mode 100644
index 000000000000..ea1ef11b239f
--- /dev/null
+++ b/reportdesign/source/core/api/ReportVisitor.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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..65040676e6d6
--- /dev/null
+++ b/reportdesign/source/core/api/Section.cxx
@@ -0,0 +1,723 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Section.hxx"
+#include <comphelper/enumhelper.hxx>
+#include <connectivity/dbtools.hxx>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <com/sun/star/report/ForceNewPage.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#ifndef REPORTDESIGN_SHARED_CORESTRINGS_HRC
+#include "corestrings.hrc"
+#endif
+#include "core_resource.hxx"
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include <tools/debug.hxx>
+#include "Tools.hxx"
+#include "RptModel.hxx"
+#include "RptPage.hxx"
+#include "ReportDefinition.hxx"
+#include "Shape.hxx"
+#include <svx/unoshape.hxx>
+#include "RptObject.hxx"
+#include "ReportDrawPage.hxx"
+#include <comphelper/property.hxx>
+// =============================================================================
+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);
+}
+//--------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+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)
+{
+ OSL_ENSURE(!rBHelper.bDisposed,"Already disposed!");
+ SectionPropertySet::dispose();
+ cppu::WeakComponentImplHelperBase::dispose();
+
+}
+// -----------------------------------------------------------------------------
+// TODO: VirtualFunctionFinder: This is virtual function!
+//
+void SAL_CALL OSection::disposing()
+{
+ lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
+ m_aContainerListeners.disposeAndClear( aDisposeEvent );
+ m_xContext.clear();
+ //m_xDrawPage.clear();
+
+ /*uno::Reference< report::XReportDefinition> xReport = getReportDefinition();
+ ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport);
+ osl_incrementInterlockedCount( &m_refCount );
+ while( m_xDrawPage.is() && m_xDrawPage->hasElements() )
+ {
+ try
+ {
+ uno::Reference< drawing::XShape> xShape(m_xDrawPage->getByIndex(0),uno::UNO_QUERY);
+ m_xDrawPage->remove(xShape);
+ ::comphelper::disposeComponent(xShape);
+ }
+ catch(const uno::Exception&)
+ {}
+ }
+ 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 )
+ {
+// DO NOT TOUCH THIS BLOCKS, WE HAVE A COMPILER PROBLEM UNDER SOLARIS X86
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ uno::Reference<report::XSection> xTemp = this;
+ {
+ {
+ m_xProxy.set(pModel->createNewPage(xTemp)->getUnoPage(),uno::UNO_QUERY);
+ }
+ {
+ ::comphelper::query_aggregation(m_xProxy,m_xDrawPage);
+ }
+
+ // set ourself as delegator
+ {
+ if ( m_xProxy.is() )
+ {
+ m_xProxy->setDelegator( xTemp );
+ }
+ }
+ }
+ xTemp.clear();
+ }
+// DO NOT TOUCH THIS BLOCKS, WE HAVE A COMPILER PROBLEM UNDER SOLARIS X86
+ 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)
+{
+ sal_Bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);
+ setBackTransparent(bTransparent);
+ if ( !bTransparent )
+ 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);
+ if ( _backtransparent )
+ set(PROPERTY_BACKCOLOR,static_cast<sal_Int32>(COL_TRANSPARENT),m_nBackgroundColor);
+}
+// -----------------------------------------------------------------------------
+::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->getGroups());
+ 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..5b1baf53f5f8
--- /dev/null
+++ b/reportdesign/source/core/api/Shape.cxx
@@ -0,0 +1,522 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Shape.hxx"
+
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/text/ParagraphVertAlign.hpp>
+#include <comphelper/property.hxx>
+#include <comphelper/sequence.hxx>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#include <boost/bind.hpp>
+#include <svx/unoshape.hxx>
+
+#include "corestrings.hrc"
+#include "core_resource.hrc"
+#include "core_resource.hxx"
+#include "Tools.hxx"
+#include "RptObject.hxx"
+#include "FormatCondition.hxx"
+#include "ReportHelperImpl.hxx"
+// =============================================================================
+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)
+,m_bOpaque(sal_False)
+{
+ 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
+ ,const ::rtl::OUString& _sServiceName)
+: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)
+,m_bOpaque(sal_False)
+,m_sServiceName(_sServiceName)
+{
+ 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();
+}
+// -----------------------------------------------------------------------------
+::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 m_sServiceName == ServiceName || ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+// -----------------------------------------------------------------------------
+// XReportComponent
+REPORTCOMPONENT_IMPL(OShape,m_aProps.aComponent)
+REPORTCOMPONENT_IMPL2(OShape,m_aProps.aComponent)
+REPORTCOMPONENT_MASTERDETAIL(OShape,m_aProps.aComponent)
+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 || !aPropertyName.getLength() )
+ m_aProps.aComponent.m_xProperty->addPropertyChangeListener( aPropertyName, xListener);
+ // can be in both
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !aPropertyName.getLength() )
+ 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 || !aPropertyName.getLength() )
+ m_aProps.aComponent.m_xProperty->removePropertyChangeListener( aPropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(aPropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !aPropertyName.getLength() )
+ 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 || !PropertyName.getLength() )
+ m_aProps.aComponent.m_xProperty->addVetoableChangeListener( PropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !PropertyName.getLength() )
+ 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 || !PropertyName.getLength() )
+ m_aProps.aComponent.m_xProperty->removeVetoableChangeListener( PropertyName, aListener );
+ // can be in both
+ if( m_pAggHelper->classifyProperty(PropertyName) == OPropertyArrayAggregationHelper::DELEGATOR_PROPERTY || !PropertyName.getLength() )
+ 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::XReportComponent> xSet;
+ try
+ {
+ SvxShape* pShape = SvxShape::getImplementation( xSource );
+ if ( pShape )
+ {
+ SdrObject* pObject = pShape->GetSdrObject();
+ if ( pObject )
+ {
+ SdrObject* pClone = pObject->Clone();
+ if ( pClone )
+ {
+ xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW );
+
+ // ::comphelper::copyProperties(xSource.get(),xSet.get());
+ }
+ }
+ } // if ( pShape )
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ 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);
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OShape::getOpaque() throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ return m_bOpaque;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OShape::setOpaque( ::sal_Bool _opaque ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ set(PROPERTY_OPAQUE,_opaque,m_bOpaque);
+}
+// -----------------------------------------------------------------------------
+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..2c72f9e9c3c0
--- /dev/null
+++ b/reportdesign/source/core/api/Tools.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "Tools.hxx"
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#include "core_resource.hrc"
+#endif
+#include "core_resource.hxx"
+#include <comphelper/property.hxx>
+
+// =============================================================================
+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..f19d7486a0cd
--- /dev/null
+++ b/reportdesign/source/core/api/makefile.mk
@@ -0,0 +1,63 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+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..7598bc5d1ace
--- /dev/null
+++ b/reportdesign/source/core/api/services.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "sal/types.h"
+#include <cppuhelper/factory.hxx>
+#include <osl/diagnose.h>
+#include <cppuhelper/implementationentry.hxx>
+#include "ReportDefinition.hxx"
+#include "FormattedField.hxx"
+#include "FixedText.hxx"
+#include "ImageControl.hxx"
+#include "FormatCondition.hxx"
+#include "ReportEngineJFree.hxx"
+#include "Function.hxx"
+#include "Shape.hxx"
+#include "FixedLine.hxx"
+
+/********************************************************************************************/
+
+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;
+}
+
+} // extern "C"
diff --git a/reportdesign/source/core/inc/FixedLine.hxx b/reportdesign/source/core/inc/FixedLine.hxx
new file mode 100644
index 000000000000..dd7d14df57e2
--- /dev/null
+++ b/reportdesign/source/core/inc/FixedLine.hxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_FIXEDLINE_HXX
+#define RPT_FIXEDLINE_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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
+ ,sal_Int32 _nOrientation);
+
+ 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..9acdcb2d9148
--- /dev/null
+++ b/reportdesign/source/core/inc/FixedText.hxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_FIXEDTEXT_HXX
+#define RPT_FIXEDTEXT_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XFixedText.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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;
+ 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);
+
+ // ::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..82628270395b
--- /dev/null
+++ b/reportdesign/source/core/inc/FormatCondition.hxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_FORMATCONDITION_HXX
+#define RPT_FORMATCONDITION_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XFormatCondition.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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..9f1186dc23d5
--- /dev/null
+++ b/reportdesign/source/core/inc/FormattedField.hxx
@@ -0,0 +1,167 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_FORMATTEDFIELD_HXX
+#define RPT_FORMATTEDFIELD_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/report/Function.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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..cd4364ef2659
--- /dev/null
+++ b/reportdesign/source/core/inc/Function.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_FUNCTION_HXX
+#define RPT_FUNCTION_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#ifndef _COM_SUN_STAR_REPORT_XFunction_HPP_
+#include <com/sun/star/report/XFunction.hpp>
+#endif
+#include <cppuhelper/basemutex.hxx>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+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..a6d2e8751a55
--- /dev/null
+++ b/reportdesign/source/core/inc/Functions.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_FUNCTIONS_HXX
+#define REPORTDESIGN_API_FUNCTIONS_HXX
+
+#include <com/sun/star/report/XFunctions.hpp>
+#include <com/sun/star/report/XFunctionsSupplier.hpp>
+#include <cppuhelper/compbase1.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#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:
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ virtual ~OFunctions();
+
+ /** this function is called upon disposing the component
+ */
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ 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);
+
+ // 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..008435333217
--- /dev/null
+++ b/reportdesign/source/core/inc/Group.hxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_GROUP_HXX
+#define REPORTDESIGN_API_GROUP_HXX
+
+#include <com/sun/star/report/XGroup.hpp>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include "GroupProperties.hxx"
+#include <comphelper/uno3.hxx>
+#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:
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ virtual ~OGroup();
+
+ /** this function is called upon disposing the component
+ */
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ 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..c888fae5926f
--- /dev/null
+++ b/reportdesign/source/core/inc/Groups.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_GROUPS_HXX
+#define REPORTDESIGN_API_GROUPS_HXX
+
+#include <com/sun/star/report/XGroups.hpp>
+#include <cppuhelper/compbase1.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#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:
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ virtual ~OGroups();
+
+ /** this function is called upon disposing the component
+ */
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ 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..7dc65804ab48
--- /dev/null
+++ b/reportdesign/source/core/inc/ImageControl.hxx
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_IMAGECONTROL_HXX
+#define RPT_IMAGECONTROL_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XImageControl.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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_Int16 m_nScaleMode;
+ ::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 ::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);
+ virtual ::sal_Int16 SAL_CALL getScaleMode() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) throw (::com::sun::star::lang::IllegalArgumentException, ::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..6ed9496a9f59
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportComponent.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCOMPONENT_HXX
+#define RPT_REPORTCOMPONENT_HXX
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <cppuhelper/weakref.hxx>
+#include <comphelper/uno3.hxx>
+
+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;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aMasterFields;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aDetailFields;
+ ::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);
+ };
+}
+#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..4da5cc9df349
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportControlModel.hxx
@@ -0,0 +1,137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCONTROLMODEL_HXX
+#define RPT_REPORTCONTROLMODEL_HXX
+
+#include "ReportComponent.hxx"
+#include "com/sun/star/style/VerticalAlignment.hpp"
+#include "com/sun/star/awt/FontDescriptor.hpp"
+#include "com/sun/star/report/XFormatCondition.hpp"
+#include "com/sun/star/container/XContainer.hpp"
+#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+#include <tools/color.hxx>
+#include <comphelper/uno3.hxx>
+#include <cppuhelper/interfacecontainer.h>
+
+
+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::awt::FontDescriptor aAsianFontDescriptor;
+ ::com::sun::star::awt::FontDescriptor aComplexFontDescriptor;
+ ::com::sun::star::lang::Locale aCharLocale;
+ ::com::sun::star::lang::Locale aCharLocaleAsian;
+ ::com::sun::star::lang::Locale aCharLocaleComplex;
+ ::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;
+ com::sun::star::style::VerticalAlignment 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)
+ {}
+
+ // 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..87f34c0f1065
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportDrawPage.hxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef REPORTDRAWPAGE_HXX_INCLUDED
+#define REPORTDRAWPAGE_HXX_INCLUDED
+
+#include <svx/unopage.hxx>
+#include <com/sun/star/report/XSection.hpp>
+
+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..1a53f24f2d7c
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportEngineJFree.hxx
@@ -0,0 +1,138 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_REPORTENGINEJFREE_HXX
+#define REPORTDESIGN_API_REPORTENGINEJFREE_HXX
+
+#include <com/sun/star/report/XReportEngine.hpp>
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/types.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+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::task::XStatusIndicator> m_StatusIndicator;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection;
+ ::sal_Int32 m_nMaxRows;
+ 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();
+ }
+
+ /** returns the file url for a new model
+ *
+ * \return The new file url.
+ */
+ ::rtl::OUString getNewOutputName();
+
+ protected:
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ 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);
+ private:
+ // 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) ;
+ virtual ::sal_Int32 SAL_CALL getMaxRows() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMaxRows( ::sal_Int32 _MaxRows ) 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) ;
+ ::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 ,bool _bHidden) 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..d0eb2490dbbd
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx
@@ -0,0 +1,1291 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORTHELPERIMPL_HXX
+#define INCLUDED_REPORTHELPERIMPL_HXX
+// ::com::sun::star::report::XReportComponent:
+#define REPORTCOMPONENT_IMPL3(clazz,arg) \
+::rtl::OUString SAL_CALL clazz::getName() throw (uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_sName; \
+} \
+void SAL_CALL clazz::setName( const ::rtl::OUString& _name ) throw (uno::RuntimeException,beans::PropertyVetoException) \
+{ \
+ set(PROPERTY_NAME,_name,(arg).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); \
+} \
+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_IMPL(clazz,arg) \
+REPORTCOMPONENT_IMPL3(clazz,arg)\
+::sal_Bool SAL_CALL clazz::getPrintRepeatedValues() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_bPrintRepeatedValues; \
+} \
+void SAL_CALL clazz::setPrintRepeatedValues( ::sal_Bool _printrepeatedvalues ) throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ set(PROPERTY_PRINTREPEATEDVALUES,_printrepeatedvalues,(arg).m_bPrintRepeatedValues); \
+}
+
+#define REPORTCOMPONENT_IMPL2(clazz,arg) \
+::sal_Int16 SAL_CALL clazz::getControlBorder() throw (beans::UnknownPropertyException, uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_nBorder; \
+} \
+void SAL_CALL clazz::setControlBorder( ::sal_Int16 _border ) throw (uno::RuntimeException,lang::IllegalArgumentException,beans::UnknownPropertyException)\
+{ \
+ set(PROPERTY_CONTROLBORDER,_border,(arg).m_nBorder); \
+} \
+::sal_Int32 SAL_CALL clazz::getControlBorderColor() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_nBorderColor; \
+} \
+void SAL_CALL clazz::setControlBorderColor( ::sal_Int32 _bordercolor ) throw (uno::RuntimeException, lang::IllegalArgumentException, beans::UnknownPropertyException) \
+{ \
+ set(PROPERTY_CONTROLBORDERCOLOR,_bordercolor,(arg).m_nBorderColor); \
+}
+
+#define REPORTCOMPONENT_MASTERDETAIL(clazz,arg) \
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL clazz::getMasterFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_aMasterFields; \
+} \
+void SAL_CALL clazz::setMasterFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _masterfields ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ set(PROPERTY_MASTERFIELDS,_masterfields,(arg).m_aMasterFields); \
+} \
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL clazz::getDetailFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return (arg).m_aDetailFields; \
+} \
+void SAL_CALL clazz::setDetailFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _detailfields ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ set(PROPERTY_DETAILFIELDS,_detailfields,(arg).m_aDetailFields); \
+}
+
+#define REPORTCOMPONENT_NOMASTERDETAIL(clazz) \
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL clazz::getMasterFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException) \
+{ \
+ throw ::com::sun::star::beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setMasterFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ throw ::com::sun::star::beans::UnknownPropertyException();\
+} \
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL clazz::getDetailFields() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ throw ::com::sun::star::beans::UnknownPropertyException();\
+} \
+void SAL_CALL clazz::setDetailFields( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ throw ::com::sun::star::beans::UnknownPropertyException();\
+}
+
+// ::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)\
+{ \
+ sal_Bool bTransparent = _backgroundcolor == static_cast<sal_Int32>(COL_TRANSPARENT);\
+ setControlBackgroundTransparent(bTransparent);\
+ if ( !bTransparent )\
+ 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);\
+ if ( _controlbackgroundtransparent )\
+ set(PROPERTY_CONTROLBACKGROUND,static_cast<sal_Int32>(COL_TRANSPARENT),varName.nBackgroundColor);\
+}
+
+#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 (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.nAlign; \
+} \
+ \
+void SAL_CALL clazz::setParaAdjust( sal_Int16 _align ) throw (beans::UnknownPropertyException,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); \
+} \
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptorAsian() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor; \
+} \
+ \
+void SAL_CALL clazz::setFontDescriptorAsian( const awt::FontDescriptor& _fontdescriptor ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_FONTDESCRIPTORASIAN,_fontdescriptor,varName.aAsianFontDescriptor); \
+} \
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptorComplex() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor; \
+} \
+ \
+void SAL_CALL clazz::setFontDescriptorComplex( const awt::FontDescriptor& _fontdescriptor ) throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ set(PROPERTY_FONTDESCRIPTORCOMPLEX,_fontdescriptor,varName.aComplexFontDescriptor); \
+} \
+ \
+::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); \
+} \
+ \
+style::VerticalAlignment SAL_CALL clazz::getVerticalAlign() throw (beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aVerticalAlignment; \
+} \
+ \
+void SAL_CALL clazz::setVerticalAlign( style::VerticalAlignment _verticalalign ) throw (lang::IllegalArgumentException,beans::UnknownPropertyException,uno::RuntimeException) \
+{ \
+ 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); \
+}\
+float SAL_CALL clazz::getCharHeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ { \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Height; \
+}\
+void SAL_CALL clazz::setCharHeightAsian( float the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARHEIGHTASIAN,static_cast<sal_Int16>(the_value),varName.aAsianFontDescriptor.Height); \
+}\
+float SAL_CALL clazz::getCharWeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ { \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Weight; \
+}\
+void SAL_CALL clazz::setCharWeightAsian( float the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARWEIGHTASIAN,the_value,varName.aAsianFontDescriptor.Weight); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharFontNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Name; \
+}\
+void SAL_CALL clazz::setCharFontNameAsian( const ::rtl::OUString& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTNAMEASIAN,the_value,varName.aAsianFontDescriptor.Name); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharFontStyleNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.StyleName; \
+}\
+void SAL_CALL clazz::setCharFontStyleNameAsian( const ::rtl::OUString& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTSTYLENAMEASIAN,the_value,varName.aAsianFontDescriptor.StyleName); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontFamilyAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Family; \
+}\
+void SAL_CALL clazz::setCharFontFamilyAsian( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTFAMILYASIAN,the_value,varName.aAsianFontDescriptor.Family); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontCharSetAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.CharSet; \
+}\
+void SAL_CALL clazz::setCharFontCharSetAsian( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTCHARSETASIAN,the_value,varName.aAsianFontDescriptor.CharSet); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontPitchAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Pitch; \
+}\
+void SAL_CALL clazz::setCharFontPitchAsian( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTPITCHASIAN,the_value,varName.aAsianFontDescriptor.Pitch); \
+}\
+::com::sun::star::awt::FontSlant SAL_CALL clazz::getCharPostureAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aAsianFontDescriptor.Slant; \
+}\
+void SAL_CALL clazz::setCharPostureAsian( ::com::sun::star::awt::FontSlant the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARPOSTUREASIAN,the_value,varName.aAsianFontDescriptor.Slant); \
+}\
+::com::sun::star::lang::Locale SAL_CALL clazz::getCharLocaleAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aCharLocaleAsian; \
+}\
+void SAL_CALL clazz::setCharLocaleAsian( const ::com::sun::star::lang::Locale& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ BoundListeners l; \
+ { \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ if ( varName.aCharLocaleAsian.Language != the_value.Language \
+ || varName.aCharLocaleAsian.Country != the_value.Country \
+ || varName.aCharLocaleAsian.Variant != the_value.Variant ) \
+ { \
+ prepareSet(PROPERTY_CHARLOCALEASIAN, ::com::sun::star::uno::makeAny(varName.aCharLocaleAsian), ::com::sun::star::uno::makeAny(the_value), &l); \
+ varName.aCharLocaleAsian = the_value; \
+ } \
+ } \
+ l.notify(); \
+}\
+float SAL_CALL clazz::getCharHeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Height; \
+}\
+void SAL_CALL clazz::setCharHeightComplex( float the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARHEIGHTCOMPLEX,static_cast<sal_Int16>(the_value),varName.aComplexFontDescriptor.Height); \
+}\
+float SAL_CALL clazz::getCharWeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Weight; \
+}\
+void SAL_CALL clazz::setCharWeightComplex( float the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARWEIGHTCOMPLEX,the_value,varName.aComplexFontDescriptor.Weight); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharFontNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Name; \
+}\
+void SAL_CALL clazz::setCharFontNameComplex( const ::rtl::OUString& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTNAMECOMPLEX,the_value,varName.aComplexFontDescriptor.Name); \
+}\
+::rtl::OUString SAL_CALL clazz::getCharFontStyleNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.StyleName; \
+}\
+void SAL_CALL clazz::setCharFontStyleNameComplex( const ::rtl::OUString& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTSTYLENAMECOMPLEX,the_value,varName.aComplexFontDescriptor.StyleName); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontFamilyComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Family; \
+}\
+void SAL_CALL clazz::setCharFontFamilyComplex( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTFAMILYCOMPLEX,the_value,varName.aComplexFontDescriptor.Family); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontCharSetComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.CharSet; \
+}\
+void SAL_CALL clazz::setCharFontCharSetComplex( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTCHARSETCOMPLEX,the_value,varName.aComplexFontDescriptor.CharSet); \
+}\
+::sal_Int16 SAL_CALL clazz::getCharFontPitchComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Pitch; \
+}\
+void SAL_CALL clazz::setCharFontPitchComplex( ::sal_Int16 the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARFONTPITCHCOMPLEX,the_value,varName.aComplexFontDescriptor.Pitch); \
+}\
+::com::sun::star::awt::FontSlant SAL_CALL clazz::getCharPostureComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aComplexFontDescriptor.Slant; \
+}\
+void SAL_CALL clazz::setCharPostureComplex( ::com::sun::star::awt::FontSlant the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ set(PROPERTY_CHARPOSTURECOMPLEX,the_value,varName.aComplexFontDescriptor.Slant); \
+}\
+::com::sun::star::lang::Locale SAL_CALL clazz::getCharLocaleComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ return varName.aCharLocaleComplex; \
+}\
+void SAL_CALL clazz::setCharLocaleComplex( const ::com::sun::star::lang::Locale& the_value ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+{ \
+ BoundListeners l; \
+ { \
+ ::osl::MutexGuard aGuard(m_aMutex); \
+ if ( varName.aCharLocaleComplex.Language != the_value.Language \
+ || varName.aCharLocaleComplex.Country != the_value.Country \
+ || varName.aCharLocaleComplex.Variant != the_value.Variant ) \
+ { \
+ prepareSet(PROPERTY_CHARLOCALECOMPLEX, ::com::sun::star::uno::makeAny(varName.aCharLocaleComplex), ::com::sun::star::uno::makeAny(the_value), &l); \
+ varName.aCharLocaleComplex = the_value; \
+ } \
+ } \
+ l.notify(); \
+}\
+
+
+#define NO_REPORTCONTROLFORMAT_IMPL(clazz) \
+sal_Int16 SAL_CALL clazz::getParaAdjust() throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+void SAL_CALL clazz::setParaAdjust(sal_Int16 /*the_value*/) throw (uno::RuntimeException, beans::UnknownPropertyException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+::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();\
+}\
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptorAsian() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setFontDescriptorAsian( const awt::FontDescriptor& /*_fontdescriptor*/ ) throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ throw beans::UnknownPropertyException();\
+}\
+awt::FontDescriptor SAL_CALL clazz::getFontDescriptorComplex() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+throw beans::UnknownPropertyException();\
+}\
+\
+void SAL_CALL clazz::setFontDescriptorComplex( 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();\
+}\
+\
+style::VerticalAlignment SAL_CALL clazz::getVerticalAlign() throw (beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ ::osl::MutexGuard aGuard(m_aMutex);\
+ return m_aProps.aFormatProperties.aVerticalAlignment;\
+}\
+\
+void SAL_CALL clazz::setVerticalAlign( style::VerticalAlignment _verticalalign ) throw (lang::IllegalArgumentException,beans::UnknownPropertyException,uno::RuntimeException)\
+{\
+ 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();\
+}\
+ float SAL_CALL clazz::getCharHeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharHeightAsian( float ) throw (beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ float SAL_CALL clazz::getCharWeightAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharWeightAsian( float ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::rtl::OUString SAL_CALL clazz::getCharFontNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontNameAsian( const ::rtl::OUString& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::rtl::OUString SAL_CALL clazz::getCharFontStyleNameAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontStyleNameAsian( const ::rtl::OUString& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontFamilyAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontFamilyAsian( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontCharSetAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontCharSetAsian( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontPitchAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontPitchAsian( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::com::sun::star::awt::FontSlant SAL_CALL clazz::getCharPostureAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharPostureAsian( ::com::sun::star::awt::FontSlant ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::com::sun::star::lang::Locale SAL_CALL clazz::getCharLocaleAsian() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharLocaleAsian( const ::com::sun::star::lang::Locale& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ float SAL_CALL clazz::getCharHeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharHeightComplex( float ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ float SAL_CALL clazz::getCharWeightComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharWeightComplex( float ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::rtl::OUString SAL_CALL clazz::getCharFontNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontNameComplex( const ::rtl::OUString& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::rtl::OUString SAL_CALL clazz::getCharFontStyleNameComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontStyleNameComplex( const ::rtl::OUString& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontFamilyComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontFamilyComplex( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontCharSetComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontCharSetComplex( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::sal_Int16 SAL_CALL clazz::getCharFontPitchComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharFontPitchComplex( ::sal_Int16 ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::com::sun::star::awt::FontSlant SAL_CALL clazz::getCharPostureComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharPostureComplex( ::com::sun::star::awt::FontSlant ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ ::com::sun::star::lang::Locale SAL_CALL clazz::getCharLocaleComplex() throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)\
+ {\
+ throw beans::UnknownPropertyException();\
+}\
+ void SAL_CALL clazz::setCharLocaleComplex( const ::com::sun::star::lang::Locale& ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::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..5e2a70f3ae19
--- /dev/null
+++ b/reportdesign/source/core/inc/ReportUndoFactory.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORT_UNDOFACTORY_HXX_INCLUDED
+#define REPORT_UNDOFACTORY_HXX_INCLUDED
+
+#include <svx/svdundo.hxx>
+#include <memory>
+#include "ModuleHelper.hxx"
+
+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, sal_Int32 nText );
+
+ // 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..0a781ee36c61
--- /dev/null
+++ b/reportdesign/source/core/inc/RptObjectListener.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_RPTUILIST_HXX
+#define _REPORT_RPTUILIST_HXX
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+
+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..3d3f0f205b06
--- /dev/null
+++ b/reportdesign/source/core/inc/Section.hxx
@@ -0,0 +1,208 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_API_SECTION_HXX
+#define REPORTDESIGN_API_SECTION_HXX
+
+#include <com/sun/star/report/XSection.hpp>
+#include <cppuhelper/compbase3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/uno3.hxx>
+#include <comphelper/types.hxx>
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/uno/XAggregation.hpp>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#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:
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ virtual ~OSection();
+
+ /** this function is called upon disposing the component
+ */
+ // TODO: VirtualFunctionFinder: This is virtual function!
+ //
+ 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..00a351f544b5
--- /dev/null
+++ b/reportdesign/source/core/inc/Shape.hxx
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_SHAPE_HXX
+#define RPT_SHAPE_HXX
+
+#include <cppuhelper/propertysetmixin.hxx>
+#include <com/sun/star/report/XShape.hpp>
+#include "ReportControlModel.hxx"
+#include <cppuhelper/compbase2.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#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;
+ ::sal_Bool m_bOpaque;
+
+ ::rtl::OUString m_sServiceName;
+ ::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
+ ,const ::rtl::OUString& _sServiceName);
+
+ 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);
+
+ virtual ::sal_Bool SAL_CALL getOpaque() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setOpaque( ::sal_Bool _opaque ) 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..e8753078bf97
--- /dev/null
+++ b/reportdesign/source/core/inc/Tools.hxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_TOOLS_HXX
+#define REPORTDESIGN_TOOLS_HXX
+
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/report/XFixedText.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+
+
+#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_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal with or height!");
+
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ {
+ ::com::sun::star::awt::Size aOldSize = _pShape->m_aProps.aComponent.m_xShape->getSize();
+ if ( aOldSize.Height != aSize.Height || aOldSize.Width != aSize.Width )
+ {
+ _pShape->m_aProps.aComponent.m_nWidth = aOldSize.Width;
+ _pShape->m_aProps.aComponent.m_nHeight = aOldSize.Height;
+ _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() )
+ {
+ ::com::sun::star::awt::Size aSize = _pShape->m_aProps.aComponent.m_xShape->getSize();
+ OSL_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal with or height!");
+ return aSize;
+ }
+ 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)
+ {
+ // we know it is not allowed that the position in smaller 0, but in NbcMove() it will handled right.
+ // only at 'Undo' it is possible to short set the position smaller 0
+ // OSL_ENSURE(_aPosition.X >= 0 && _aPosition.Y >= 0,"set to Illegal position!");
+ ::osl::MutexGuard aGuard(_pShape->m_aMutex);
+ ::com::sun::star::awt::Point aOldPos;
+ aOldPos.X = _pShape->m_aProps.aComponent.m_nPosX;
+ aOldPos.Y = _pShape->m_aProps.aComponent.m_nPosY;
+
+ ::com::sun::star::awt::Point aPosition(_aPosition);
+ if ( _pShape->m_aProps.aComponent.m_xShape.is() )
+ {
+ aOldPos = _pShape->m_aProps.aComponent.m_xShape->getPosition();
+ if ( aOldPos.X != aPosition.X || aOldPos.Y != aPosition.Y )
+ {
+ _pShape->m_aProps.aComponent.m_nPosX = aOldPos.X;
+ _pShape->m_aProps.aComponent.m_nPosY = aOldPos.Y;
+ _pShape->m_aProps.aComponent.m_xShape->setPosition(aPosition);
+ }
+ }
+ _pShape->set(PROPERTY_POSITIONX,aPosition.X,aOldPos.X);
+ _pShape->set(PROPERTY_POSITIONY,aPosition.Y,aOldPos.Y);
+ }
+ 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() )
+ {
+ ::com::sun::star::awt::Point aPosition = _pShape->m_aProps.aComponent.m_xShape->getPosition();
+// OSL_ENSURE(aPosition.X >= 0 && aPosition.Y >= 0,"Illegal position!");
+ return aPosition;
+ }
+ 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/conditionupdater.hxx b/reportdesign/source/core/inc/conditionupdater.hxx
new file mode 100644
index 000000000000..6db89dcc6386
--- /dev/null
+++ b/reportdesign/source/core/inc/conditionupdater.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef CONDITIONUPDATER_HXX
+#define CONDITIONUPDATER_HXX
+
+#include "conditionalexpression.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/report/XReportControlModel.hpp>
+/** === end UNO includes === **/
+
+#include <boost/noncopyable.hpp>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ //====================================================================
+ //= ConditionUpdater
+ //====================================================================
+ class ConditionUpdater : public ::boost::noncopyable
+ {
+ public:
+ ConditionUpdater();
+ ~ConditionUpdater();
+
+ /// notifies the object about the change of a property value, somewhere in the report definition
+ void notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent );
+
+ private:
+ /// does late initializations, return whether or not successful
+ bool impl_lateInit_nothrow();
+
+ void impl_adjustFormatConditions_nothrow(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel >& _rxRptControlModel,
+ const ::rtl::OUString& _rOldDataSource,
+ const ::rtl::OUString& _rNewDataSource
+ );
+
+ private:
+ ConditionalExpressions m_aConditionalExpressions;
+ };
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // CONDITIONUPDATER_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..e565ddc9b9c5
--- /dev/null
+++ b/reportdesign/source/core/inc/core_resource.hrc
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef REPORTDESIGN_CORE_RESOURCE_HRC_
+#define REPORTDESIGN_CORE_RESOURCE_HRC_
+
+#ifndef _SOLAR_HRC
+#include <svl/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..36e3e3149404
--- /dev/null
+++ b/reportdesign/source/core/inc/core_resource.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORTDESIGN_CORE_RESOURCE_HXX_
+#define REPORTDESIGN_CORE_RESOURCE_HXX_
+
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+
+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/misc/conditionalexpression.cxx b/reportdesign/source/core/misc/conditionalexpression.cxx
new file mode 100644
index 000000000000..8537f6b81d50
--- /dev/null
+++ b/reportdesign/source/core/misc/conditionalexpression.cxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "conditionalexpression.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ /** === begin UNO using === **/
+ /** === end UNO using === **/
+
+ // =============================================================================
+ // = ConditionalExpression
+ // =============================================================================
+ // -----------------------------------------------------------------------------
+ ConditionalExpression::ConditionalExpression( const sal_Char* _pAsciiPattern )
+ :m_sPattern( ::rtl::OUString::createFromAscii( _pAsciiPattern ) )
+ {
+ }
+
+ // -----------------------------------------------------------------------------
+ ::rtl::OUString ConditionalExpression::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, "ConditionalExpression::assembleExpression: illegal pattern!" );
+ break;
+ }
+
+ sExpression = sExpression.replaceAt( nPatternIndex, 2, *pReplace );
+ nPatternIndex = sExpression.indexOf( '$', nPatternIndex + pReplace->getLength() + 1 );
+ }
+ return sExpression;
+ }
+
+ // -----------------------------------------------------------------------------
+ bool ConditionalExpression::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,
+ "ConditionalExpression::matchExpression: unsupported pattern (more than one LHS occurance)!" );
+ OSL_ENSURE( sMatchExpression.indexOf( sRHSPattern, nRHSIndex + 1 ) == -1,
+ "ConditionalExpression::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 ) ),
+ "ConditionalExpression::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,
+ "ConditionalExpression::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;
+ }
+
+ // =============================================================================
+ // = ConditionalExpressionFactory
+ // =============================================================================
+ // -----------------------------------------------------------------------------
+ size_t ConditionalExpressionFactory::getKnownConditionalExpressions( ConditionalExpressions& _out_rCondExp )
+ {
+ ConditionalExpressions aEmpty;
+ _out_rCondExp.swap( aEmpty );
+
+ _out_rCondExp[ eBetween ] = PConditionalExpression( new ConditionalExpression( "AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )" ) );
+ _out_rCondExp[ eNotBetween ] = PConditionalExpression( new ConditionalExpression( "NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )" ) );
+ _out_rCondExp[ eEqualTo ] = PConditionalExpression( new ConditionalExpression( "( $$ ) = ( $1 )" ) );
+ _out_rCondExp[ eNotEqualTo ] = PConditionalExpression( new ConditionalExpression( "( $$ ) <> ( $1 )" ) );
+ _out_rCondExp[ eGreaterThan ] = PConditionalExpression( new ConditionalExpression( "( $$ ) > ( $1 )" ) );
+ _out_rCondExp[ eLessThan ] = PConditionalExpression( new ConditionalExpression( "( $$ ) < ( $1 )" ) );
+ _out_rCondExp[ eGreaterOrEqual ] = PConditionalExpression( new ConditionalExpression( "( $$ ) >= ( $1 )" ) );
+ _out_rCondExp[ eLessOrEqual ] = PConditionalExpression( new ConditionalExpression( "( $$ ) <= ( $1 )" ) );
+
+ return _out_rCondExp.size();
+ }
+//........................................................................
+} // namespace rptui
+//........................................................................
diff --git a/reportdesign/source/core/misc/conditionupdater.cxx b/reportdesign/source/core/misc/conditionupdater.cxx
new file mode 100644
index 000000000000..a3408e9d7d01
--- /dev/null
+++ b/reportdesign/source/core/misc/conditionupdater.cxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "conditionupdater.hxx"
+#include "reportformula.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/report/XFormatCondition.hpp>
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::beans::PropertyChangeEvent;
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::report::XReportControlModel;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::report::XFormatCondition;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::Exception;
+ /** === end UNO using === **/
+
+ //====================================================================
+ //= ConditionUpdater
+ //====================================================================
+ //--------------------------------------------------------------------
+ ConditionUpdater::ConditionUpdater()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ ConditionUpdater::~ConditionUpdater()
+ {
+ }
+
+ //--------------------------------------------------------------------
+ void ConditionUpdater::notifyPropertyChange( const PropertyChangeEvent& _rEvent )
+ {
+ if ( !impl_lateInit_nothrow() )
+ return;
+
+ Reference< XReportControlModel > xRptControlModel( _rEvent.Source, UNO_QUERY );
+ if ( xRptControlModel.is() && _rEvent.PropertyName.equalsAscii( "DataField" ) )
+ {
+ ::rtl::OUString sOldDataSource, sNewDataSource;
+ OSL_VERIFY( _rEvent.OldValue >>= sOldDataSource );
+ OSL_VERIFY( _rEvent.NewValue >>= sNewDataSource );
+ impl_adjustFormatConditions_nothrow( xRptControlModel, sOldDataSource, sNewDataSource );
+ }
+ }
+
+ //--------------------------------------------------------------------
+ bool ConditionUpdater::impl_lateInit_nothrow()
+ {
+ if ( !m_aConditionalExpressions.empty() )
+ return true;
+
+ ConditionalExpressionFactory::getKnownConditionalExpressions( m_aConditionalExpressions );
+ return true;
+ }
+
+ //--------------------------------------------------------------------
+ void ConditionUpdater::impl_adjustFormatConditions_nothrow( const Reference< XReportControlModel >& _rxRptControlModel,
+ const ::rtl::OUString& _rOldDataSource, const ::rtl::OUString& _rNewDataSource )
+ {
+ try
+ {
+ ReportFormula aOldContentFormula( _rOldDataSource );
+ ::rtl::OUString sOldUnprefixed( aOldContentFormula.getBracketedFieldOrExpression() );
+ ReportFormula aNewContentFormula( _rNewDataSource );
+ ::rtl::OUString sNewUnprefixed( aNewContentFormula.getBracketedFieldOrExpression() );
+
+ sal_Int32 nCount( _rxRptControlModel->getCount() );
+ Reference< XFormatCondition > xFormatCondition;
+ ::rtl::OUString sFormulaExpression, sLHS, sRHS;
+ for ( sal_Int32 i=0; i<nCount; ++i )
+ {
+ xFormatCondition.set( _rxRptControlModel->getByIndex( i ), UNO_QUERY_THROW );
+ ReportFormula aFormula( xFormatCondition->getFormula() );
+ sFormulaExpression = aFormula.getExpression();
+
+ for ( ConditionalExpressions::const_iterator loop = m_aConditionalExpressions.begin();
+ loop != m_aConditionalExpressions.end();
+ ++loop
+ )
+ {
+ if ( !loop->second->matchExpression( sFormulaExpression, sOldUnprefixed, sLHS, sRHS ) )
+ continue;
+
+ // the expression matches -> translate it to the new data source of the report control model
+ sFormulaExpression = loop->second->assembleExpression( sNewUnprefixed, sLHS, sRHS );
+ aFormula = ReportFormula( ReportFormula::Expression, sFormulaExpression );
+ xFormatCondition->setFormula( aFormula.getCompleteFormula() );
+ break;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+//........................................................................
+} // namespace rptui
+//........................................................................
diff --git a/reportdesign/source/core/misc/makefile.mk b/reportdesign/source/core/misc/makefile.mk
new file mode 100644
index 000000000000..749eb8214125
--- /dev/null
+++ b/reportdesign/source/core/misc/makefile.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=core_misc
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES= $(SLO)$/conditionalexpression.obj \
+ $(SLO)$/conditionupdater.obj \
+ $(SLO)$/reportformula.obj
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx
new file mode 100644
index 000000000000..2ceef3340ef0
--- /dev/null
+++ b/reportdesign/source/core/misc/reportformula.cxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "reportformula.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <rtl/ustrbuf.hxx>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Any;
+ /** === end UNO using === **/
+
+ namespace
+ {
+ //----------------------------------------------------------------
+ const ::rtl::OUString& lcl_getExpressionPrefix( sal_Int32* _pTakeLengthOrNull = NULL )
+ {
+ static ::rtl::OUString s_sPrefix( RTL_CONSTASCII_USTRINGPARAM( "rpt:" ) );
+ if ( _pTakeLengthOrNull )
+ *_pTakeLengthOrNull = s_sPrefix.getLength();
+ return s_sPrefix;
+ }
+
+ //----------------------------------------------------------------
+ const ::rtl::OUString& lcl_getFieldPrefix( sal_Int32* _pTakeLengthOrNull = NULL )
+ {
+ static ::rtl::OUString s_sPrefix( RTL_CONSTASCII_USTRINGPARAM( "field:" ) );
+ if ( _pTakeLengthOrNull )
+ *_pTakeLengthOrNull = s_sPrefix.getLength();
+ return s_sPrefix;
+ }
+ }
+
+ //====================================================================
+ //= ReportFormula
+ //====================================================================
+ //--------------------------------------------------------------------
+ ReportFormula::ReportFormula( const ::rtl::OUString& _rFormula )
+ :m_eType( Invalid )
+ {
+ impl_construct( _rFormula );
+ }
+
+ //--------------------------------------------------------------------
+ ReportFormula::ReportFormula( const BindType _eType, const ::rtl::OUString& _rFieldOrExpression )
+ :m_eType( _eType )
+ {
+ switch ( m_eType )
+ {
+ case Expression:
+ {
+ if ( _rFieldOrExpression.indexOf( lcl_getExpressionPrefix() ) == 0 )
+ m_sCompleteFormula = _rFieldOrExpression;
+ else
+ m_sCompleteFormula = lcl_getExpressionPrefix() + _rFieldOrExpression;
+ }
+ break;
+
+ case Field:
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.append( lcl_getFieldPrefix() );
+ aBuffer.appendAscii( "[" );
+ aBuffer.append( _rFieldOrExpression );
+ aBuffer.appendAscii( "]" );
+ m_sCompleteFormula = aBuffer.makeStringAndClear();
+ }
+ break;
+ default:
+ OSL_ENSURE( false, "ReportFormula::ReportFormula: illegal bind type!" );
+ return;
+ }
+
+ m_sUndecoratedContent = _rFieldOrExpression;
+ }
+ //--------------------------------------------------------------------
+ ReportFormula::~ReportFormula()
+ {
+ }
+ //--------------------------------------------------------------------
+ void ReportFormula::impl_construct( const ::rtl::OUString& _rFormula )
+ {
+ m_sCompleteFormula = _rFormula;
+
+ sal_Int32 nPrefixLen( -1 );
+ // is it an ordinary expression?
+ if ( m_sCompleteFormula.indexOf( lcl_getExpressionPrefix( &nPrefixLen ) ) == 0 )
+ {
+ m_eType = Expression;
+ m_sUndecoratedContent = m_sCompleteFormula.copy( nPrefixLen );
+ return;
+ }
+
+ /// does it refer to a field?
+ if ( m_sCompleteFormula.indexOf( lcl_getFieldPrefix( &nPrefixLen ) ) == 0 )
+ {
+ if ( ( m_sCompleteFormula.getLength() >= nPrefixLen + 2 )
+ && ( m_sCompleteFormula[ nPrefixLen ] == '[' )
+ && ( m_sCompleteFormula[ m_sCompleteFormula.getLength() - 1 ] == ']' )
+ )
+ {
+ m_eType = Field;
+ m_sUndecoratedContent = m_sCompleteFormula.copy( nPrefixLen + 1, m_sCompleteFormula.getLength() - nPrefixLen - 2 );
+ return;
+ }
+ }
+
+ m_eType = Invalid;
+ }
+
+ //--------------------------------------------------------------------
+ ::rtl::OUString ReportFormula::getBracketedFieldOrExpression() const
+ {
+ bool bIsField = ( getType() == Field );
+ ::rtl::OUStringBuffer aFieldContent;
+ if ( bIsField )
+ aFieldContent.appendAscii( "[" );
+ aFieldContent.append( getUndecoratedContent() );
+ if ( bIsField )
+ aFieldContent.appendAscii( "]" );
+
+ return aFieldContent.makeStringAndClear();
+ }
+ //--------------------------------------------------------------------
+ const ::rtl::OUString& ReportFormula::getUndecoratedContent() const
+ {
+ return m_sUndecoratedContent;
+ }
+ const ::rtl::OUString& ReportFormula::getCompleteFormula() const { return m_sCompleteFormula; }
+ bool ReportFormula::isValid() const { return getType() != Invalid; }
+ ReportFormula& ReportFormula::operator=(class ReportFormula const & _rHd)
+ {
+ if ( this == &_rHd )
+ return *this;
+ m_eType = _rHd.m_eType;
+ m_sCompleteFormula = _rHd.m_sCompleteFormula;
+ m_sUndecoratedContent = _rHd.m_sUndecoratedContent;
+ return *this;
+ }
+ //--------------------------------------------------------------------
+ ::rtl::OUString ReportFormula::getEqualUndecoratedContent() const
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.appendAscii( "=" );
+ aBuffer.append( getUndecoratedContent() );
+ return aBuffer.makeStringAndClear();
+ }
+
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/core/resource/core_resource.cxx b/reportdesign/source/core/resource/core_resource.cxx
new file mode 100644
index 000000000000..eb0ad6b57d4f
--- /dev/null
+++ b/reportdesign/source/core/resource/core_resource.cxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "core_resource.hxx"
+#include <tools/simplerm.hxx>
+
+// ---- needed as long as we have no contexts for components ---
+#include <vcl/svapp.hxx>
+//---------------------------------------------------
+#include <comphelper/configurationhelper.hxx>
+#include <osl/thread.h>
+#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/uri.hxx>
+
+#ifndef _SOLAR_HRC
+#include <svl/solar.hrc>
+#endif
+#include "ModuleHelper.hxx"
+//.........................................................................
+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" );
+ 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..d80adb525656
--- /dev/null
+++ b/reportdesign/source/core/resource/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+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..d6191e2f381e
--- /dev/null
+++ b/reportdesign/source/core/resource/strings.src
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "core_resource.hrc"
+
+String RID_STR_DETAIL
+{
+ Text [ en-US ] = "Detail";
+};
+String RID_STR_PAGE_HEADER
+{
+ Text [ en-US ] = "Page Header";
+};
+String RID_STR_PAGE_FOOTER
+{
+ Text [ en-US ] = "Page Footer";
+};
+String RID_STR_GROUP_HEADER
+{
+ Text [ en-US ] = "Group Header";
+};
+String RID_STR_GROUP_FOOTER
+{
+ Text [ en-US ] = "Group Footer";
+};
+String RID_STR_REPORT_HEADER
+{
+ Text [ en-US ] = "Report Header";
+};
+String RID_STR_REPORT_FOOTER
+{
+ Text [ en-US ] = "Report Footer";
+};
+
+String RID_STR_PROPERTY_CHANGE_NOT_ALLOWED
+{
+ Text [ en-US ] = "The name '#1' already exists and can not be asssigned again.";
+};
+
+String RID_STR_ERROR_WRONG_ARGUMENT
+{
+ 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 [ en-US ] = "The element is invalid.";
+};
+String RID_STR_FIXEDTEXT
+{
+ Text [ en-US ] = "Label field" ;
+};
+String RID_STR_FORMATTEDFIELD
+{
+ Text [ en-US ] = "Formatted field";
+};
+String RID_STR_IMAGECONTROL
+{
+ Text [ en-US ] = "Image control" ;
+};
+String RID_STR_REPORT
+{
+ Text [ en-US ] = "Report";
+};
+String RID_STR_SHAPE
+{
+ Text [ en-US ] = "Shape";
+};
+String RID_STR_FIXEDLINE
+{
+ Text [ en-US ] = "Fixed line";
+};
diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx
new file mode 100644
index 000000000000..6337a28fcc46
--- /dev/null
+++ b/reportdesign/source/core/sdr/ModuleHelper.cxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ModuleHelper.hxx"
+#include <comphelper/configurationhelper.hxx>
+#include <comphelper/processfactory.hxx>
+#include <osl/thread.h>
+#include <com/sun/star/util/XMacroExpander.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/uri.hxx>
+#include <tools/debug.hxx>
+#ifndef _SOLAR_HRC
+#include <svl/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" );
+ 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..dbd6d4da65a2
--- /dev/null
+++ b/reportdesign/source/core/sdr/PropertyForward.cxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "PropertyForward.hxx"
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <comphelper/property.hxx>
+#include <com/sun/star/sdbcx/XAppend.hpp>
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+#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)
+ {
+ Property aProp = m_xSourceInfo->getPropertyByName(aIter->first);
+ if (0 == (aProp.Attributes & PropertyAttribute::READONLY))
+ {
+ Any aValue = _xDest->getPropertyValue(aIter->second.first);
+ if ( 0 != (aProp.Attributes & PropertyAttribute::MAYBEVOID) || aValue.hasValue() )
+ _xSource->setPropertyValue(aIter->first,aIter->second.second->operator()(aIter->second.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.first,aIter->second.second->operator()(aIter->second.first,_xSource->getPropertyValue(aIter->first)));
+ }
+ startListening();
+ }
+ catch(Exception& e)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ (void)e;
+ }
+ } // 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.first;
+ else
+ {
+ aFind = ::std::find_if(
+ m_aNameMap.begin(),
+ m_aNameMap.end(),
+ ::std::compose1(
+ ::std::bind2nd(::std::equal_to< ::rtl::OUString >(), evt.PropertyName),
+ ::std::compose1(::std::select1st<TPropertyConverter>(),::std::select2nd<TPropertyNamePair::value_type>())
+ )
+ );
+ if ( aFind != m_aNameMap.end() )
+ sPropName = aFind->first;
+ }
+ if ( sPropName.getLength() && xPropInfo->hasPropertyByName(sPropName) )
+ xProp->setPropertyValue(sPropName,aFind->second.second->operator()(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..6ef0f970078f
--- /dev/null
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -0,0 +1,156 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "ReportDrawPage.hxx"
+#include "RptObject.hxx"
+#include "RptModel.hxx"
+#include "RptDef.hxx"
+#include "corestrings.hrc"
+#include <comphelper/mimeconfighelper.hxx>
+#include <comphelper/classids.hxx>
+#include <comphelper/embeddedobjectcontainer.hxx>
+#include <comphelper/documentconstants.hxx>
+
+#include <svx/svdmodel.hxx>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/beans/NamedValue.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;
+ uno::Reference< drawing::XShape > xShape;
+ if ( xFactory.is() )
+ {
+ bool bChangeOrientation = false;
+ ::rtl::OUString sServiceName = pBaseObj->getServiceName();
+ OSL_ENSURE(sServiceName.getLength(),"No Service Name given!");
+
+ if ( pObj->ISA(OUnoObject) )
+ {
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObj);
+ if ( pUnoObj->GetObjIdentifier() == OBJ_DLG_FIXEDTEXT )
+ {
+ uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xControlModel.is() )
+ xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(sal_True));
+ }
+ else
+ bChangeOrientation = pUnoObj->GetObjIdentifier() == OBJ_DLG_HFIXEDLINE;
+ SvxShapeControl* pShape = new SvxShapeControl( pObj );
+ xShape.set(*pShape,uno::UNO_QUERY);
+ pShape->setShapeKind(pObj->GetObjIdentifier());
+ }
+ else if ( pObj->ISA(OCustomShape) )
+ {
+ SvxCustomShape* pShape = new SvxCustomShape( pObj );
+ uno::Reference < drawing::XEnhancedCustomShapeDefaulter > xShape2 = pShape;
+ xShape.set(xShape2,uno::UNO_QUERY);
+ pShape->setShapeKind(pObj->GetObjIdentifier());
+ }
+ else if ( pObj->ISA(SdrOle2Obj) )
+ {
+ SdrOle2Obj* pOle2Obj = dynamic_cast<SdrOle2Obj*>(pObj);
+ if ( !pOle2Obj->GetObjRef().is() )
+ {
+ sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
+ uno::Reference < embed::XEmbeddedObject > xObj;
+ ::rtl::OUString sName;
+ xObj = pObj->GetModel()->GetPersist()->getEmbeddedObjectContainer().CreateEmbeddedObject(
+ ::comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("80243D39-6741-46C5-926E-069164FF87BB"))), sName );
+ OSL_ENSURE(xObj.is(),"Embedded Object could not be created!");
+
+ /**************************************************
+ * Das leere OLE-Objekt bekommt ein neues IPObj
+ **************************************************/
+ pObj->SetEmptyPresObj(FALSE);
+ pOle2Obj->SetOutlinerParaObject(NULL);
+ pOle2Obj->SetObjRef(xObj);
+ pOle2Obj->SetPersistName(sName);
+ pOle2Obj->SetName(sName);
+ pOle2Obj->SetAspect(nAspect);
+ Rectangle aRect = pOle2Obj->GetLogicRect();
+
+ Size aTmp = aRect.GetSize();
+ awt::Size aSz( aTmp.Width(), aTmp.Height() );
+ xObj->setVisualAreaSize( nAspect, aSz );
+ }
+ SvxOle2Shape* pShape = new SvxOle2Shape( pObj );
+ xShape.set(*pShape,uno::UNO_QUERY);
+ pShape->setShapeKind(pObj->GetObjIdentifier());
+ //xShape = new SvxOle2Shape( pOle2Obj );
+ }
+
+ if ( !xShape.is() )
+ xShape.set( SvxDrawPage::_CreateShape( pObj ) );
+
+ try
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(pObj->GetModel());
+ xRet.set( pRptModel->createShape(sServiceName,xShape,bChangeOrientation ? 0 : 1), uno::UNO_QUERY_THROW );
+ }
+ 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..e0e089e651b2
--- /dev/null
+++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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, sal_Int32 nText )
+{
+ return m_pUndoFactory->CreateUndoObjectSetText( rNewObj, nText );
+}
+
+// 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..7327456c7940
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -0,0 +1,233 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#include "RptModel.hxx"
+#include "RptPage.hxx"
+#include <dbaccess/singledoccontroller.hxx>
+#include <tools/debug.hxx>
+#include <unotools/pathoptions.hxx>
+
+#include "UndoActions.hxx"
+#include "UndoEnv.hxx"
+#include "ReportUndoFactory.hxx"
+#include "ReportDefinition.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"
+#include "FixedLine.hxx"
+#include "FormattedField.hxx"
+#include "FixedText.hxx"
+#include "ImageControl.hxx"
+#include "Shape.hxx"
+
+namespace rptui
+{
+using namespace reportdesign;
+using namespace com::sun::star;
+DBG_NAME( rpt_OReportModel )
+TYPEINIT1(OReportModel,SdrModel);
+
+//----------------------------------------------------------------------------
+
+OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition) :
+ SdrModel(SvtPathOptions().GetPalettePath(),NULL,_pReportDefinition)
+ ,m_pController(NULL)
+ ,m_pReportDefinition(_pReportDefinition)
+{
+ 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_pReportDefinition = NULL;
+ 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 uno::Reference< report::XSection >& _xSection)
+{
+ OReportPage* pPage = new OReportPage( *this ,_xSection);
+ InsertPage(pPage);
+ m_pUndoEnv->AddSection(_xSection);
+ return pPage;
+}
+// -----------------------------------------------------------------------------
+OReportPage* OReportModel::getPage(const uno::Reference< 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
+{
+ uno::Reference< report::XReportDefinition > xReportDefinition = m_pReportDefinition;
+ OSL_ENSURE( xReportDefinition.is(), "OReportModel::getReportDefinition: invalid model at our controller!" );
+ return xReportDefinition;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OReportModel::createUnoModel()
+{
+ return uno::Reference< uno::XInterface >(getReportDefinition(),uno::UNO_QUERY);
+}
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OReportModel::createShape(const ::rtl::OUString& aServiceSpecifier,uno::Reference< drawing::XShape >& _rShape,sal_Int32 nOrientation)
+{
+ uno::Reference< uno::XInterface > xRet;
+ if ( _rShape.is() )
+ {
+ if ( aServiceSpecifier == SERVICE_FORMATTEDFIELD )
+ {
+ uno::Reference<report::XFormattedField> xProp = new OFormattedField(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape);
+ xRet = xProp;
+ if ( _rShape.is() )
+ throw uno::Exception();
+ xProp->setPropertyValue( PROPERTY_FORMATSSUPPLIER, uno::makeAny(uno::Reference< util::XNumberFormatsSupplier >(*m_pReportDefinition,uno::UNO_QUERY)) );
+ }
+ else if ( aServiceSpecifier == SERVICE_FIXEDTEXT)
+ {
+ xRet = static_cast<cppu::OWeakObject*>(new OFixedText(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
+ if ( _rShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_FIXEDLINE)
+ {
+ xRet = static_cast<cppu::OWeakObject*>(new OFixedLine(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,nOrientation));
+ if ( _rShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_IMAGECONTROL )
+ {
+ xRet = static_cast<cppu::OWeakObject*>(new OImageControl(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
+ if ( _rShape.is() )
+ throw uno::Exception();
+ }
+ else if ( aServiceSpecifier == SERVICE_REPORTDEFINITION )
+ {
+ xRet = static_cast<cppu::OWeakObject*>(new OReportDefinition(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
+ if ( _rShape.is() )
+ throw uno::Exception();
+ }
+ else if ( _rShape.is() )
+ {
+ xRet = static_cast<cppu::OWeakObject*>(new OShape(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,aServiceSpecifier));
+ if ( _rShape.is() )
+ throw uno::Exception();
+ }
+ }
+ return xRet;
+}
+//==================================================================
+} //rptui
+//==================================================================
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
new file mode 100644
index 000000000000..7d1cdbc6db30
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -0,0 +1,1256 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "RptObject.hxx"
+#include <vector>
+#include <algorithm>
+
+#include <RptDef.hxx>
+#include <svx/unoshape.hxx>
+#include "RptModel.hxx"
+#include "RptObjectListener.hxx"
+#include <toolkit/helper/vclunohelper.hxx>
+#include <toolkit/helper/convert.hxx>
+#include "RptPage.hxx"
+#include "corestrings.hrc"
+#include <dbaccess/singledoccontroller.hxx>
+#include "ModuleHelper.hxx"
+
+#include <RptResId.hrc>
+#include <svx/xflclit.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/sderitm.hxx>
+#include <svx/xlnwtit.hxx>
+#include <svx/xlntrit.hxx>
+#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/awt/XTabControllerModel.hpp>
+#include <com/sun/star/awt/XUnoControlContainer.hpp>
+#include <com/sun/star/awt/XVclContainerPeer.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/script/XScriptEventsSupplier.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/property.hxx>
+#include <tools/diagnose_ex.h>
+#include "PropertyForward.hxx"
+#include <connectivity/dbtools.hxx>
+#include <connectivity/dbconversion.hxx>
+#include "UndoActions.hxx"
+#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;
+using namespace report;
+//----------------------------------------------------------------------------
+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( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) ) )
+ return OBJ_OLE2;
+ if ( xServiceInfo->supportsService( SERVICE_SHAPE ))
+ return OBJ_CUSTOMSHAPE;
+ if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) )
+ return OBJ_DLG_SUBREPORT;
+ return OBJ_OLE2;
+ }
+ 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:
+ {
+ OUnoObject* pUnoObj = new OUnoObject( _xComponent
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))
+ ,OBJ_DLG_FIXEDTEXT);
+ pNewObj = pUnoObj;
+
+ uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
+ if ( xControlModel.is() )
+ xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(sal_True));
+ }
+ 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 = OCustomShape::Create( _xComponent );
+ try
+ {
+ sal_Bool bOpaque = sal_False;
+ _xComponent->getPropertyValue(PROPERTY_OPAQUE) >>= bOpaque;
+ pNewObj->SetLayer(bOpaque ? RPT_LAYER_FRONT : RPT_LAYER_BACK);
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ break;
+ case OBJ_DLG_SUBREPORT:
+ case OBJ_OLE2:
+ pNewObj = OOle2Obj::Create( _xComponent,nType );
+ break;
+ default:
+ OSL_ENSURE(0,"Unknown object id");
+ break;
+ }
+
+ ensureSdrObjectOwnership( _xComponent );
+
+ return pNewObj;
+}
+// -----------------------------------------------------------------------------
+namespace
+{
+ class ParaAdjust : public AnyConverter
+ {
+ public:
+ virtual ::com::sun::star::uno::Any operator() (const ::rtl::OUString& _sPropertyName,const ::com::sun::star::uno::Any& lhs) const
+ {
+ uno::Any aRet;
+ if ( _sPropertyName.equalsAscii(PROPERTY_PARAADJUST) )
+ {
+ sal_Int16 nTextAlign = 0;
+ lhs >>= 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;
+ } // switch(nTextAlign)
+ aRet <<= (style::ParagraphAdjust)nTextAlign;
+ }
+ else
+ {
+ sal_Int16 nTextAlign = 0;
+ sal_Int16 eParagraphAdjust = 0;
+ lhs >>= eParagraphAdjust;
+ switch(eParagraphAdjust)
+ {
+ case style::ParagraphAdjust_LEFT:
+ case style::ParagraphAdjust_BLOCK:
+ 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;
+ } // switch(eParagraphAdjust)
+ aRet <<= nTextAlign;
+ }
+ return aRet;
+ }
+ };
+}
+// -----------------------------------------------------------------------------
+const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
+{
+ switch(_nObjectId)
+ {
+ case OBJ_DLG_IMAGECONTROL:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)));
+ //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN));
+ }
+ return s_aNameMap;
+ }
+
+ case OBJ_DLG_FIXEDTEXT:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)));
+
+ ::boost::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust());
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust)));
+ }
+ return s_aNameMap;
+ }
+ case OBJ_DLG_FORMATTEDFIELD:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARUNDERLINECOLOR,TPropertyConverter(PROPERTY_TEXTLINECOLOR,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARRELIEF,TPropertyConverter(PROPERTY_FONTRELIEF,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARFONTHEIGHT,TPropertyConverter(PROPERTY_FONTHEIGHT,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CHARSTRIKEOUT,TPropertyConverter(PROPERTY_FONTSTRIKEOUT,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)));
+ //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter)));
+ ::boost::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust());
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust)));
+ }
+ return s_aNameMap;
+ }
+
+ case OBJ_CUSTOMSHAPE:
+ {
+ static TPropertyNamePair s_aNameMap;
+ if ( s_aNameMap.empty() )
+ {
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ s_aNameMap.insert(TPropertyNamePair::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FillColor")),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter)));
+ s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter)));
+ }
+ 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>();
+}
+//----------------------------------------------------------------------------
+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!");
+
+ m_bIsListening = sal_False;
+ if ( isListening() && m_xReportComponent.is() )
+ {
+ // 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::_propertyChange( const beans::PropertyChangeEvent& /*evt*/ ) throw( uno::RuntimeException)
+{
+ DBG_CHKTHIS( rpt_OObjectBase,NULL);
+}
+//----------------------------------------------------------------------------
+void OObjectBase::SetObjectItemHelper(const SfxPoolItem& /*rItem*/)
+{
+ // do nothing
+}
+
+//----------------------------------------------------------------------------
+sal_Bool OObjectBase::supportsService( const ::rtl::OUString& _sServiceName ) 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( _sServiceName );
+
+ return bSupports;
+}
+
+//----------------------------------------------------------------------------
+void OObjectBase::ensureSdrObjectOwnership( const uno::Reference< uno::XInterface >& _rxShape )
+{
+ // 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 give the XShape implementation the ownership of the SdrObject, which
+ // ensures the SvxDrawPage won't delete it.
+ SvxShape* pShape = SvxShape::getImplementation( _rxShape );
+ OSL_ENSURE( pShape, "OObjectBase::ensureSdrObjectOwnership: can't access the SvxShape!" );
+ if ( pShape )
+ {
+ OSL_ENSURE( !pShape->HasSdrObjectOwnership(), "OObjectBase::ensureSdrObjectOwnership: called twice?" );
+ pShape->TakeSdrObjectOwnership();
+ }
+}
+
+//----------------------------------------------------------------------------
+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;
+
+ ensureSdrObjectOwnership( xShape );
+
+ 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);
+ impl_setUnoShape( uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY) );
+ m_bIsListening = sal_True;
+}
+//----------------------------------------------------------------------------
+OCustomShape::OCustomShape(const ::rtl::OUString& _sComponentName)
+ :SdrObjCustomShape()
+ ,OObjectBase(_sComponentName)
+{
+ DBG_CTOR( rpt_OCustomShape, NULL);
+ m_bIsListening = sal_True;
+}
+
+//----------------------------------------------------------------------------
+OCustomShape::~OCustomShape()
+{
+ DBG_DTOR( rpt_OCustomShape, NULL);
+}
+// -----------------------------------------------------------------------------
+UINT16 OCustomShape::GetObjIdentifier() const
+{
+ return UINT16(OBJ_CUSTOMSHAPE);
+}
+//----------------------------------------------------------------------------
+UINT32 OCustomShape::GetObjInventor() const
+{
+ return ReportInventor;
+}
+//----------------------------------------------------------------------------
+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 )
+{
+ if ( m_bIsListening )
+ {
+ m_bIsListening = sal_False;
+
+ if ( m_xReportComponent.is() )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A());
+ m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B());
+ }
+
+ // set geometry properties
+ SetPropsFromRect(GetSnapRect());
+
+ m_bIsListening = sal_True;
+ }
+ else
+ SdrObjCustomShape::NbcMove( rSize );
+}
+//----------------------------------------------------------------------------
+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);
+ }
+ SetPropsFromRect(GetSnapRect());
+ }
+
+ return bResult;
+}
+
+//----------------------------------------------------------------------------
+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()
+{
+ uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this );
+ if ( !m_xReportComponent.is() )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ m_xReportComponent.set(xShape,uno::UNO_QUERY);
+ }
+ return xShape;
+}
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+TYPEINIT1(OUnoObject, SdrUnoObj);
+DBG_NAME( rpt_OUnoObject );
+//----------------------------------------------------------------------------
+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);
+ if ( rModelName.getLength() )
+ impl_initializeModel_nothrow();
+}
+//----------------------------------------------------------------------------
+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);
+ impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
+
+ if ( rModelName.getLength() )
+ impl_initializeModel_nothrow();
+
+ if ( rModelName.getLength() )
+ impl_initializeModel_nothrow();
+}
+//----------------------------------------------------------------------------
+OUnoObject::~OUnoObject()
+{
+ DBG_DTOR( rpt_OUnoObject, NULL);
+}
+// -----------------------------------------------------------------------------
+void OUnoObject::impl_initializeModel_nothrow()
+{
+ try
+ {
+ Reference< XFormattedField > xFormatted( m_xReportComponent, UNO_QUERY );
+ if ( xFormatted.is() )
+ {
+ const Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW );
+ const ::rtl::OUString sTreatAsNumberProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TreatAsNumber" ) );
+ xModelProps->setPropertyValue( sTreatAsNumberProperty, makeAny( sal_False ) );
+ xModelProps->setPropertyValue( PROPERTY_VERTICALALIGN,m_xReportComponent->getPropertyValue(PROPERTY_VERTICALALIGN));
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+void OUnoObject::impl_setReportComponent_nothrow()
+{
+ if ( m_xReportComponent.is() )
+ return;
+
+ OReportModel* pReportModel = static_cast<OReportModel*>(GetModel());
+ OSL_ENSURE( pReportModel, "OUnoObject::impl_setReportComponent_nothrow: no report model!" );
+ if ( !pReportModel )
+ return;
+
+ OXUndoEnvironment::OUndoEnvLock aLock( pReportModel->GetUndoEnv() );
+ m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
+
+ impl_initializeModel_nothrow();
+}
+// -----------------------------------------------------------------------------
+UINT16 OUnoObject::GetObjIdentifier() const
+{
+ return UINT16(m_nObjectType);
+}
+//----------------------------------------------------------------------------
+UINT32 OUnoObject::GetObjInventor() const
+{
+ return ReportInventor;
+}
+//----------------------------------------------------------------------------
+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);
+
+ if ( m_bIsListening )
+ {
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ bool bPositionFixed = false;
+ Size aUndoSize(0,0);
+ bool bUndoMode = false;
+ if ( m_xReportComponent.is() )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ if (pRptModel->GetUndoEnv().IsUndoMode())
+ {
+ // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
+ bUndoMode = true;
+ }
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+
+ // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
+ int nNewX = m_xReportComponent->getPositionX() + rSize.A();
+ // can this hinder us to set components outside the area?
+ // if (nNewX < 0)
+ // {
+ // nNewX = 0;
+ // }
+ m_xReportComponent->setPositionX(nNewX);
+ int nNewY = m_xReportComponent->getPositionY() + rSize.B();
+ if (nNewY < 0 && !bUndoMode)
+ {
+ aUndoSize.B() = abs(nNewY);
+ bPositionFixed = true;
+ nNewY = 0;
+ }
+ m_xReportComponent->setPositionY(nNewY);
+ }
+ if (bPositionFixed)
+ {
+ // OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ // if ( pRptModel )
+ // {
+ // if (! pRptModel->GetUndoEnv().IsLocked())
+ // {
+ GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
+ // }
+ // }
+ }
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+
+ // start listening
+ OObjectBase::StartListening();
+ }
+ else
+ SdrUnoObj::NbcMove( rSize );
+}
+
+//----------------------------------------------------------------------------
+
+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 )
+ {
+ impl_setReportComponent_nothrow();
+ // set labels
+ if ( m_xReportComponent.is() )
+ {
+ try
+ {
+ if ( supportsService( SERVICE_FIXEDTEXT ) )
+ {
+ m_xReportComponent->setPropertyValue( PROPERTY_LABEL, uno::makeAny(GetDefaultName(this)) );
+ }
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ impl_initializeModel_nothrow();
+ }
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+ }
+
+ return bResult;
+}
+//----------------------------------------------------------------------------
+::rtl::OUString OUnoObject::GetDefaultName(const OUnoObject* _pObj)
+{
+ sal_uInt16 nResId = 0;
+ ::rtl::OUString aDefaultName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HERE WE HAVE TO INSERT OUR NAME!"));
+ if ( _pObj->supportsService( SERVICE_FIXEDTEXT ) )
+ {
+ nResId = RID_STR_CLASS_FIXEDTEXT;
+ }
+ else if ( _pObj->supportsService( SERVICE_FIXEDLINE ) )
+ {
+ nResId = RID_STR_CLASS_FIXEDLINE;
+ }
+ else if ( _pObj->supportsService( SERVICE_IMAGECONTROL ) )
+ {
+ nResId = RID_STR_CLASS_IMAGECONTROL;
+ }
+ else if ( _pObj->supportsService( SERVICE_FORMATTEDFIELD ) )
+ {
+ nResId = RID_STR_CLASS_FORMATTEDFIELD;
+ }
+
+ if (nResId)
+ aDefaultName = ::rtl::OUString( String(ModuleRes(nResId)) );
+
+ return aDefaultName;
+}
+
+// -----------------------------------------------------------------------------
+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() )
+ {
+ impl_setReportComponent_nothrow();
+
+ 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(GetObjIdentifier()),_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 );
+}
+// -----------------------------------------------------------------------------
+SdrObject* OUnoObject::Clone() const
+{
+ SdrObject* pClone = SdrUnoObj::Clone();
+ if ( pClone )
+ {
+ Reference<XPropertySet> xSource(const_cast<OUnoObject*>(this)->getUnoShape(),uno::UNO_QUERY);
+ Reference<XPropertySet> xDest(pClone->getUnoShape(),uno::UNO_QUERY);
+ if ( xSource.is() && xDest.is() )
+ comphelper::copyProperties(xSource.get(),xDest.get());
+ } // if ( pClone )
+ return pClone;
+}
+//----------------------------------------------------------------------------
+// OOle2Obj
+//----------------------------------------------------------------------------
+TYPEINIT1(OOle2Obj, SdrOle2Obj);
+DBG_NAME( rpt_OOle2Obj );
+OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,UINT16 _nType)
+ :SdrOle2Obj()
+ ,OObjectBase(_xComponent)
+ ,m_nType(_nType)
+ ,m_bOnlyOnce(true)
+{
+ DBG_CTOR( rpt_OOle2Obj, NULL);
+
+ impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
+ m_bIsListening = sal_True;
+}
+//----------------------------------------------------------------------------
+OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,UINT16 _nType)
+ :SdrOle2Obj()
+ ,OObjectBase(_sComponentName)
+ ,m_nType(_nType)
+ ,m_bOnlyOnce(true)
+{
+ DBG_CTOR( rpt_OOle2Obj, NULL);
+ m_bIsListening = sal_True;
+}
+//----------------------------------------------------------------------------
+OOle2Obj::~OOle2Obj()
+{
+ DBG_DTOR( rpt_OOle2Obj, NULL);
+}
+// -----------------------------------------------------------------------------
+UINT16 OOle2Obj::GetObjIdentifier() const
+{
+ return m_nType;
+}
+//----------------------------------------------------------------------------
+UINT32 OOle2Obj::GetObjInventor() const
+{
+ return ReportInventor;
+}
+//----------------------------------------------------------------------------
+SdrPage* OOle2Obj::GetImplPage() const
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ return GetPage();
+}
+//----------------------------------------------------------------------------
+void OOle2Obj::SetSnapRectImpl(const Rectangle& _rRect)
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ SetSnapRect( _rRect );
+}
+//----------------------------------------------------------------------------
+sal_Int32 OOle2Obj::GetStep() const
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ // get step property
+ sal_Int32 nStep = 0;
+ OSL_ENSURE(0,"Who called me!");
+ return nStep;
+}
+
+//----------------------------------------------------------------------------
+void OOle2Obj::NbcMove( const Size& rSize )
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+
+ if ( m_bIsListening )
+ {
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ if ( m_xReportComponent.is() )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A());
+ m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B());
+ }
+
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+
+ // start listening
+ OObjectBase::StartListening();
+ }
+ else
+ SdrOle2Obj::NbcMove( rSize );
+}
+
+//----------------------------------------------------------------------------
+
+void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ SdrOle2Obj::NbcResize( rRef, xFract, yFract );
+
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ // set geometry properties
+ SetPropsFromRect(GetLogicRect());
+
+ // start listening
+ OObjectBase::StartListening();
+}
+//----------------------------------------------------------------------------
+void OOle2Obj::NbcSetLogicRect(const Rectangle& rRect)
+{
+ SdrOle2Obj::NbcSetLogicRect(rRect);
+ // stop listening
+ OObjectBase::EndListening(sal_False);
+
+ // set geometry properties
+ SetPropsFromRect(rRect);
+
+ // start listening
+ OObjectBase::StartListening();
+}
+//----------------------------------------------------------------------------
+
+FASTBOOL OOle2Obj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
+{
+ DBG_CHKTHIS( rpt_OOle2Obj,NULL);
+ FASTBOOL bResult = SdrOle2Obj::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 geometry properties
+ SetPropsFromRect(GetLogicRect());
+ }
+
+ return bResult;
+}
+
+uno::Reference< beans::XPropertySet> OOle2Obj::getAwtComponent()
+{
+ return uno::Reference< beans::XPropertySet>(m_xReportComponent,uno::UNO_QUERY);
+}
+
+// -----------------------------------------------------------------------------
+uno::Reference< uno::XInterface > OOle2Obj::getUnoShape()
+{
+ uno::Reference< uno::XInterface> xShape = OObjectBase::getUnoShapeOf( *this );
+ if ( !m_xReportComponent.is() )
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+ m_xReportComponent.set(xShape,uno::UNO_QUERY);
+ }
+ return xShape;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj)
+{
+ uno::Reference< chart2::data::XDatabaseDataProvider > xSource;
+ uno::Reference< embed::XComponentSupplier > xCompSupp(_xObj,uno::UNO_QUERY);
+ if( xCompSupp.is())
+ {
+ uno::Reference< chart2::XChartDocument> xChartDoc( xCompSupp->getComponent(), uno::UNO_QUERY );
+ if ( xChartDoc.is() )
+ {
+ xSource.set(xChartDoc->getDataProvider(),uno::UNO_QUERY);
+ }
+ } // if( xCompSupp.is())
+ return xSource;
+}
+// -----------------------------------------------------------------------------
+// Clone() soll eine komplette Kopie des Objektes erzeugen.
+SdrObject* OOle2Obj::Clone() const
+{
+ OOle2Obj* pObj = static_cast<OOle2Obj*>(SdrOle2Obj::Clone());
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ svt::EmbeddedObjectRef::TryRunningState( pObj->GetObjRef() );
+ pObj->impl_createDataProvider_nothrow(pRptModel->getReportDefinition().get());
+
+ uno::Reference< chart2::data::XDatabaseDataProvider > xSource( lcl_getDataProvider(GetObjRef()) );
+ uno::Reference< chart2::data::XDatabaseDataProvider > xDest( lcl_getDataProvider(pObj->GetObjRef()) );
+ if ( xSource.is() && xDest.is() )
+ comphelper::copyProperties(xSource.get(),xDest.get());
+
+ pObj->initializeChart(pRptModel->getReportDefinition().get());
+ return pObj;
+}
+// -----------------------------------------------------------------------------
+void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XModel>& _xModel)
+{
+ try
+ {
+ uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
+ uno::Reference< chart2::data::XDataReceiver > xReceiver;
+ uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
+ if( xCompSupp.is())
+ xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
+ OSL_ASSERT( xReceiver.is());
+ if( xReceiver.is() )
+ {
+ uno::Reference< lang::XMultiServiceFactory> xFac(_xModel,uno::UNO_QUERY);
+ uno::Reference< chart2::data::XDatabaseDataProvider > xDataProvider( xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider"))),uno::UNO_QUERY);
+ xReceiver->attachDataProvider( xDataProvider.get() );
+ } // if( xReceiver.is() )
+ }
+ catch(uno::Exception)
+ {
+ }
+}
+// -----------------------------------------------------------------------------
+void OOle2Obj::initializeOle()
+{
+ if ( m_bOnlyOnce )
+ {
+ m_bOnlyOnce = false;
+ uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
+
+ uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
+ if( xCompSupp.is() )
+ {
+ uno::Reference< beans::XPropertySet > xChartProps( xCompSupp->getComponent(), uno::UNO_QUERY );
+ if ( xChartProps.is() )
+ xChartProps->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NullDate")),uno::makeAny(util::DateTime(0,0,0,0,1,1,1900)));
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel)
+{
+ uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
+ uno::Reference< chart2::data::XDataReceiver > xReceiver;
+ uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
+ if( xCompSupp.is())
+ xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
+ OSL_ASSERT( xReceiver.is());
+ if( xReceiver.is() )
+ {
+ // lock the model to suppress any internal updates
+ uno::Reference< frame::XModel > xChartModel( xReceiver, uno::UNO_QUERY );
+ if( xChartModel.is() )
+ xChartModel->lockControllers();
+
+ if ( !lcl_getDataProvider(xObj).is() )
+ impl_createDataProvider_nothrow(_xModel);
+
+ OReportModel* pRptModel = static_cast<OReportModel*>(GetModel());
+ pRptModel->GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
+
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "all" ) ) ) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
+ xReceiver->setArguments( aArgs.getPropertyValues() );
+
+ if( xChartModel.is() )
+ xChartModel->unlockControllers();
+ }
+}
+// -----------------------------------------------------------------------------
+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..64cd9d3dc8a3
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptObjectListener.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "RptObjectListener.hxx"
+#include "RptObject.hxx"
+#include "RptDef.hxx"
+
+namespace rptui
+{
+//============================================================================
+// OObjectListener
+//============================================================================
+
+//----------------------------------------------------------------------------
+DBG_NAME(rpt_OObjectListener)
+OObjectListener::OObjectListener(OObjectBase* _pObject)
+ :m_pObject(_pObject)
+{
+ DBG_CTOR(rpt_OObjectListener,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+OObjectListener::~OObjectListener()
+{
+ DBG_DTOR(rpt_OObjectListener,NULL);
+}
+
+// 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()
+{
+}
+//----------------------------------------------------------------------------
+}
diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx
new file mode 100644
index 000000000000..29f1109aeb6b
--- /dev/null
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "RptPage.hxx"
+#include "RptModel.hxx"
+#include "Section.hxx"
+#include "RptObject.hxx"
+#include <svx/unoapi.hxx>
+#include <svx/unoshape.hxx>
+#include "ReportDrawPage.hxx"
+
+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)
+ ,m_bSpecialInsertMode(false)
+{
+ DBG_CTOR( rpt_OReportPage,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+OReportPage::OReportPage( const OReportPage& rPage )
+ :SdrPage( rPage )
+ ,rModel(rPage.rModel)
+ ,m_xSection(rPage.m_xSection)
+ ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode)
+ ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList)
+{
+ DBG_CTOR( rpt_OReportPage,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+OReportPage::~OReportPage()
+{
+ DBG_DTOR( rpt_OReportPage,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+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;
+ 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);
+ if (getSpecialMode())
+ {
+ return pObj;
+ }
+
+ // 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::removeTempObject(SdrObject *_pToRemoveObj)
+{
+ if (_pToRemoveObj)
+ {
+ for (ULONG i=0;i<GetObjCount();i++)
+ {
+ SdrObject *aObj = GetObj(i);
+ if (aObj && aObj == _pToRemoveObj)
+ {
+ SdrObject* pObject = RemoveObject(i);
+ (void)pObject;
+ break;
+ // delete pObject;
+ }
+ }
+ }
+}
+
+void OReportPage::resetSpecialMode()
+{
+ const sal_Bool bChanged = rModel.IsChanged();
+ ::std::vector<SdrObject*>::iterator aIter = m_aTemporaryObjectList.begin();
+ ::std::vector<SdrObject*>::iterator aEnd = m_aTemporaryObjectList.end();
+
+ for (; aIter != aEnd; ++aIter)
+ {
+ removeTempObject(*aIter);
+ }
+ m_aTemporaryObjectList.clear();
+ rModel.SetChanged(bChanged);
+
+ m_bSpecialInsertMode = false;
+}
+// -----------------------------------------------------------------------------
+void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason)
+{
+ SdrPage::NbcInsertObject(pObj, nPos, pReason);
+
+ OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( pObj );
+ if (getSpecialMode())
+ {
+ m_aTemporaryObjectList.push_back(pObj);
+ return;
+ }
+
+ 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);
+
+ //// check if we are a shape
+ //uno::Reference<beans::XPropertySet> xProp(xShape,uno::UNO_QUERY);
+ //if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) )
+ //{
+ // // use MimeConfigurationHelper::GetStringClassIDRepresentation(MimeConfigurationHelper::GetSequenceClassID(SO3_SCH_OLE_EMBED_CLASSID_8))
+ // xProp->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID")),uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("12dcae26-281f-416f-a234-c3086127382e"))));
+ //}
+
+ // 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..d58fe62e974d
--- /dev/null
+++ b/reportdesign/source/core/sdr/UndoActions.cxx
@@ -0,0 +1,449 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "UndoActions.hxx"
+#include "UndoEnv.hxx"
+#include "formatnormalizer.hxx"
+#include "conditionupdater.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 <svl/smplhint.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/stl_types.hxx>
+#include <vcl/svapp.hxx>
+#include <dbaccess/singledoccontroller.hxx>
+#include <svx/unoshape.hxx>
+#include <vos/mutex.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;
+}
+
+//------------------------------------------------------------------------------
+TYPEINIT1( OCommentUndoAction, SdrUndoAction );
+DBG_NAME(rpt_OCommentUndoAction)
+//----------------------------------------------------------------------------
+OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,USHORT nCommentID)
+ :SdrUndoAction(_rMod)
+{
+ DBG_CTOR(rpt_OCommentUndoAction,NULL);
+ m_pController = static_cast< OReportModel& >( _rMod ).getController();
+ if ( nCommentID )
+ m_strComment = String(ModuleRes(nCommentID));
+}
+OCommentUndoAction::~OCommentUndoAction()
+{
+ DBG_DTOR(rpt_OCommentUndoAction,NULL);
+}
+//----------------------------------------------------------------------------
+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( 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()
+{
+ if ( m_xElement.is() )
+ {
+ // 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()
+{
+ if ( m_xElement.is() )
+ {
+ 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!" );
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+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)
+{
+ Reference< XPropertySet> xObj = getObject();
+
+ if (xObj.is() )
+ {
+ 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(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();
+}
+//============================================================================
+} // rptui
+//============================================================================
+
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
new file mode 100644
index 000000000000..f4dd0a7f8645
--- /dev/null
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -0,0 +1,705 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "UndoActions.hxx"
+#include "UndoEnv.hxx"
+#include "formatnormalizer.hxx"
+#include "conditionupdater.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>
+#include <com/sun/star/beans/XIntrospectionAccess.hpp>
+#include <com/sun/star/beans/XIntrospection.hpp>
+/** === end UNO includes === **/
+
+#include <connectivity/dbtools.hxx>
+#include <svl/smplhint.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <vcl/svapp.hxx>
+#include <dbaccess/singledoccontroller.hxx>
+#include <svx/unoshape.hxx>
+#include <vos/mutex.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;
+//----------------------------------------------------------------------------
+
+
+struct PropertyInfo
+{
+ bool bIsReadonlyOrTransient;
+
+ PropertyInfo()
+ :bIsReadonlyOrTransient( false )
+ {
+ }
+
+ PropertyInfo( const bool i_bIsTransientOrReadOnly )
+ :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly )
+ {
+ }
+};
+
+typedef ::std::hash_map< ::rtl::OUString, PropertyInfo, ::rtl::OUStringHash > PropertiesInfo;
+
+struct ObjectInfo
+{
+ PropertiesInfo aProperties;
+ Reference< XPropertySet > xPropertyIntrospection;
+
+ ObjectInfo()
+ :aProperties()
+ ,xPropertyIntrospection()
+ {
+ }
+};
+
+typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > > PropertySetInfoCache;
+
+// -----------------------------------------------------------------------------
+
+class OXUndoEnvironmentImpl
+{
+ OXUndoEnvironmentImpl(OXUndoEnvironmentImpl&);
+ void operator =(OXUndoEnvironmentImpl&);
+public:
+ OReportModel& m_rModel;
+ PropertySetInfoCache m_aPropertySetCache;
+ FormatNormalizer m_aFormatNormalizer;
+ ConditionUpdater m_aConditionUpdater;
+ ::osl::Mutex m_aMutex;
+ ::std::vector< uno::Reference< container::XChild> > m_aSections;
+ Reference< XIntrospection > m_xIntrospection;
+ oslInterlockedCount m_nLocks;
+ sal_Bool m_bReadOnly;
+ sal_Bool m_bIsUndo;
+
+ OXUndoEnvironmentImpl(OReportModel& _rModel);
+};
+
+OXUndoEnvironmentImpl::OXUndoEnvironmentImpl(OReportModel& _rModel) : m_rModel(_rModel)
+ ,m_aFormatNormalizer( _rModel )
+ ,m_aConditionUpdater()
+ ,m_nLocks(0)
+ ,m_bReadOnly(sal_False)
+ ,m_bIsUndo(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,"Illegal call to dead object!");
+ osl_incrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+void OXUndoEnvironment::UnLock()
+{
+ OSL_ENSURE(m_refCount,"Illegal call to dead object!");
+
+ osl_decrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+sal_Bool OXUndoEnvironment::IsLocked() const { return m_pImpl->m_nLocks != 0; }
+// -----------------------------------------------------------------------------
+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
+ // TODO: LLA->OJ please describe what you are doing in this code fragment.
+ 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.aProperties.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 objectPos = m_pImpl->m_aPropertySetCache.find(xSet);
+ if (objectPos == m_pImpl->m_aPropertySetCache.end())
+ {
+ objectPos = m_pImpl->m_aPropertySetCache.insert( PropertySetInfoCache::value_type(
+ xSet, ObjectInfo()
+ ) ).first;
+ DBG_ASSERT(objectPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?");
+ }
+ if ( objectPos == 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
+ ObjectInfo& rObjectInfo = objectPos->second;
+ PropertiesInfo::iterator aPropertyPos = rObjectInfo.aProperties.find( _rEvent.PropertyName );
+ if ( aPropertyPos == rObjectInfo.aProperties.end() )
+ { // nothing 'til now ... have to change this ....
+ // the attributes
+ Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW );
+ INT32 nPropertyAttributes = 0;
+ try
+ {
+ if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) )
+ {
+ nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes;
+ }
+ else
+ {
+ // it's perfectly valid for a component to notify a change in a property which it doesn't have - as long
+ // as it has an attribute with this name
+ if ( !rObjectInfo.xPropertyIntrospection.is() )
+ {
+ if ( !m_pImpl->m_xIntrospection.is() )
+ {
+ ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() );
+ OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) );
+ }
+ if ( m_pImpl->m_xIntrospection.is() )
+ {
+ Reference< XIntrospectionAccess > xIntrospection(
+ m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ),
+ UNO_SET_THROW
+ );
+ rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW );
+ }
+ }
+ if ( rObjectInfo.xPropertyIntrospection.is() )
+ {
+ xPSI.set( rObjectInfo.xPropertyIntrospection->getPropertySetInfo(), UNO_SET_THROW );
+ nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ const bool bTransReadOnly =
+ ( ( nPropertyAttributes & PropertyAttribute::READONLY ) != 0 )
+ || ( ( nPropertyAttributes & PropertyAttribute::TRANSIENT ) != 0 );
+
+ // insert the new entry
+ aPropertyPos = rObjectInfo.aProperties.insert( PropertiesInfo::value_type(
+ _rEvent.PropertyName,
+ PropertyInfo( bTransReadOnly )
+ ) ).first;
+ DBG_ASSERT(aPropertyPos != rObjectInfo.aProperties.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.bIsReadonlyOrTransient )
+ return;
+
+ // give components with sub responsibilities a chance
+ m_pImpl->m_aFormatNormalizer.notifyPropertyChange( _rEvent );
+ m_pImpl->m_aConditionUpdater.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 )
+{
+ if ( !IsLocked() )
+ 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 );
+}
+
+void OXUndoEnvironment::SetUndoMode(sal_Bool _bUndo)
+{
+ m_pImpl->m_bIsUndo = _bUndo;
+}
+
+sal_Bool OXUndoEnvironment::IsUndoMode() const
+{
+ return m_pImpl->m_bIsUndo;
+}
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx
new file mode 100644
index 000000000000..e4817bbe9f44
--- /dev/null
+++ b/reportdesign/source/core/sdr/formatnormalizer.cxx
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "formatnormalizer.hxx"
+#include "RptModel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+/** === end UNO includes === **/
+
+#include <dbaccess/singledoccontroller.hxx>
+#include <unotools/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;
+ using ::com::sun::star::uno::makeAny;
+ /** === end UNO using === **/
+
+ //====================================================================
+ //= FormatNormalizer
+ //====================================================================
+ DBG_NAME(rpt_FormatNormalizer)
+ //--------------------------------------------------------------------
+ FormatNormalizer::FormatNormalizer( const OReportModel& _rModel )
+ :m_rModel( _rModel )
+ ,m_xReportDefinition( )
+ ,m_bFieldListDirty( true )
+ {
+ DBG_CTOR(rpt_FormatNormalizer,NULL);
+ }
+
+ //--------------------------------------------------------------------
+ FormatNormalizer::~FormatNormalizer()
+ {
+ DBG_DTOR(rpt_FormatNormalizer,NULL);
+ }
+
+ //--------------------------------------------------------------------
+ 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..8577d276d4c8
--- /dev/null
+++ b/reportdesign/source/core/sdr/formatnormalizer.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef REPORTDESIGN_FORMATNORMALIZER_HXX
+#define REPORTDESIGN_FORMATNORMALIZER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+/** === 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..5121b498b68d
--- /dev/null
+++ b/reportdesign/source/core/sdr/makefile.mk
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+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)$/UndoEnv.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..cd709789ca2c
--- /dev/null
+++ b/reportdesign/source/filter/xml/dbloader2.cxx
@@ -0,0 +1,125 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "dbloader2.hxx"
+#include <comphelper/sequence.hxx>
+// -------------------------------------------------------------------------
+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..4df384584eb0
--- /dev/null
+++ b/reportdesign/source/filter/xml/dbloader2.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTXML_DBLOADER2_HXX
+#define RPTXML_DBLOADER2_HXX
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <tools/urlobj.hxx>
+#include <toolkit/awt/vclxwindow.hxx>
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrameLoader.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#include <com/sun/star/frame/XLoadEventListener.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/container/XSet.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <vcl/svapp.hxx>
+#include <ucbhelper/content.hxx>
+#include <ucbhelper/commandenvironment.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/types.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <osl/file.hxx>
+#include <ucbhelper/contentbroker.hxx>
+#include <sfx2/docfile.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/storagehelper.hxx>
+#include <com/sun/star/task/XJobExecutor.hpp>
+#include <vcl/msgbox.hxx>
+
+// -------------------------------------------------------------------------
+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..41761d7a7822
--- /dev/null
+++ b/reportdesign/source/filter/xml/makefile.mk
@@ -0,0 +1,70 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=rptxml
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+
+# --- Files -------------------------------------
+SLOFILES= $(SLO)$/xmlfilter.obj \
+ $(SLO)$/xmlReport.obj \
+ $(SLO)$/xmlMasterFields.obj \
+ $(SLO)$/xmlGroup.obj \
+ $(SLO)$/xmlHelper.obj \
+ $(SLO)$/xmlSection.obj \
+ $(SLO)$/xmlComponent.obj \
+ $(SLO)$/xmlControlProperty.obj \
+ $(SLO)$/xmlFormattedField.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)$/xmlSubDocument.obj \
+ $(SLO)$/xmlservices.obj \
+ $(SLO)$/xmlImportDocumentHandler.obj \
+ $(SLO)$/xmlExportDocumentHandler.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..f802b3460684
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlAutoStyle.cxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlAutoStyle.hxx"
+#include "xmlHelper.hxx"
+#include "xmlExport.hxx"
+#include <xmloff/families.hxx>
+#include <tools/debug.hxx>
+
+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..a0010cf886ad
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlAutoStyle.hxx
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLAUTOSTYLE_HXX
+#define RPT_XMLAUTOSTYLE_HXX
+
+#include <xmloff/maptype.hxx>
+#include <xmloff/xmlaustp.hxx>
+#include <xmloff/xmltypes.hxx>
+#include <xmloff/xmlprmap.hxx>
+
+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..6e0529a72bf0
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCell.cxx
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlCell.hxx"
+#include "xmlHelper.hxx"
+#include <xmloff/xmluconv.hxx>
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include <tools/debug.hxx>
+#include "xmlStyleImport.hxx"
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include "xmlTable.hxx"
+#include "xmlFormattedField.hxx"
+#include "xmlImage.hxx"
+#include "xmlFixedContent.hxx"
+#include "xmlSubDocument.hxx"
+
+namespace rptxml
+{
+ using namespace ::comphelper;
+ 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 ::rtl::OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,OXMLTable* _pContainer
+ ,OXMLCell* _pCell) :
+ SvXMLImportContext( rImport, nPrfx, _sLocalName )
+ ,m_pContainer(_pContainer)
+ ,m_pCell(_pCell)
+ ,m_nCurrentCount(0)
+ ,m_bContainsShape(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)
+ {
+ ::rtl::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_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 ::rtl::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(" & "));
+
+ const 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 );
+ if ( !m_bContainsShape )
+ m_nCurrentCount = m_pContainer->getSection()->getCount();
+ uno::Reference< uno::XInterface> xInt = xFactor->createInstance(SERVICE_FORMATTEDFIELD);
+ Reference< report::XFormattedField > xControl(xInt,uno::UNO_QUERY);
+ pContext = new OXMLSubDocument( rImport, _nPrefix, _rLocalName,xControl.get(),m_pContainer, this /* give the current cell as parent*/ );
+ }
+ break;
+
+ case XML_TOK_P:
+ pContext = new OXMLCell( rImport, _nPrefix, _rLocalName,xAttrList ,m_pContainer,this);
+ break;
+ case XML_TOK_CUSTOM_SHAPE:
+ case XML_TOK_FRAME:
+ {
+ if ( !m_bContainsShape )
+ m_nCurrentCount = m_pContainer->getSection()->getCount();
+ UniReference< XMLShapeImportHelper > xShapeImportHelper = rImport.GetShapeImport();
+ uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection().get();
+ pContext = xShapeImportHelper->CreateGroupChildContext(rImport,_nPrefix,_rLocalName,xAttrList,xShapes);
+ m_bContainsShape = 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_bContainsShape )
+ {
+ const sal_Int32 nCount = m_pContainer->getSection()->getCount();
+ for (sal_Int32 i = m_nCurrentCount; i < nCount; ++i)
+ {
+ uno::Reference<report::XShape> xShape(m_pContainer->getSection()->getByIndex(i),uno::UNO_QUERY);
+ if ( xShape.is() )
+ m_pContainer->addCell(xShape.get());
+ }
+ }
+ 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(GetOwnImport().isOldFormat(),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;
+ }
+}
+
+void OXMLCell::setContainsShape(bool _bContainsShape)
+{
+ m_bContainsShape = _bContainsShape;
+}
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlCell.hxx b/reportdesign/source/filter/xml/xmlCell.hxx
new file mode 100644
index 000000000000..84c0e54afec3
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCell.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCELL_HXX
+#define RPT_XMLCELL_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XReportComponent.hpp>
+
+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;
+ sal_Int32 m_nCurrentCount;
+ bool m_bContainsShape;
+
+ 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);
+ void setContainsShape(bool _bContainsShapes);
+ };
+// -----------------------------------------------------------------------------
+} // 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..499c142a1385
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlColumn.cxx
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#include <xmloff/xmluconv.hxx>
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlCell.hxx"
+#include <tools/debug.hxx>
+#include "xmlStyleImport.hxx"
+#include "xmlTable.hxx"
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#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 ::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 ::rtl::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)
+ {
+ ::rtl::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_COLUMN_STYLE_NAME:
+ fillStyle(sValue);
+ break;
+ default:
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+OXMLRowColumn::~OXMLRowColumn()
+{
+ DBG_DTOR( rpt_OXMLRowColumn,NULL);
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLRowColumn::CreateChildContext(
+ sal_uInt16 nPrefix,
+ const ::rtl::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..b144ac7db435
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlColumn.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCOLUMN_HXX
+#define RPT_XMLCOLUMN_HXX
+
+#include <xmloff/xmlictxt.hxx>
+
+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..e2f80dc5d240
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlComponent.cxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlComponent.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlHelper.hxx"
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include "xmlStyleImport.hxx"
+#include <ucbhelper/content.hxx>
+#include <tools/debug.hxx>
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/report/XReportControlModel.hpp>
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#include <tools/debug.hxx>
+
+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 );
+ const ::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);
+}
+// -----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlComponent.hxx b/reportdesign/source/filter/xml/xmlComponent.hxx
new file mode 100644
index 000000000000..97374e8955bc
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlComponent.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCOMPONENT_HXX
+#define RPT_XMLCOMPONENT_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+
+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;
+
+ 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..c54a031435fe
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlCondPrtExpr.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlControlProperty.hxx"
+#include "xmlComponent.hxx"
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include <tools/debug.hxx>
+
+namespace rptxml
+{
+ 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 ::rtl::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)
+ {
+ ::rtl::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..b402c535a260
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCONDPRTEXPR_HXX
+#define RPT_XMLCONDPRTEXPR_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+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..115fb3bba2f1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -0,0 +1,360 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlControlProperty.hxx"
+#include <xmloff/xmluconv.hxx>
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include <tools/debug.hxx>
+#include <tools/datetime.hxx>
+#include <unotools/datetime.hxx>
+#include <com/sun/star/util/DateTime.hpp>
+
+#define TYPE_DATE 1
+#define TYPE_TIME 2
+#define TYPE_DATETIME 3
+
+namespace rptxml
+{
+ 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 ::rtl::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)
+ {
+ ::rtl::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_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 ::rtl::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..7d256e033c40
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlControlProperty.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCONTROLPROPERTY_HXX
+#define RPT_XMLCONTROLPROPERTY_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Time.hpp>
+
+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..8f4a9bc2a422
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlEnums.hxx
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLENUMS_HXX
+#define RPT_XMLENUMS_HXX
+
+#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,
+ XML_TOK_DOC_META
+ };
+ 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 ,
+ XML_TOK_REPORT_NAME ,
+ XML_TOK_MASTER_DETAIL_FIELDS ,
+ XML_TOK_SUB_FRAME
+ };
+ 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_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,
+ XML_TOK_FRAME
+ };
+
+ 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
+ ,XML_TOK_CONDITIONAL_PRINT_EXPRESSION
+ };
+ 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_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..2c946d5280da
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -0,0 +1,1672 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlExport.hxx"
+#include "xmlAutoStyle.hxx"
+#include <xmloff/ProgressBarHelper.hxx>
+#include <comphelper/sequence.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/txtimp.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <comphelper/types.hxx>
+#include "xmlEnums.hxx"
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/txtprmap.hxx>
+#include <xmloff/numehelp.hxx>
+#include "xmlHelper.hxx"
+#include "xmlstrings.hrc"
+#include "xmlPropertyHandler.hxx"
+#include <com/sun/star/awt/ImagePosition.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/report/GroupOn.hpp>
+#include <com/sun/star/report/XFixedText.hpp>
+#include <com/sun/star/report/XImageControl.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/report/XFunction.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include "RptDef.hxx"
+// for locking SolarMutex: svapp + mutex
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+
+#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 > ORptMetaExportHelper::create(Reference< XComponentContext > const & xContext)
+ {
+ return static_cast< XServiceInfo* >(new ORptExport(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),EXPORT_META ));
+ }
+ //---------------------------------------------------------------------
+ ::rtl::OUString ORptMetaExportHelper::getImplementationName_Static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLMetaExporter");
+ }
+ //---------------------------------------------------------------------
+ Sequence< ::rtl::OUString > ORptMetaExportHelper::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;
+ }
+
+ //---------------------------------------------------------------------
+
+ 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 );
+ }
+ // RDFa: needed for content and header/footer styles
+ if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
+ {
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_XHTML),GetXMLToken(XML_N_XHTML), XML_NAMESPACE_XHTML );
+ }
+ // GRDDL: to convert RDFa and meta.xml to RDF
+ if( (getExportFlags() & (EXPORT_META|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
+ {
+ _GetNamespaceMap().Add( GetXMLToken(XML_NP_GRDDL),GetXMLToken(XML_N_GRDDL), XML_NAMESPACE_GRDDL );
+ }
+
+ _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);
+ // m_xParaPropMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
+
+ ::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!");
+ exportFunction(xFunction);
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportFunction(const uno::Reference< XFunction>& _xFunction)
+{
+ exportFormula(XML_FORMULA,_xFunction->getFormula());
+ beans::Optional< ::rtl::OUString> aInitial = _xFunction->getInitialFormula();
+ if ( aInitial.IsPresent && aInitial.Value.getLength() )
+ 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<XReportComponent>& _xReportComponet)
+{
+ const uno::Sequence< ::rtl::OUString> aMasterFields = _xReportComponet->getMasterFields();
+ if ( aMasterFields.getLength() )
+ {
+ SvXMLElementExport aElement(*this,XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, sal_True, sal_True);
+ const uno::Sequence< ::rtl::OUString> aDetailFields = _xReportComponet->getDetailFields();
+
+ OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),"not equal length for master 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());
+ exportGroupsExpressionAsFunction(_xReportDefinition->getGroups());
+ //exportMasterDetailFields(_xReportDefinition.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::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());
+ const 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_True, sal_True);
+ 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_True, sal_True);
+ } // 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();
+ const awt::Size aSize = rptui::getStyleProperty<awt::Size>(xReport,PROPERTY_PAPERSIZE);
+ const sal_Int32 nOffset = rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN);
+ const 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)
+{
+ const sal_Int32 nCount = _xProp->getCount();
+ for (sal_Int32 i = 0 ; i< nCount ; ++i)
+ {
+ const Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
+ const 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(),xFormattedField);
+ } // 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 )
+ {
+ XMLNumberFormatAttributesExportHelper aHelper(GetNumberFormatsSupplier(),*this);
+ sal_Bool bIsStandard = sal_False;
+ ::rtl::OUString sEmpty;
+ if ( util::NumberFormat::TEXT == aHelper.GetCellType(nFormatKey,bIsStandard) )
+ aHelper.SetNumberFormatAttributes(sEmpty, sEmpty);
+ else
+ aHelper.SetNumberFormatAttributes(nFormatKey, 0.0,sal_False);
+ }
+ }
+ 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_True,sal_False);
+ Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
+ Reference<XReportComponent> xReportComponent = aColIter->xElement;
+
+ if ( !bShapeHandled )
+ {
+ bShapeHandled = true;
+ exportShapes(_xSection,false);
+ }
+ 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< XImageControl > xImage(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;
+ ::rtl::OUString sTargetLocation = xImage->getImageURL();
+ if ( sTargetLocation.getLength() )
+ {
+ sTargetLocation = GetRelativeReference(sTargetLocation);
+ AddAttribute(XML_NAMESPACE_FORM, XML_IMAGE_DATA,sTargetLocation);
+ }
+ bExportData = sal_True;
+ ::rtl::OUStringBuffer sValue;
+ const SvXMLEnumMapEntry* aXML_ImageScaleEnumMap = OXMLHelper::GetImageScaleOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, xImage->getScaleMode(),aXML_ImageScaleEnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_SCALE, sValue.makeStringAndClear() );
+ }
+ 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 )
+ eToken = XML_FIXED_CONTENT;
+ else if ( eToken == XML_IMAGE )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_PRESERVE_IRI, xImage->getPreserveIRI() ? XML_TRUE : XML_FALSE );
+ }
+
+ //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 && xReportDefinition.is() )
+ {
+ SvXMLElementExport aOfficeElement( *this, XML_NAMESPACE_OFFICE, XML_BODY,sal_True, sal_True );
+ SvXMLElementExport aElem( *this, sal_True,
+ XML_NAMESPACE_OFFICE, XML_REPORT,
+ sal_True, sal_True );
+
+ exportReportAttributes(xReportDefinition);
+ exportReport(xReportDefinition);
+ }
+ else if ( xSection.is() )
+ exportSection(xSection);
+ }
+ }
+ } // if ( aColIter->xElement.is() )
+ else if ( !bShapeHandled )
+ {
+ bShapeHandled = true;
+ exportShapes(_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;
+ if ( _sFormula.equalsAsciiL("rpt:",4) )
+ sFormula = ::rtl::OUString();
+ //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)
+{
+ const ::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 sExpression = xGroup->getExpression();
+ if ( sExpression.getLength() )
+ {
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ sal_Int32 nIndex = sExpression.indexOf('"');
+ while ( nIndex > -1 )
+ {
+ sExpression = sExpression.replaceAt(nIndex,1,s_sQuote);
+ nIndex = sExpression.indexOf('"',nIndex+2);
+ }
+ ::rtl::OUString sFormula(RTL_CONSTASCII_USTRINGPARAM("rpt:HASCHANGED(\""));
+
+ TGroupFunctionMap::iterator aGroupFind = m_aGroupFunctionMap.find(xGroup);
+ if ( aGroupFind != m_aGroupFunctionMap.end() )
+ sExpression = aGroupFind->second->getName();
+ sFormula += sExpression;
+ sFormula += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\")"));
+ sExpression = sFormula;
+ }
+ AddAttribute(XML_NAMESPACE_REPORT, XML_GROUP_EXPRESSION,sExpression);
+ 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,const Reference<XFormattedField>& _xParentFormattedField)
+{
+ const uno::Reference<report::XReportControlFormat> xFormat(_xProp,uno::UNO_QUERY);
+ if ( xFormat.is() )
+ {
+ try
+ {
+ const awt::FontDescriptor aFont = xFormat->getFontDescriptor();
+ OSL_ENSURE(aFont.Name.getLength(),"No Font Name !");
+ GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,aFont.Family,aFont.Pitch,aFont.CharSet );
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ // not interested in
+ }
+ }
+ const 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;
+ // }
+ // }
+ //}
+ const Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY);
+ if ( (_xParentFormattedField.is() || xFormattedField.is()) && !aPropertyStates.empty() )
+ {
+ sal_Int32 nNumberFormat = 0;
+ if ( _xParentFormattedField.is() )
+ nNumberFormat = _xParentFormattedField->getFormatKey();
+ else
+ 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());
+ exportReportAttributes(xProp);
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportReportAttributes(const Reference<XReportDefinition>& _xReport)
+{
+ if ( _xReport.is() )
+ {
+ ::rtl::OUStringBuffer sValue;
+ const SvXMLEnumMapEntry* aXML_CommnadTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
+ if ( SvXMLUnitConverter::convertEnum( sValue, static_cast<sal_uInt16>(_xReport->getCommandType()),aXML_CommnadTypeEnumMap ) )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,sValue.makeStringAndClear());
+
+ ::rtl::OUString sComamnd = _xReport->getCommand();
+ if ( sComamnd.getLength() )
+ AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND, sComamnd);
+
+ ::rtl::OUString sFilter( _xReport->getFilter() );
+ if ( sFilter.getLength() )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_FILTER, sFilter );
+
+ AddAttribute(XML_NAMESPACE_OFFICE, XML_MIMETYPE,_xReport->getMimeType());
+
+ sal_Bool bEscapeProcessing( _xReport->getEscapeProcessing() );
+ if ( !bEscapeProcessing )
+ AddAttribute( XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING, ::xmloff::token::GetXMLToken( XML_FALSE ) );
+
+ ::rtl::OUString sName = _xReport->getCaption();
+ if ( sName.getLength() )
+ AddAttribute(XML_NAMESPACE_OFFICE, XML_CAPTION,sName);
+ sName = _xReport->getName();
+ if ( sName.getLength() )
+ AddAttribute(XML_NAMESPACE_DRAW, XML_NAME,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 );
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ORptExport::implConvertNumber(sal_Int32 _nValue)
+{
+ ::rtl::OUStringBuffer aBuffer;
+ GetMM100UnitConverter().convertNumber(aBuffer, _nValue);
+ 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!");
+
+ 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);
+ if ( Reference<XFormattedField>(_xReportElement,uno::UNO_QUERY).is() )
+ {
+ ::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 );
+ }
+ }
+ 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,bool _bAddParagraph)
+{
+ UniReference< XMLShapeExport > xShapeExport = GetShapeExport();
+ xShapeExport->seekShapes(_xSection.get());
+ const sal_Int32 nCount = _xSection->getCount();
+ ::std::auto_ptr<SvXMLElementExport> pParagraphContent;
+ if ( _bAddParagraph )
+ pParagraphContent.reset(new SvXMLElementExport(*this,XML_NAMESPACE_TEXT, XML_P, sal_True, sal_False));
+
+ 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() )
+ {
+ ::std::auto_ptr<SvXMLElementExport> pSubDocument;
+ uno::Reference< frame::XModel> xModel(xShape->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Model"))),uno::UNO_QUERY);
+ if ( xModel.is() ) // special handling for chart object
+ {
+ pSubDocument.reset(new SvXMLElementExport(*this,XML_NAMESPACE_REPORT, XML_SUB_DOCUMENT, sal_False, sal_False));
+ exportMasterDetailFields(xShape.get());
+ exportReportElement(xShape.get());
+ }
+
+ AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, XML_PARAGRAPH );
+ xShapeExport->exportShape(xShape.get(),SEF_DEFAULT|SEF_EXPORT_NO_WS,&aRefPoint);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups)
+{
+ if ( _xGroups.is() )
+ {
+ uno::Reference< XFunctions> xFunctions = _xGroups->getReportDefinition()->getFunctions();
+ const sal_Int32 nCount = _xGroups->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ uno::Reference< XGroup> xGroup(_xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
+ const ::sal_Int16 nGroupOn = xGroup->getGroupOn();
+ if ( nGroupOn != report::GroupOn::DEFAULT )
+ {
+ uno::Reference< XFunction> xFunction = xFunctions->createFunction();
+ ::rtl::OUString sFunction,sPrefix,sPostfix;
+ ::rtl::OUString sExpression = xGroup->getExpression();
+ ::rtl::OUString sFunctionName;
+ switch(nGroupOn)
+ {
+ case report::GroupOn::PREFIX_CHARACTERS:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LEFT"));
+ sPrefix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";")) + ::rtl::OUString::valueOf(xGroup->getGroupInterval());
+ break;
+ case report::GroupOn::YEAR:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YEAR"));
+ break;
+ case report::GroupOn::QUARTAL:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INT((MONTH"));
+ sPostfix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-1)/3)+1"));
+ sFunctionName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QUARTAL_")) + sExpression;
+ break;
+ case report::GroupOn::MONTH:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MONTH"));
+ break;
+ case report::GroupOn::WEEK:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WEEK"));
+ break;
+ case report::GroupOn::DAY:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DAY"));
+ break;
+ case report::GroupOn::HOUR:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HOUR"));
+ break;
+ case report::GroupOn::MINUTE:
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MINUTE"));
+ break;
+ case report::GroupOn::INTERVAL:
+ {
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INT"));
+ uno::Reference< XFunction> xCountFunction = xFunctions->createFunction();
+ xCountFunction->setInitialFormula(beans::Optional< ::rtl::OUString>(sal_True,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:1"))));
+ ::rtl::OUString sCountName = sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_count_")) + sExpression;
+ xCountFunction->setName(sCountName);
+ xCountFunction->setFormula(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[")) + sCountName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("] + 1")));
+ exportFunction(xCountFunction);
+ sExpression = sCountName;
+ sPrefix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" / ")) + ::rtl::OUString::valueOf(xGroup->getGroupInterval());
+ sFunctionName = sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_")) + sExpression;
+ }
+ break;
+ default:
+ ;
+ }
+ if ( !sFunctionName.getLength() )
+ sFunctionName = sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_")) + sExpression;
+ if ( sFunction.getLength() )
+ {
+ sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
+ for(sal_uInt32 j= 0; j < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++j)
+ sFunctionName = sFunctionName.replace(pReplaceChars[j],'_');
+
+ xFunction->setName(sFunctionName);
+ sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFunction;
+ sFunction += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(["));
+ sFunction += sExpression;
+ sFunction += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));
+
+ if ( sPrefix.getLength() )
+ sFunction += sPrefix;
+ sFunction += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
+ if ( sPostfix.getLength() )
+ sFunction += sPostfix;
+ xFunction->setFormula(sFunction);
+ exportFunction(xFunction);
+ m_aGroupFunctionMap.insert(TGroupFunctionMap::value_type(xGroup,xFunction));
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx
new file mode 100644
index 000000000000..d6c8aea1dcc2
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExport.hxx
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLEXPORT_HXX
+#define RPT_XMLEXPORT_HXX
+
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/report/XReportControlModel.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <osl/diagnose.h>
+#include <unotools/tempfile.hxx>
+#include <unotools/localfilehelper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <xmloff/xmlexp.hxx>
+#include <xmloff/xmlimp.hxx>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <memory>
+
+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::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;
+ typedef ::std::map< Reference<XGroup> ,Reference<XFunction> > TGroupFunctionMap;
+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;
+ TGroupFunctionMap m_aGroupFunctionMap;
+
+ ::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 exportReportAttributes(const Reference<XReportDefinition>& _xReport);
+ void exportFunctions(const Reference<XIndexAccess>& _xFunctions); /// <ref name="rpt-function"/>
+ void exportFunction(const Reference< XFunction>& _xFunction);
+ void exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponet);
+ void exportComponent(const Reference<XReportComponent>& _xReportComponent);
+ 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,bool _bAddParagraph = true);
+ 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,const Reference<XFormattedField>& _xParentFormattedField = Reference<XFormattedField>());
+ 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);
+ void exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups);
+ ::rtl::OUString convertFormula(const ::rtl::OUString& _sFormula);
+
+ ::rtl::OUString implConvertNumber(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 ~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 only meta data
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptMetaExportHelper
+{
+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/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
new file mode 100644
index 000000000000..be664b5694e1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -0,0 +1,455 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlExportDocumentHandler.hxx"
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <comphelper/sequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <xmloff/attrlist.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlement.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <unotools/saveopt.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <connectivity/dbtools.hxx>
+#include <rtl/ustrbuf.hxx>
+
+namespace rptxml
+{
+using namespace ::com::sun::star;
+using namespace ::xmloff::token;
+
+void lcl_exportPrettyPrinting(const uno::Reference< xml::sax::XDocumentHandler >& _xDelegatee)
+{
+ SvtSaveOptions aSaveOpt;
+ if ( aSaveOpt.IsPrettyPrinting() )
+ {
+ static const ::rtl::OUString s_sWhitespaces(RTL_CONSTASCII_USTRINGPARAM(" "));
+ _xDelegatee->ignorableWhitespace(s_sWhitespaces);
+ }
+}
+
+::rtl::OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute)
+{
+ ::rtl::OUStringBuffer sQName;
+ // ...if it's in our map, make the prefix
+ sQName.append ( xmloff::token::GetXMLToken(_eNamespace) );
+ sQName.append ( sal_Unicode(':') );
+ sQName.append ( xmloff::token::GetXMLToken(_eAttribute) );
+ return sQName.makeStringAndClear();
+}
+
+void lcl_correctCellAddress(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs)
+{
+ SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs);
+ ::rtl::OUString sCellAddress = pList->getValueByName(_sName);
+ const sal_Int32 nPos = sCellAddress.lastIndexOf('$');
+ if ( nPos != -1 )
+ {
+ sCellAddress = sCellAddress.copy(0,nPos);
+ sCellAddress += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$65535"));
+ pList->RemoveAttribute(_sName);
+ pList->AddAttribute(_sName,sCellAddress);
+ }
+}
+
+ExportDocumentHandler::ExportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) :
+ m_xContext(context)
+ ,m_nCurrentCellIndex(0)
+ ,m_nColumnCount(0)
+ ,m_bTableRowsStarted(false)
+ ,m_bFirstRowExported(false)
+ ,m_bExportChar(false)
+ ,m_bCountColumnHeader(false)
+{
+}
+// -----------------------------------------------------------------------------
+ExportDocumentHandler::~ExportDocumentHandler()
+{
+ if ( m_xProxy.is() )
+ {
+ m_xProxy->setDelegator( NULL );
+ m_xProxy.clear();
+ }
+}
+IMPLEMENT_GET_IMPLEMENTATION_ID(ExportDocumentHandler)
+IMPLEMENT_FORWARD_REFCOUNT( ExportDocumentHandler, ExportDocumentHandler_BASE )
+//------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ExportDocumentHandler::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------
+sal_Bool SAL_CALL ExportDocumentHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL ExportDocumentHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported;
+ if ( m_xServiceInfo.is() )
+ aSupported = m_xServiceInfo->getSupportedServiceNames();
+ return ::comphelper::concatSequences(getSupportedServiceNames_static(),aSupported);
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString ExportDocumentHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.ExportDocumentHandler"));
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > ExportDocumentHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ExportDocumentHandler"));
+ return aSupported;
+}
+
+//------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL ExportDocumentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
+{
+ return *(new ExportDocumentHandler( _rxContext ));
+}
+// xml::sax::XDocumentHandler:
+void SAL_CALL ExportDocumentHandler::startDocument() throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->startDocument();
+}
+
+void SAL_CALL ExportDocumentHandler::endDocument() throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->endDocument();
+}
+
+void SAL_CALL ExportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ bool bExport = true;
+ if ( _sName.equalsAscii("office:chart") )
+ {
+ SvXMLAttributeList* pList = new SvXMLAttributeList();
+ uno::Reference< xml::sax::XAttributeList > xNewAttribs = pList;
+ ::rtl::OUStringBuffer sValue;
+ static SvXMLEnumMapEntry aXML_CommnadTypeEnumMap[] =
+ {
+ { XML_TABLE, sdb::CommandType::TABLE },
+ { XML_QUERY, sdb::CommandType::QUERY },
+ // { XML_COMMAND, CommandType::COMMAND }, // default
+ { XML_TOKEN_INVALID, 0 }
+ };
+ if ( SvXMLUnitConverter::convertEnum( sValue, static_cast<sal_uInt16>(m_xDatabaseDataProvider->getCommandType()),aXML_CommnadTypeEnumMap ) )
+ {
+ pList->AddAttribute(lcl_createAttribute(XML_NP_RPT,XML_COMMAND_TYPE),sValue.makeStringAndClear());
+ }
+ const ::rtl::OUString sComamnd = m_xDatabaseDataProvider->getCommand();
+ if ( sComamnd.getLength() )
+ pList->AddAttribute(lcl_createAttribute(XML_NP_RPT,XML_COMMAND),sComamnd);
+
+ const ::rtl::OUString sFilter( m_xDatabaseDataProvider->getFilter() );
+ if ( sFilter.getLength() )
+ pList->AddAttribute(lcl_createAttribute(XML_NP_RPT,XML_FILTER),sFilter);
+
+ const sal_Bool bEscapeProcessing( m_xDatabaseDataProvider->getEscapeProcessing() );
+ if ( !bEscapeProcessing )
+ pList->AddAttribute(lcl_createAttribute(XML_NP_RPT,XML_ESCAPE_PROCESSING),::xmloff::token::GetXMLToken( XML_FALSE ));
+
+ pList->AddAttribute(lcl_createAttribute(XML_NP_OFFICE,XML_MIMETYPE),MIMETYPE_OASIS_OPENDOCUMENT_CHART);
+
+ m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_REPORT),xNewAttribs);
+
+ const ::rtl::OUString sTableCalc = lcl_createAttribute(XML_NP_TABLE,XML_CALCULATION_SETTINGS);
+ m_xDelegatee->startElement(sTableCalc,NULL);
+ pList = new SvXMLAttributeList();
+ uno::Reference< xml::sax::XAttributeList > xNullAttr = pList;
+ pList->AddAttribute(lcl_createAttribute(XML_NP_TABLE,XML_DATE_VALUE),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1900-01-01")));
+
+ const ::rtl::OUString sNullDate = lcl_createAttribute(XML_NP_TABLE,XML_NULL_DATE);
+ m_xDelegatee->startElement(sNullDate,xNullAttr);
+ m_xDelegatee->endElement(sNullDate);
+ m_xDelegatee->endElement(sTableCalc);
+ bExport = false;
+ }
+ else if ( _sName.equalsAscii("table:table") )
+ {
+ m_xDelegatee->startElement(lcl_createAttribute(XML_NP_RPT,XML_DETAIL),NULL);
+ lcl_exportPrettyPrinting(m_xDelegatee);
+ }
+ else if ( _sName.equalsAscii("table:table-header-rows") )
+ {
+ m_bCountColumnHeader = true;
+ }
+ else if ( m_bCountColumnHeader && _sName.equalsAscii("table:table-cell") )
+ {
+ ++m_nColumnCount;
+ }
+ else if ( _sName.equalsAscii("table:table-rows") )
+ {
+ m_xDelegatee->startElement(_sName,xAttribs);
+ exportTableRows();
+ bExport = false;
+ m_bTableRowsStarted = true;
+ m_bFirstRowExported = true;
+ }
+ else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAscii("table:table-row") || _sName.equalsAscii("table:table-cell")) )
+ bExport = false;
+ else if ( _sName.equalsAscii("chart:plot-area"))
+ {
+ SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs);
+ pList->RemoveAttribute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("table:cell-range-address")));
+ }
+ else if ( _sName.equalsAscii("chart:categories"))
+ {
+ static ::rtl::OUString s_sCellAddress(lcl_createAttribute(XML_NP_TABLE,XML_CELL_RANGE_ADDRESS));
+ lcl_correctCellAddress(s_sCellAddress,xAttribs);
+ }
+ else if ( _sName.equalsAscii("chart:series"))
+ {
+ static ::rtl::OUString s_sCellAddress(lcl_createAttribute(XML_NP_CHART,XML_VALUES_CELL_RANGE_ADDRESS));
+ lcl_correctCellAddress(s_sCellAddress,xAttribs);
+ }
+ else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName.equalsAscii("table:table-cell") )
+ {
+ SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs);
+ static ::rtl::OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE));
+ pList->RemoveAttribute(s_sValue);
+ }
+ else if ( m_bTableRowsStarted && _sName.equalsAscii("text:p") )
+ {
+ bExport = false;
+ }
+ if ( bExport )
+ m_xDelegatee->startElement(_sName,xAttribs);
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL ExportDocumentHandler::endElement(const ::rtl::OUString & _sName) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ bool bExport = true;
+ ::rtl::OUString sNewName = _sName;
+ if ( _sName.equalsAscii("office:chart") )
+ {
+ sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_REPORT);
+ }
+ else if ( _sName.equalsAscii("table:table") )
+ {
+ m_xDelegatee->endElement(_sName);
+ lcl_exportPrettyPrinting(m_xDelegatee);
+ sNewName = lcl_createAttribute(XML_NP_RPT,XML_DETAIL);
+ }
+ else if ( _sName.equalsAscii("table:table-header-rows") )
+ {
+ m_bCountColumnHeader = false;
+ }
+ else if ( _sName.equalsAscii("table:table-rows") )
+ m_bTableRowsStarted = false;
+ else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAscii("table:table-row") || _sName.equalsAscii("table:table-cell")) )
+ bExport = false;
+ else if ( m_bTableRowsStarted && _sName.equalsAscii("table:table-row") )
+ m_bFirstRowExported = true;
+ else if ( m_bTableRowsStarted && _sName.equalsAscii("text:p") )
+ {
+ bExport = !m_bFirstRowExported;
+ }
+
+ if ( bExport )
+ m_xDelegatee->endElement(sNewName);
+}
+
+void SAL_CALL ExportDocumentHandler::characters(const ::rtl::OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ if ( !(m_bTableRowsStarted || m_bFirstRowExported) )
+ {
+ m_xDelegatee->characters(aChars);
+ }
+ else if ( m_bExportChar )
+ {
+ static const ::rtl::OUString s_sZero(RTL_CONSTASCII_USTRINGPARAM("0"));
+ m_xDelegatee->characters(s_sZero);
+ }
+}
+
+void SAL_CALL ExportDocumentHandler::ignorableWhitespace(const ::rtl::OUString & aWhitespaces) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->ignorableWhitespace(aWhitespaces);
+}
+
+void SAL_CALL ExportDocumentHandler::processingInstruction(const ::rtl::OUString & aTarget, const ::rtl::OUString & aData) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->processingInstruction(aTarget,aData);
+}
+
+void SAL_CALL ExportDocumentHandler::setDocumentLocator(const uno::Reference< xml::sax::XLocator > & xLocator) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->setDocumentLocator(xLocator);
+}
+void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >& _aArguments ) throw (uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ comphelper::SequenceAsHashMap aArgs(_aArguments);
+ m_xDelegatee = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler")),m_xDelegatee);
+ m_xModel = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Model")),m_xModel);
+
+ OSL_ENSURE(m_xDelegatee.is(),"No document handler avialable!");
+ if ( !m_xDelegatee.is() || !m_xModel.is() )
+ throw uno::Exception();
+
+ m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY);
+ if ( !m_xDatabaseDataProvider.is() || !m_xDatabaseDataProvider->getActiveConnection().is() )
+ throw uno::Exception();
+
+ uno::Reference< reflection::XProxyFactory > xProxyFactory( m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory")),m_xContext),
+ uno::UNO_QUERY);
+ m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
+ ::comphelper::query_aggregation(m_xProxy,m_xDelegatee);
+ m_xTypeProvider.set(m_xDelegatee,uno::UNO_QUERY);
+ m_xServiceInfo.set(m_xDelegatee,uno::UNO_QUERY);
+
+ // set ourself as delegator
+ m_xProxy->setDelegator( *this );
+ const ::rtl::OUString sCommand = m_xDatabaseDataProvider->getCommand();
+ if ( sCommand.getLength() )
+ m_aColumns = ::dbtools::getFieldNamesByCommandDescriptor(m_xDatabaseDataProvider->getActiveConnection()
+ ,m_xDatabaseDataProvider->getCommandType()
+ ,sCommand);
+
+ uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xDatabaseDataProvider,uno::UNO_QUERY);
+ if ( xDataProvider.is() )
+ {
+ m_aColumns.realloc(1);
+ uno::Sequence< ::rtl::OUString > aColumnNames = xDataProvider->getColumnDescriptions();
+ for(sal_Int32 i = 0 ; i < aColumnNames.getLength();++i)
+ {
+ if ( aColumnNames[i].getLength() )
+ {
+ sal_Int32 nCount = m_aColumns.getLength();
+ m_aColumns.realloc(nCount+1);
+ m_aColumns[nCount] = aColumnNames[i];
+ }
+ }
+ }
+}
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL ExportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ExportDocumentHandler_BASE::queryInterface(_rType);
+ return aReturn.hasValue() ? aReturn : (m_xProxy.is() ? m_xProxy->queryAggregation(_rType) : aReturn);
+}
+// --------------------------------------------------------------------------------
+uno::Sequence< uno::Type > SAL_CALL ExportDocumentHandler::getTypes( ) throw (uno::RuntimeException)
+{
+ if ( m_xTypeProvider.is() )
+ return ::comphelper::concatSequences(
+ ExportDocumentHandler_BASE::getTypes(),
+ m_xTypeProvider->getTypes()
+ );
+ return ExportDocumentHandler_BASE::getTypes();
+}
+// -----------------------------------------------------------------------------
+void ExportDocumentHandler::exportTableRows()
+{
+ const ::rtl::OUString sRow( lcl_createAttribute(XML_NP_TABLE, XML_TABLE_ROW) );
+ m_xDelegatee->startElement(sRow,NULL);
+
+ const ::rtl::OUString sValueType( lcl_createAttribute(XML_NP_OFFICE, XML_VALUE_TYPE) );
+
+ const static ::rtl::OUString s_sFieldPrefix(RTL_CONSTASCII_USTRINGPARAM("field:["));
+ const static ::rtl::OUString s_sFieldPostfix(RTL_CONSTASCII_USTRINGPARAM("]"));
+ const ::rtl::OUString sCell( lcl_createAttribute(XML_NP_TABLE, XML_TABLE_CELL) );
+ const ::rtl::OUString sP( lcl_createAttribute(XML_NP_TEXT, XML_P) );
+ const ::rtl::OUString sFtext(lcl_createAttribute(XML_NP_RPT,XML_FORMATTED_TEXT) );
+ const ::rtl::OUString sRElement(lcl_createAttribute(XML_NP_RPT,XML_REPORT_ELEMENT) );
+ const ::rtl::OUString sRComponent( lcl_createAttribute(XML_NP_RPT,XML_REPORT_COMPONENT) ) ;
+ const ::rtl::OUString sFormulaAttrib( lcl_createAttribute(XML_NP_RPT,XML_FORMULA) );
+ const static ::rtl::OUString s_sString(RTL_CONSTASCII_USTRINGPARAM("string"));
+ const static ::rtl::OUString s_sFloat(RTL_CONSTASCII_USTRINGPARAM("float"));
+
+ SvXMLAttributeList* pCellAtt = new SvXMLAttributeList();
+ uno::Reference< xml::sax::XAttributeList > xCellAtt = pCellAtt;
+ pCellAtt->AddAttribute(sValueType,s_sString);
+
+ bool bRemoveString = true;
+ ::rtl::OUString sFormula;
+ const sal_Int32 nCount = m_aColumns.getLength();
+ if ( m_nColumnCount > nCount )
+ {
+ const sal_Int32 nEmptyCellCount = m_nColumnCount - nCount;
+ for(sal_Int32 i = 0; i < nEmptyCellCount ; ++i)
+ {
+ m_xDelegatee->startElement(sCell,xCellAtt);
+ if ( bRemoveString )
+ {
+ bRemoveString = false;
+ pCellAtt->RemoveAttribute(sValueType);
+ pCellAtt->AddAttribute(sValueType,s_sFloat);
+ } // if ( i == 0 )
+ m_xDelegatee->startElement(sP,NULL);
+ m_xDelegatee->endElement(sP);
+ m_xDelegatee->endElement(sCell);
+ }
+ }
+ for(sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ sFormula = s_sFieldPrefix;
+ sFormula += m_aColumns[i];
+ sFormula += s_sFieldPostfix;
+ SvXMLAttributeList* pList = new SvXMLAttributeList();
+ uno::Reference< xml::sax::XAttributeList > xAttribs = pList;
+ pList->AddAttribute(sFormulaAttrib,sFormula);
+
+ m_xDelegatee->startElement(sCell,xCellAtt);
+ if ( bRemoveString )
+ {
+ bRemoveString = false;
+ pCellAtt->RemoveAttribute(sValueType);
+ pCellAtt->AddAttribute(sValueType,s_sFloat);
+ }
+ m_xDelegatee->startElement(sP,NULL);
+ m_xDelegatee->startElement(sFtext,xAttribs);
+ m_xDelegatee->startElement(sRElement,NULL);
+ m_xDelegatee->startElement(sRComponent,NULL);
+
+ m_xDelegatee->endElement(sRComponent);
+ m_xDelegatee->endElement(sRElement);
+ m_xDelegatee->endElement(sFtext);
+ m_xDelegatee->endElement(sP);
+ m_xDelegatee->endElement(sCell);
+ } // for(sal_Int32 i = 0; i < nCount ; ++i)
+
+ m_xDelegatee->endElement(sRow);
+}
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx
new file mode 100644
index 000000000000..9fa0f1b939d9
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_EXPORTDOCUMENTHANDLER_HXX_INCLUDED
+#define RPT_EXPORTDOCUMENTHANDLER_HXX_INCLUDED
+
+#include "sal/config.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include <cppuhelper/implbase3.hxx>
+#include "com/sun/star/xml/sax/XDocumentHandler.hpp"
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp"
+#include <comphelper/uno3.hxx>
+
+namespace rptxml
+{
+typedef ::cppu::WeakAggImplHelper3< ::com::sun::star::xml::sax::XDocumentHandler
+ , ::com::sun::star::lang::XInitialization
+ , ::com::sun::star::lang::XServiceInfo> ExportDocumentHandler_BASE;
+
+class ExportDocumentHandler : public ExportDocumentHandler_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 ExportDocumentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
+
+private:
+ // 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);
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // ::com::sun::star::xml::sax::XDocumentHandler:
+ virtual void SAL_CALL startDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL startElement(const ::rtl::OUString & aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endElement(const ::rtl::OUString & aName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL characters(const ::rtl::OUString & aChars) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString & aWhitespaces) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL processingInstruction(const ::rtl::OUString & aTarget, const ::rtl::OUString & aData) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+
+ 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);
+
+ void exportTableRows();
+private:
+ ExportDocumentHandler(ExportDocumentHandler &); // not defined
+ void operator =(ExportDocumentHandler &); // not defined
+
+ virtual ~ExportDocumentHandler();
+
+ ::osl::Mutex m_aMutex;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xDelegatee;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxy;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xTypeProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > m_xServiceInfo;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aColumns;
+ sal_Int32 m_nCurrentCellIndex;
+ sal_Int32 m_nColumnCount;
+ bool m_bTableRowsStarted;
+ bool m_bFirstRowExported;
+ bool m_bExportChar;
+ bool m_bCountColumnHeader;
+};
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_EXPORTDOCUMENTHANDLER_HXX_INCLUDED
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx
new file mode 100644
index 000000000000..5c19db5c44d7
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlFixedContent.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlReportElement.hxx"
+#include <tools/debug.hxx>
+#include <com/sun/star/report/XShape.hpp>
+#include "xmlCell.hxx"
+#include "xmlstrings.hrc"
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/report/XFixedText.hpp>
+#include <com/sun/star/text/ControlCharacter.hpp>
+#include "xmlTable.hxx"
+#include <xmloff/XMLCharContext.hxx>
+
+namespace rptxml
+{
+ 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 ::rtl::OUString& rLName
+ ,OXMLCell& _rCell
+ ,OXMLTable* _pContainer
+ ,OXMLFixedContent* _pInP) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,NULL,_pContainer)
+,m_rCell(_rCell)
+,m_pInP(_pInP)
+,m_bFormattedField(false)
+{
+ DBG_CTOR( rpt_OXMLFixedContent,NULL);
+}
+// -----------------------------------------------------------------------------
+
+OXMLFixedContent::~OXMLFixedContent()
+{
+
+ DBG_DTOR( rpt_OXMLFixedContent,NULL);
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLFixedContent::_CreateChildContext(
+ sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = OXMLReportElementBase::_CreateChildContext(nPrefix,rLocalName,xAttrList);
+ if ( pContext )
+ return pContext;
+
+ static const ::rtl::OUString s_sStringConcat(RTL_CONSTASCII_USTRINGPARAM(" & "));
+ const SvXMLTokenMap& rTokenMap = m_rImport.GetCellElemTokenMap();
+ Reference<XMultiServiceFactory> xFactor = m_rImport.getServiceFactory();
+
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ const sal_uInt16 nToken = rTokenMap.Get( nPrefix, rLocalName );
+ switch( nToken )
+ {
+ case XML_TOK_P:
+ pContext = new OXMLFixedContent(m_rImport,nPrefix, rLocalName,m_rCell,m_pContainer,this);
+ 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;
+ case XML_TOK_PAGE_NUMBER:
+ m_sPageText += s_sStringConcat + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PageNumber()"));
+ m_bFormattedField = true;
+ break;
+ case XML_TOK_PAGE_COUNT:
+ m_sPageText += s_sStringConcat + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PageCount()"));
+ m_bFormattedField = true;
+ break;
+ default:
+ ;
+ }
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLFixedContent::EndElement()
+{
+ if ( m_pInP )
+ {
+ const Reference<XMultiServiceFactory> xFactor(m_rImport.GetModel(),uno::UNO_QUERY);
+ if ( m_bFormattedField )
+ {
+ 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_sPageText);
+ OSL_ENSURE(xControl.is(),"Could not create FormattedField!");
+ m_pInP->m_xComponent = xControl.get();
+ m_xComponent = xControl.get();
+ }
+ else
+ {
+ Reference< XFixedText > xControl(xFactor->createInstance(SERVICE_FIXEDTEXT),uno::UNO_QUERY);
+ OSL_ENSURE(xControl.is(),"Could not create FixedContent!");
+ m_pInP->m_xComponent = xControl.get();
+ m_xComponent = xControl.get();
+ xControl->setLabel(m_sLabel);
+ }
+
+ m_pContainer->addCell(m_xComponent);
+ m_rCell.setComponent(m_xComponent);
+
+ OXMLReportElementBase::EndElement();
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLFixedContent::Characters( const ::rtl::OUString& rChars )
+{
+ m_sLabel += rChars;
+ if ( rChars.getLength() )
+ {
+ static const ::rtl::OUString s_Quote(RTL_CONSTASCII_USTRINGPARAM("\""));
+ if ( m_sPageText.getLength() )
+ {
+ static const ::rtl::OUString s_sStringConcat(RTL_CONSTASCII_USTRINGPARAM(" & "));
+ m_sPageText += s_sStringConcat;
+ }
+
+ m_sPageText += s_Quote + rChars + s_Quote;
+ }
+}
+
+//----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlFixedContent.hxx b/reportdesign/source/filter/xml/xmlFixedContent.hxx
new file mode 100644
index 000000000000..0637e01ef674
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFixedContent.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLFIXEDCONTENT_HXX
+#define RPT_XMLFIXEDCONTENT_HXX
+
+#include "xmlReportElementBase.hxx"
+#include <com/sun/star/drawing/XShapes.hpp>
+
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLCell;
+ class OXMLFixedContent : public OXMLReportElementBase
+ {
+ ::rtl::OUString m_sPageText; // page count and page number
+ ::rtl::OUString m_sLabel;
+ OXMLCell& m_rCell;
+ OXMLFixedContent* m_pInP; // if set than we are in text-p element
+ bool m_bFormattedField;
+
+ 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
+ ,OXMLFixedContent* _pInP = NULL);
+ 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..d9261ea72dd1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.cxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlFormatCondition.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "xmlEnums.hxx"
+#include "xmlHelper.hxx"
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#include <comphelper/genericpropertyset.hxx>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef RPT_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include "xmlStyleImport.hxx"
+#include <tools/debug.hxx>
+
+namespace rptxml
+{
+ 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 ::rtl::OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XFormatCondition > & _xComponent ) :
+ SvXMLImportContext( rImport, nPrfx, rLName )
+,m_rImport(rImport)
+,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)
+ {
+ ::rtl::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_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);
+}
+// -----------------------------------------------------------------------------
+void OXMLFormatCondition::EndElement()
+{
+ OXMLHelper::copyStyleElements(m_rImport.isOldFormat(),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..ed151240ecaa
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormatCondition.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLFORMATCONDITION_HXX
+#define RPT_XMLFORMATCONDITION_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XFormatCondition.hpp>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLFormatCondition : public SvXMLImportContext
+ {
+ ORptFilter& m_rImport;
+ ::rtl::OUString m_sStyleName;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition > m_xComponent;
+ 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..210d4bd7409b
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlFormattedField.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlControlProperty.hxx"
+#include "xmlHelper.hxx"
+#include <xmloff/xmluconv.hxx>
+#include "xmlReportElement.hxx"
+#include "xmlComponent.hxx"
+#include <tools/debug.hxx>
+
+
+namespace rptxml
+{
+ using namespace ::com::sun::star;
+ using namespace xml::sax;
+DBG_NAME( rpt_OXMLFormattedField )
+
+OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const ::rtl::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)
+ {
+ ::rtl::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_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..1d4ddae5629d
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFormattedField.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLFORMATTEDFIELD_HXX
+#define RPT_XMLFORMATTEDFIELD_HXX
+
+#include "xmlReportElementBase.hxx"
+#include <com/sun/star/report/XFormattedField.hpp>
+
+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..02771159f0db
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFunction.cxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlFunction.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlHelper.hxx"
+#include "xmlEnums.hxx"
+#include "xmlstrings.hrc"
+#include <tools/debug.hxx>
+
+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;
+
+DBG_NAME( rpt_OXMLFunction )
+
+OXMLFunction::OXMLFunction( ORptFilter& _rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& _sLocalName
+ ,const Reference< XAttributeList > & _xAttrList
+ ,const Reference< XFunctionsSupplier >& _xFunctions
+ ,bool _bAddToReport
+ ) :
+ SvXMLImportContext( _rImport, nPrfx, _sLocalName )
+ ,m_xFunctions(_xFunctions->getFunctions())
+ ,m_bAddToReport(_bAddToReport)
+{
+ 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)
+ {
+ ::rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_uInt16 nPrefix = rMap.GetKeyByAttrName( sAttrName,&sLocalName );
+ const 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:
+ if ( sValue.getLength() )
+ 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()
+{
+ if ( m_bAddToReport )
+ {
+ GetOwnImport().insertFunction(m_xFunction);
+ m_xFunction.clear();
+ }
+ else
+ {
+ 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..017965e608a7
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlFunction.hxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLFUNCTION_HXX
+#define RPT_XMLFUNCTION_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/report/XFunctionsSupplier.hpp>
+#include <com/sun/star/report/XFunctions.hpp>
+
+
+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;
+ bool m_bAddToReport;
+
+ 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
+ ,bool _bAddToReport = false
+ );
+ 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..26d1b7f61252
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -0,0 +1,279 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlGroup.hxx"
+#include "xmlSection.hxx"
+#include "xmlFunction.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "xmlHelper.hxx"
+#include "xmlEnums.hxx"
+#include <ucbhelper/content.hxx>
+#include <comphelper/namecontainer.hxx>
+#include <com/sun/star/report/GroupOn.hpp>
+#include <com/sun/star/report/KeepTogether.hpp>
+#include <tools/debug.hxx>
+
+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();
+ m_xGroup->setSortAscending(sal_False);// the default value has to be set
+ 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();
+ static ::rtl::OUString s_sQuote(RTL_CONSTASCII_USTRINGPARAM("\"\""));
+ static ::rtl::OUString s_sSingleQuote(RTL_CONSTASCII_USTRINGPARAM("\""));
+ sal_Int32 nIndex = sValue.indexOf(s_sQuote,nPos);
+ while ( nIndex > -1 )
+ {
+ sValue = sValue.replaceAt(nIndex,2,s_sSingleQuote);
+ nIndex = sValue.indexOf(s_sQuote,nIndex+2);
+ }
+ nLen = sValue.getLength() - 1;
+ }
+ sValue = sValue.copy(nPos,nLen-nPos-1);
+ const ORptFilter::TGroupFunctionMap& aFunctions = _rImport.getFunctions();
+ ORptFilter::TGroupFunctionMap::const_iterator aFind = aFunctions.find(sValue);
+ if ( aFind != aFunctions.end() )
+ {
+ sal_Int32 nIndex = 0;
+ const ::rtl::OUString sCompleteFormula = aFind->second->getFormula();
+ ::rtl::OUString sExpression = sCompleteFormula.getToken(1,'[',nIndex);
+ nIndex = 0;
+ sExpression = sExpression.getToken(0,']',nIndex);
+ nIndex = 0;
+ const ::rtl::OUString sFormula = sCompleteFormula.getToken(0,'(',nIndex);
+ ::sal_Int16 nGroupOn = report::GroupOn::DEFAULT;
+
+ if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:LEFT")))
+ {
+ nGroupOn = report::GroupOn::PREFIX_CHARACTERS;
+ ::rtl::OUString sInterval = sCompleteFormula.getToken(1,';',nIndex);
+ nIndex = 0;
+ sInterval = sInterval.getToken(0,')',nIndex);
+ m_xGroup->setGroupInterval(sInterval.toInt32());
+ }
+ else if ( sFormula == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:YEAR")))
+ nGroupOn = report::GroupOn::YEAR;
+ else if ( sFormula == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:MONTH")))
+ {
+ nGroupOn = report::GroupOn::MONTH;
+ }
+ else if ( sCompleteFormula.matchIgnoreAsciiCase(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:INT((MONTH")),0)
+ && sCompleteFormula.endsWithIgnoreAsciiCaseAsciiL("-1)/3)+1",8) )
+ {
+ nGroupOn = report::GroupOn::QUARTAL;
+ }
+ else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:WEEK")))
+ nGroupOn = report::GroupOn::WEEK;
+ else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:DAY")))
+ nGroupOn = report::GroupOn::DAY;
+ else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:HOUR")))
+ nGroupOn = report::GroupOn::HOUR;
+ else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:MINUTE")))
+ nGroupOn = report::GroupOn::MINUTE;
+ else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:INT")))
+ {
+ nGroupOn = report::GroupOn::INTERVAL;
+ _rImport.removeFunction(sExpression);
+ sExpression = sExpression.copy(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INT_count_")).getLength());
+
+ nIndex = 0;
+ ::rtl::OUString sInterval = sCompleteFormula.getToken(1,'/',nIndex);
+ nIndex = 0;
+ sInterval = sInterval.getToken(0,')',nIndex);
+ m_xGroup->setGroupInterval(sInterval.toInt32());
+ }
+
+ m_xGroup->setGroupOn(nGroupOn);
+
+ _rImport.removeFunction(sValue);
+ sValue = sExpression;
+ }
+ 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..03ae2dbbc7c0
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlGroup.hxx
@@ -0,0 +1,66 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLGROUP_HXX
+#define RPT_XMLGROUP_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/report/XGroups.hpp>
+
+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..0409ca67a067
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlHelper.cxx
@@ -0,0 +1,418 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlHelper.hxx"
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/families.hxx>
+#include <xmloff/controlpropertyhdl.hxx>
+#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>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/awt/ImagePosition.hpp>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+#include <xmloff/prstylei.hxx>
+#include "xmlstrings.hrc"
+#include "xmlEnums.hxx"
+#include <xmloff/contextid.hxx>
+#include <xmloff/txtprmap.hxx>
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#include <xmloff/XMLConstantsPropertyHandler.hxx>
+#include <com/sun/star/report/ForceNewPage.hpp>
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#include <com/sun/star/report/GroupOn.hpp>
+#include <com/sun/star/report/KeepTogether.hpp>
+#include <xmloff/xmlement.hxx>
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#include <com/sun/star/form/ListSourceType.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <xmloff/EnumPropertyHdl.hxx>
+
+#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;
+DBG_NAME(rpt_OPropertyHandlerFactory)
+OPropertyHandlerFactory::OPropertyHandlerFactory()
+{
+ DBG_CTOR(rpt_OPropertyHandlerFactory,NULL);
+}
+// -----------------------------------------------------------------------------
+OPropertyHandlerFactory::~OPropertyHandlerFactory()
+{
+ DBG_DTOR(rpt_OPropertyHandlerFactory,NULL);
+}
+// -----------------------------------------------------------------------------
+const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 _nType) const
+{
+ const XMLPropertyHandler* pHandler = NULL;
+ sal_Int32 nType = _nType;
+ nType &= MID_FLAG_MASK;
+
+ switch(nType)
+ {
+ case XML_RPT_ALGINMENT:
+ {
+ static SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] =
+ {
+ { XML_TOP, style::VerticalAlignment_TOP },
+ { XML_MIDDLE, style::VerticalAlignment_MIDDLE },
+ { XML_BOTTOM, style::VerticalAlignment_BOTTOM },
+ { XML_TOKEN_INVALID, 0 }
+ };
+
+ pHandler = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, ::getCppuType((const com::sun::star::style::VerticalAlignment*)0) );
+ }
+ break;
+ case (XML_SD_TYPES_START+34):
+ pHandler = new xmloff::ImageScaleModeHandler();
+ default:
+ ;
+ }
+
+ if ( !pHandler )
+ pHandler = OControlPropertyHandlerFactory::GetPropertyHandler(_nType);
+ else
+ PutHdlCache(nType, pHandler);
+ 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, SvtSaveOptions::ODFVER_010 }
+#define MAP_CONST_T( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE, context, SvtSaveOptions::ODFVER_010 }
+#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, SvtSaveOptions::ODFVER_010 }
+#define MAP_CONST_P( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 }
+#define MAP_CONST_S( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_SECTION, context, SvtSaveOptions::ODFVER_010 }
+#define MAP_CONST_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 }
+#define GMAP( name, prefix, token, type, context ) { name.ascii, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_GRAPHIC, context, SvtSaveOptions::ODFVER_010 }
+#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, SvtSaveOptions::ODFVER_010 }
+#define MAP_CONST_C( name, prefix, token, type, context ) { name, name.length, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010 }
+#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0, SvtSaveOptions::ODFVER_010}
+// -----------------------------------------------------------------------------
+UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat)
+{
+ if ( _bOldFormat )
+ {
+ 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_C( PROPERTY_CONTROLBACKGROUND,
+ FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
+ MAP_CONST_C( PROPERTY_VERTICALALIGN, STYLE, VERTICAL_ALIGN, XML_RPT_ALGINMENT, 0 ),
+ MAP_CONST_C( PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
+ FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
+ 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());
+ }
+ else
+ {
+ 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_C( PROPERTY_CONTROLBACKGROUND,
+ FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
+ MAP_CONST_C( PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
+ FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
+ MAP_CONST_C( PROPERTY_VERTICALALIGN,
+ STYLE, VERTICAL_ALIGN, XML_RPT_ALGINMENT, 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::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::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;
+}
+// -----------------------------------------------------------------------------
+#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 bool _bOld,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_CHARPOSTURE, static_cast<sal_uInt16>(PROPERTY_CHARPOSTURE.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
+ {
+ pAutoStyle->FillPropertySet(_xProp);
+ if ( _bOld && _xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_CHARHIDDEN) )
+ _xProp->setPropertyValue(PROPERTY_CHARHIDDEN,uno::makeAny(sal_False));
+
+ 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_CHARPOSTURE) >>= 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() && aFont.Name.getLength() )
+ {
+ try
+ {
+ xReportControlModel->setFontDescriptor(aFont);
+ }
+ catch(beans::UnknownPropertyException){}
+ }
+ }
+ 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));
+}
+// -----------------------------------------------------------------------------
+SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap()
+{
+ 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_NAMESPACE_DRAW, XML_NAME, XML_TOK_REPORT_NAME },
+ { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, XML_TOK_MASTER_DETAIL_FIELDS },
+ { XML_NAMESPACE_DRAW, XML_FRAME, XML_TOK_SUB_FRAME },
+ XML_TOKEN_MAP_END
+ };
+ return new SvXMLTokenMap( aElemTokenMap );
+}
+// -----------------------------------------------------------------------------
+SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
+{
+ static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+ {
+ { 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
+ };
+ return new SvXMLTokenMap( aElemTokenMap );
+}
+// -----------------------------------------------------------------------------
+const SvXMLEnumMapEntry* OXMLHelper::GetImageScaleOptions()
+{
+ static SvXMLEnumMapEntry s_aXML_EnumMap[] =
+ {
+ // { XML_NONE, awt::ImageScaleMode::None }, // default
+ { XML_ISOTROPIC, awt::ImageScaleMode::Isotropic },
+ { XML_ANISOTROPIC, awt::ImageScaleMode::Anisotropic },
+ { XML_TOKEN_INVALID, 0 }
+ };
+ return s_aXML_EnumMap;
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+} // rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx
new file mode 100644
index 000000000000..cbcd2d93afe1
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlHelper.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLHELPER_HXX
+#define RPT_XMLHELPER_HXX
+
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/contextid.hxx>
+#include <xmloff/controlpropertyhdl.hxx>
+#include <com/sun/star/frame/XModel.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+
+#include <memory>
+
+#define CTF_RPT_NUMBERFORMAT (XML_DB_CTF_START + 1)
+
+#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;
+class SvXMLTokenMap;
+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(bool _bOldFormat = false);
+
+ static const SvXMLEnumMapEntry* GetReportPrintOptions();
+ static const SvXMLEnumMapEntry* GetForceNewPageOptions();
+ static const SvXMLEnumMapEntry* GetKeepTogetherOptions();
+ static const SvXMLEnumMapEntry* GetCommandTypeOptions();
+ static const SvXMLEnumMapEntry* GetImageScaleOptions();
+
+ static const XMLPropertyMapEntry* GetTableStyleProps();
+ static const XMLPropertyMapEntry* GetColumnStyleProps();
+
+ static const XMLPropertyMapEntry* GetRowStyleProps();
+
+ static void copyStyleElements(const bool _bOld,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();
+
+ static SvXMLTokenMap* GetReportElemTokenMap();
+ static SvXMLTokenMap* GetSubDocumentElemTokenMap();
+
+ };
+// -----------------------------------------------------------------------------
+} // 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..1f489bc947fd
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImage.cxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlImage.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "xmlEnums.hxx"
+#include "xmlComponent.hxx"
+#include "xmlReportElement.hxx"
+#include "xmlControlProperty.hxx"
+#include "xmlHelper.hxx"
+#include <tools/debug.hxx>
+#include <unotools/pathoptions.hxx>
+
+#include <comphelper/componentcontext.hxx>
+#include <com/sun/star/awt/ImageScaleMode.hpp>
+
+namespace rptxml
+{
+ 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 ::rtl::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)
+ {
+ ::rtl::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_IMAGE_DATA:
+ {
+ SvtPathOptions aPathOptions;
+ sValue = aPathOptions.SubstituteVariable(sValue);
+ _xComponent->setImageURL(rImport.GetAbsoluteReference( sValue ));
+ }
+
+ break;
+ case XML_TOK_PRESERVE_IRI:
+ _xComponent->setPreserveIRI(s_sTRUE == sValue);
+ break;
+ case XML_TOK_SCALE:
+ {
+ sal_uInt16 nRet = awt::ImageScaleMode::None;
+ if ( s_sTRUE == sValue )
+ {
+ nRet = awt::ImageScaleMode::Anisotropic;
+ }
+ else
+ {
+ const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetImageScaleOptions();
+ SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ }
+ _xComponent->setScaleMode( nRet );
+ }
+ break;
+ case XML_TOK_DATA_FORMULA:
+ _xComponent->setDataField(ORptFilter::convertFormula(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..1c4cc9a193dd
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImage.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLIMAGE_HXX
+#define RPT_XMLIMAGE_HXX
+
+#include "xmlReportElementBase.hxx"
+#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/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
new file mode 100644
index 000000000000..92ee79509dea
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -0,0 +1,397 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlImportDocumentHandler.hxx"
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
+#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/chart/XComplexDescriptionAccess.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/reflection/XProxyFactory.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <comphelper/sequence.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+#include <xmloff/attrlist.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlement.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/xmltkmap.hxx>
+#include <xmloff/xmlnmspe.hxx>
+
+#include "xmlHelper.hxx"
+#include "xmlEnums.hxx"
+
+#include <connectivity/dbtools.hxx>
+
+namespace rptxml
+{
+using namespace ::com::sun::star;
+using namespace ::xmloff::token;
+
+::rtl::OUString lcl_createAttribute(const xmloff::token::XMLTokenEnum& _eNamespace,const xmloff::token::XMLTokenEnum& _eAttribute);
+
+ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context)
+ :m_bImportedChart( false )
+ ,m_xContext(context)
+{
+}
+// -----------------------------------------------------------------------------
+ImportDocumentHandler::~ImportDocumentHandler()
+{
+ if ( m_xProxy.is() )
+ {
+ m_xProxy->setDelegator( NULL );
+ m_xProxy.clear();
+ }
+}
+IMPLEMENT_GET_IMPLEMENTATION_ID(ImportDocumentHandler)
+IMPLEMENT_FORWARD_REFCOUNT( ImportDocumentHandler, ImportDocumentHandler_BASE )
+//------------------------------------------------------------------------
+::rtl::OUString SAL_CALL ImportDocumentHandler::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------
+sal_Bool SAL_CALL ImportDocumentHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL ImportDocumentHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported;
+ if ( m_xServiceInfo.is() )
+ aSupported = m_xServiceInfo->getSupportedServiceNames();
+ return ::comphelper::concatSequences(getSupportedServiceNames_static(),aSupported);
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString ImportDocumentHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.ImportDocumentHandler"));
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > ImportDocumentHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ImportDocumentHandler"));
+ return aSupported;
+}
+
+//------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL ImportDocumentHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
+{
+ return *(new ImportDocumentHandler( _rxContext ));
+}
+// xml::sax::XDocumentHandler:
+void SAL_CALL ImportDocumentHandler::startDocument() throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->startDocument();
+}
+
+void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->endDocument();
+ uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
+ if ( xReceiver.is() && m_bImportedChart )
+ {
+ // this fills the chart again
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
+
+ uno::Reference< chart::XComplexDescriptionAccess > xDataProvider(m_xModel->getDataProvider(),uno::UNO_QUERY);
+ if ( xDataProvider.is() )
+ {
+ const uno::Sequence< ::rtl::OUString > aColumnNames = xDataProvider->getColumnDescriptions();
+ aArgs.put( "ColumnDescriptions", uno::makeAny( aColumnNames ) );
+ }
+
+ xReceiver->attachDataProvider( m_xDatabaseDataProvider.get() );
+ xReceiver->setArguments( aArgs.getPropertyValues() );
+ }
+}
+
+void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ uno::Reference< xml::sax::XAttributeList > xNewAttribs = _xAttrList;
+ bool bExport = true;
+ if ( _sName.equalsAscii("office:report") )
+ {
+ 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)
+ {
+ ::rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_Int32 nColonPos = sAttrName.indexOf( sal_Unicode(':') );
+ if( -1L == nColonPos )
+ sLocalName = sAttrName;
+ else
+ sLocalName = sAttrName.copy( nColonPos + 1L );
+ const rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( m_pReportElemTokenMap->Get( XML_NAMESPACE_REPORT, 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_xDatabaseDataProvider->setCommandType(nRet);
+ }
+ break;
+ case XML_TOK_COMMAND:
+ m_xDatabaseDataProvider->setCommand(sValue);
+ break;
+ case XML_TOK_FILTER:
+ m_xDatabaseDataProvider->setFilter(sValue);
+ break;
+ case XML_TOK_ESCAPE_PROCESSING:
+ m_xDatabaseDataProvider->setEscapeProcessing(sValue == s_sTRUE);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ // OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+ m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_CHART),NULL);
+ bExport = false;
+ m_bImportedChart = true;
+ }
+ else if ( _sName.equalsAscii("rpt:master-detail-field") )
+ {
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE);
+ ::std::auto_ptr<SvXMLTokenMap> pMasterElemTokenMap( OXMLHelper::GetSubDocumentElemTokenMap());
+ try
+ {
+ ::rtl::OUString sMasterField,sDetailField;
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ ::rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_Int32 nColonPos = sAttrName.indexOf( sal_Unicode(':') );
+ if( -1L == nColonPos )
+ sLocalName = sAttrName;
+ else
+ sLocalName = sAttrName.copy( nColonPos + 1L );
+ const rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+
+ switch( pMasterElemTokenMap->Get( XML_NAMESPACE_REPORT, sLocalName ) )
+ {
+ case XML_TOK_MASTER:
+ sMasterField = sValue;
+ break;
+ case XML_TOK_SUB_DETAIL:
+ sDetailField = sValue;
+ break;
+ }
+ }
+ if ( !sDetailField.getLength() )
+ sDetailField = sMasterField;
+ m_aMasterFields.push_back(sMasterField);
+ m_aDetailFields.push_back(sDetailField);
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched while filling the report definition props");
+ }
+ bExport = false;
+ }
+ else if ( _sName.equalsAscii("rpt:detail")
+ || _sName.equalsAscii("rpt:formatted-text")
+ || _sName.equalsAscii("rpt:master-detail-fields")
+ || _sName.equalsAscii("rpt:report-component")
+ || _sName.equalsAscii("rpt:report-element"))
+ bExport = false;
+ else if ( _sName.equalsAscii("chart:plot-area"))
+ {
+ sal_Bool bHasCategories = sal_True;
+ const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0;
+ ::std::auto_ptr<SvXMLTokenMap> pMasterElemTokenMap( OXMLHelper::GetSubDocumentElemTokenMap());
+ for(sal_Int16 i = 0; i < nLength; ++i)
+ {
+ ::rtl::OUString sLocalName;
+ const rtl::OUString sAttrName = _xAttrList->getNameByIndex( i );
+ const sal_Int32 nColonPos = sAttrName.indexOf( sal_Unicode(':') );
+ if( -1L == nColonPos )
+ sLocalName = sAttrName;
+ else
+ sLocalName = sAttrName.copy( nColonPos + 1L );
+ if ( sLocalName.equalsAscii("data-source-has-labels") )
+ {
+ const rtl::OUString sValue = _xAttrList->getValueByIndex( i );
+ bHasCategories = sValue.equalsAscii("both");
+ break;
+ }
+ } // for(sal_Int16 i = 0; i < nLength; ++i)
+ beans::PropertyValue* pArgIter = m_aArguments.getArray();
+ beans::PropertyValue* pArgEnd = pArgIter + m_aArguments.getLength();
+ for(;pArgIter != pArgEnd;++pArgIter)
+ {
+ if ( pArgIter->Name.equalsAscii("HasCategories") )
+ {
+ pArgIter->Value <<= bHasCategories;
+ break;
+ }
+ } // for(;pArgIter != pArgEnd;++pArgIter)
+
+
+ SvXMLAttributeList* pList = new SvXMLAttributeList();
+ xNewAttribs = pList;
+ pList->AppendAttributeList(_xAttrList);
+ pList->AddAttribute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("table:cell-range-address")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("local-table.$A$1:.$Z$65536")));
+
+ }
+
+ if ( bExport )
+ m_xDelegatee->startElement(_sName,xNewAttribs);
+}
+
+void SAL_CALL ImportDocumentHandler::endElement(const ::rtl::OUString & _sName) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ bool bExport = true;
+ ::rtl::OUString sNewName = _sName;
+ if ( _sName.equalsAscii("office:report") )
+ {
+ sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_CHART);
+ }
+ else if ( _sName.equalsAscii("rpt:master-detail-fields") )
+ {
+ if ( !m_aMasterFields.empty() )
+ m_xDatabaseDataProvider->setMasterFields(uno::Sequence< ::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
+ if ( !m_aDetailFields.empty() )
+ m_xDatabaseDataProvider->setDetailFields(uno::Sequence< ::rtl::OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
+ bExport = false;
+ }
+ else if ( _sName.equalsAscii("rpt:detail")
+ || _sName.equalsAscii("rpt:formatted-text")
+ || _sName.equalsAscii("rpt:master-detail-field")
+ || _sName.equalsAscii("rpt:report-component")
+ || _sName.equalsAscii("rpt:report-element"))
+ bExport = false;
+
+ if ( bExport )
+ m_xDelegatee->endElement(sNewName);
+}
+
+void SAL_CALL ImportDocumentHandler::characters(const ::rtl::OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->characters(aChars);
+}
+
+void SAL_CALL ImportDocumentHandler::ignorableWhitespace(const ::rtl::OUString & aWhitespaces) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->ignorableWhitespace(aWhitespaces);
+}
+
+void SAL_CALL ImportDocumentHandler::processingInstruction(const ::rtl::OUString & aTarget, const ::rtl::OUString & aData) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->processingInstruction(aTarget,aData);
+}
+
+void SAL_CALL ImportDocumentHandler::setDocumentLocator(const uno::Reference< xml::sax::XLocator > & xLocator) throw (uno::RuntimeException, xml::sax::SAXException)
+{
+ m_xDelegatee->setDocumentLocator(xLocator);
+}
+void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >& _aArguments ) throw (uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard(m_aMutex);
+ comphelper::SequenceAsHashMap aArgs(_aArguments);
+ m_xDelegatee = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentHandler")),m_xDelegatee);
+ m_xModel = aArgs.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Model")),m_xModel);
+
+ OSL_ENSURE(m_xDelegatee.is(),"No document handler avialable!");
+ if ( !m_xDelegatee.is() || !m_xModel.is() )
+ throw uno::Exception();
+
+ m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY);
+ if ( !m_xDatabaseDataProvider.is() )
+ {
+ const static ::rtl::OUString s_sDatabaseDataProvider(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DatabaseDataProvider"));
+ m_xDatabaseDataProvider.set(m_xContext->getServiceManager()->createInstanceWithContext(s_sDatabaseDataProvider
+ ,m_xContext),uno::UNO_QUERY);
+ if ( !m_xDatabaseDataProvider.is() )
+ throw uno::Exception();
+
+ m_xDatabaseDataProvider->setRowLimit(10);
+
+ uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW);
+ xReceiver->attachDataProvider(m_xDatabaseDataProvider.get());
+ } // if ( !m_xDatabaseDataProvider.is() )
+
+ m_aArguments = m_xDatabaseDataProvider->detectArguments(NULL);
+
+ uno::Reference< reflection::XProxyFactory > xProxyFactory( m_xContext->getServiceManager()->createInstanceWithContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory")),m_xContext),
+ uno::UNO_QUERY);
+ m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
+ ::comphelper::query_aggregation(m_xProxy,m_xDelegatee);
+ m_xTypeProvider.set(m_xDelegatee,uno::UNO_QUERY);
+ m_xServiceInfo.set(m_xDelegatee,uno::UNO_QUERY);
+
+ // set ourself as delegator
+ m_xProxy->setDelegator( *this );
+
+ m_pReportElemTokenMap.reset(OXMLHelper::GetReportElemTokenMap());
+}
+// --------------------------------------------------------------------------------
+uno::Any SAL_CALL ImportDocumentHandler::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException)
+{
+ uno::Any aReturn = ImportDocumentHandler_BASE::queryInterface(_rType);
+ return aReturn.hasValue() ? aReturn : (m_xProxy.is() ? m_xProxy->queryAggregation(_rType) : aReturn);
+}
+// --------------------------------------------------------------------------------
+uno::Sequence< uno::Type > SAL_CALL ImportDocumentHandler::getTypes( ) throw (uno::RuntimeException)
+{
+ if ( m_xTypeProvider.is() )
+ return ::comphelper::concatSequences(
+ ImportDocumentHandler_BASE::getTypes(),
+ m_xTypeProvider->getTypes()
+ );
+ return ImportDocumentHandler_BASE::getTypes();
+}
+
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
new file mode 100644
index 000000000000..579a1b79b231
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED
+#define RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED
+
+#include "sal/config.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include <cppuhelper/implbase3.hxx>
+#include "com/sun/star/xml/sax/XDocumentHandler.hpp"
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp"
+#include <comphelper/uno3.hxx>
+#include <memory>
+
+class SvXMLTokenMap;
+namespace rptxml
+{
+typedef ::cppu::WeakAggImplHelper3< ::com::sun::star::xml::sax::XDocumentHandler
+ , ::com::sun::star::lang::XInitialization
+ , ::com::sun::star::lang::XServiceInfo> ImportDocumentHandler_BASE;
+
+class ImportDocumentHandler : public ImportDocumentHandler_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 ImportDocumentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
+
+private:
+ // 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);
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // ::com::sun::star::xml::sax::XDocumentHandler:
+ virtual void SAL_CALL startDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endDocument() throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL startElement(const ::rtl::OUString & aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL endElement(const ::rtl::OUString & aName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL characters(const ::rtl::OUString & aChars) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL ignorableWhitespace(const ::rtl::OUString & aWhitespaces) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL processingInstruction(const ::rtl::OUString & aTarget, const ::rtl::OUString & aData) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+ virtual void SAL_CALL setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::xml::sax::SAXException);
+
+ 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);
+
+private:
+ ImportDocumentHandler(ImportDocumentHandler &); // not defined
+ void operator =(ImportDocumentHandler &); // not defined
+
+ virtual ~ImportDocumentHandler();
+
+ ::osl::Mutex m_aMutex;
+ bool m_bImportedChart;
+ ::std::vector< ::rtl::OUString> m_aMasterFields;
+ ::std::vector< ::rtl::OUString> m_aDetailFields;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aArguments;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_xDelegatee;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > m_xProxy;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XTypeProvider > m_xTypeProvider;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > m_xServiceInfo;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider;
+
+ ::std::auto_ptr<SvXMLTokenMap> m_pReportElemTokenMap;
+};
+// -----------------------------------------------------------------------------
+} // namespace rptxml
+// -----------------------------------------------------------------------------
+#endif // RPT_IMPORTDOCUMENTHANDLER_HXX_INCLUDED
diff --git a/reportdesign/source/filter/xml/xmlMasterFields.cxx b/reportdesign/source/filter/xml/xmlMasterFields.cxx
new file mode 100644
index 000000000000..2067aec4ee7e
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlMasterFields.cxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlMasterFields.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlReport.hxx"
+#include <tools/debug.hxx>
+
+
+namespace rptxml
+{
+ 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 ::rtl::OUString& rLName,
+ const Reference< XAttributeList > & _xAttrList
+ ,IMasterDetailFieds* _pReport
+ ) :
+ SvXMLImportContext( rImport, nPrfx, rLName)
+,m_pReport(_pReport)
+{
+ 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)
+ {
+ ::rtl::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_MASTER:
+ sMasterField = sValue;
+ break;
+ case XML_TOK_SUB_DETAIL:
+ sDetailField = sValue;
+ break;
+ default:
+ break;
+ }
+ }
+ if ( !sDetailField.getLength() )
+ sDetailField = sMasterField;
+ if ( sMasterField.getLength() )
+ m_pReport->addMasterDetailPair(::std::pair< ::rtl::OUString,::rtl::OUString >(sMasterField,sDetailField));
+}
+// -----------------------------------------------------------------------------
+
+OXMLMasterFields::~OXMLMasterFields()
+{
+ DBG_DTOR( rpt_OXMLMasterFields,NULL);
+}
+
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLMasterFields::CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const ::rtl::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_pReport);
+ }
+ 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..41ec58ec1602
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlMasterFields.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLMASTERFIELDS_HXX
+#define RPT_XMLMASTERFIELDS_HXX
+
+#include <xmloff/xmlictxt.hxx>
+namespace rptxml
+{
+ class ORptFilter;
+ class IMasterDetailFieds;
+ class OXMLMasterFields : public SvXMLImportContext
+ {
+ IMasterDetailFieds* m_pReport;
+ 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
+ ,IMasterDetailFieds* _pReport);
+ 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..0310edf0830a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlPropertyHandler.cxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "xmlPropertyHandler.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/txtimp.hxx>
+#include <xmloff/nmspmap.hxx>
+
+//--------------------------------------------------------------------------
+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..7ecbb9ff9448
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlPropertyHandler.hxx
@@ -0,0 +1,49 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLPROPHANDLER_HXX
+#define RPT_XMLPROPHANDLER_HXX
+
+#include <xmloff/xmlprmap.hxx>
+#include <xmloff/contextid.hxx>
+#include <xmloff/prhdlfac.hxx>
+
+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..e2bfa0deee8c
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReport.cxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlReport.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "xmlHelper.hxx"
+#include "xmlGroup.hxx"
+#include "xmlSection.hxx"
+#include "xmlEnums.hxx"
+#include "xmlFunction.hxx"
+#include <tools/diagnose_ex.h>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include "xmlMasterFields.hxx"
+
+namespace rptxml
+{
+ using namespace ::com::sun::star;
+ using namespace uno;
+ using namespace xml::sax;
+
+DBG_NAME( rpt_OXMLReport )
+
+OXMLReport::OXMLReport( ORptFilter& rImport,
+ sal_uInt16 nPrfx, const ::rtl::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)
+ {
+ ::rtl::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_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;
+ case XML_TOK_REPORT_NAME:
+ m_xComponent->setName(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 ::rtl::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(),true);
+ }
+ break;
+ case XML_TOK_MASTER_DETAIL_FIELDS:
+ m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = new OXMLMasterFields(m_rImport, nPrefix, rLocalName,xAttrList ,this);
+ 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;
+}
+// -----------------------------------------------------------------------------
+void OXMLReport::EndElement()
+{
+ Reference< XFunctions > xFunctions = m_xComponent->getFunctions();
+ const ORptFilter::TGroupFunctionMap& aFunctions = m_rImport.getFunctions();
+ ORptFilter::TGroupFunctionMap::const_iterator aIter = aFunctions.begin();
+ const ORptFilter::TGroupFunctionMap::const_iterator aEnd = aFunctions.end();
+ for (; aIter != aEnd; ++aIter)
+ xFunctions->insertByIndex(xFunctions->getCount(),uno::makeAny(aIter->second));
+
+ 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 OXMLReport::addMasterDetailPair(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/xmlReport.hxx b/reportdesign/source/filter/xml/xmlReport.hxx
new file mode 100644
index 000000000000..232350559c4b
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReport.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLREPORT_HXX
+#define RPT_XMLREPORT_HXX
+
+#include "xmlReportElementBase.hxx"
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLReport : public OXMLReportElementBase, public IMasterDetailFieds
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xComponent;
+ ::std::vector< ::rtl::OUString> m_aMasterFields;
+ ::std::vector< ::rtl::OUString> m_aDetailFields;
+ 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 );
+
+ virtual void EndElement();
+
+ virtual void addMasterDetailPair(const ::std::pair< ::rtl::OUString,::rtl::OUString >& _aPair);
+
+ 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..5cd4e3800047
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElement.cxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlReportElement.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlComponent.hxx"
+#include "xmlCondPrtExpr.hxx"
+#include <tools/debug.hxx>
+#include "xmlFormatCondition.hxx"
+
+
+namespace rptxml
+{
+ 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 ::rtl::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)
+ {
+ ::rtl::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_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 ::rtl::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..7ca0b5c0b71c
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElement.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLREPORTELEMENT_HXX
+#define RPT_XMLREPORTELEMENT_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XReportControlModel.hpp>
+
+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..cbc9c6d7f739
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.cxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlReportElementBase.hxx"
+#include "xmlfilter.hxx"
+#include "xmlControlProperty.hxx"
+#include "xmlReportElement.hxx"
+#include "xmlEnums.hxx"
+#include "xmlTable.hxx"
+
+namespace rptxml
+{
+ 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 ::rtl::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 ::rtl::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 ::rtl::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..970d20dd8180
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlReportElementBase.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLREPORTELEMENTBASE_HXX
+#define RPT_XMLREPORTELEMENTBASE_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLTable;
+
+ class SAL_NO_VTABLE IMasterDetailFieds
+ {
+ public:
+ virtual void addMasterDetailPair(const ::std::pair< ::rtl::OUString,::rtl::OUString >& _aPair) = 0;
+ };
+
+ 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..66ef1ee51054
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlRow.cxx
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#include <xmloff/xmluconv.hxx>
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include <tools/debug.hxx>
+#include "xmlStyleImport.hxx"
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/genericpropertyset.hxx>
+#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 ::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 ::rtl::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)
+ {
+ ::rtl::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_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 ::rtl::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..97c98c81e11f
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlRow.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLCOLUMN_HXX
+#define RPT_XMLCOLUMN_HXX
+
+#include <xmloff/xmlictxt.hxx>
+
+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..d888ed5f9cf4
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlSection.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "xmlHelper.hxx"
+#include "xmlEnums.hxx"
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#ifndef RPT_XMLCondPrtExpr_HXX
+#include "xmlCondPrtExpr.hxx"
+#endif
+#include "xmlStyleImport.hxx"
+#include <connectivity/dbtools.hxx>
+#include <tools/debug.hxx>
+#include <com/sun/star/report/ReportPrintOption.hpp>
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include "xmlTable.hxx"
+
+
+namespace rptxml
+{
+ 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 ::rtl::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;
+ 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 );
+ const 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;
+ case XML_TOK_REPEAT_SECTION:
+ m_xSection->setRepeatSection(sValue == s_sTRUE );
+ 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 ::rtl::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_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..3f42e3b6a0da
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSection.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLSECTION_HXX
+#define RPT_XMLSECTION_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XSection.hpp>
+#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..c406694e04d5
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx
@@ -0,0 +1,459 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlStyleImport.hxx"
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmlimppr.hxx>
+#include <xmloff/txtimppr.hxx>
+#include <xmloff/families.hxx>
+#include <xmloff/xmlnumfi.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/table/BorderLine.hpp>
+#include <comphelper/extract.hxx>
+#include <xmloff/xmlprcon.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/XMLGraphicsDefaultStyle.hxx>
+#include <tools/debug.hxx>
+#include "xmlfilter.hxx"
+#include "xmlHelper.hxx"
+#include <tools/debug.hxx>
+
+#define XML_LINE_LEFT 0
+#define XML_LINE_RIGHT 1
+#define XML_LINE_TOP 2
+#define XML_LINE_BOTTOM 3
+
+namespace rptxml
+{
+
+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 ::rtl::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 = const_cast< SvXMLNumFormatContext*>(dynamic_cast<const SvXMLNumFormatContext*>(pStyles->FindStyleChildContext(
+ XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_False)));
+ 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 ::rtl::OUString& rLocalName,
+ const ::rtl::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 ::rtl::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 ::rtl::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 ::rtl::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())
+ {
+ ::rtl::OUString sName;
+ switch( nFamily )
+ {
+ case XML_STYLE_FAMILY_TABLE_TABLE:
+ {
+ if( m_xTableStyles.is() )
+ xStyles.set(m_xTableStyles);
+ else
+ sName =
+ ::rtl::OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "TableStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_CELL:
+ {
+ if( m_xCellStyles.is() )
+ xStyles.set(m_xCellStyles);
+ else
+ sName =
+ ::rtl::OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "CellStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_COLUMN:
+ {
+ if( m_xColumnStyles.is() )
+ xStyles.set(m_xColumnStyles);
+ else
+ sName =
+ ::rtl::OUString( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ColumnStyles" ) ));
+ }
+ break;
+ case XML_STYLE_FAMILY_TABLE_ROW:
+ {
+ if( m_xRowStyles.is() )
+ xStyles.set(m_xRowStyles);
+ else
+ sName =
+ ::rtl::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;
+}
+// -----------------------------------------------------------------------------
+
+::rtl::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..125168aa9447
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_XMLSTYLEIMPORT_HXX
+#define RPT_XMLSTYLEIMPORT_HXX
+
+#include <rtl/ustring.hxx>
+#include <xmloff/xmlimp.hxx>
+#include <xmloff/xmlictxt.hxx>
+#include <xmloff/maptype.hxx>
+#include <xmloff/prstylei.hxx>
+#include <xmloff/xmlimppr.hxx>
+#ifndef _XMLTEXTMASTERPAGECONTEXT_HXX
+#include <xmloff/XMLTextMasterPageContext.hxx>
+#endif
+#ifndef _XMLTEXTMASTERSTYLESCONTEXT_HXX
+#include <xmloff/XMLTextMasterStylesContext.hxx>
+#endif
+#include <xmloff/contextid.hxx>
+#include <xmloff/controlpropertyhdl.hxx>
+#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..a999a0376cbb
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSubDocument.cxx
@@ -0,0 +1,164 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlSubDocument.hxx"
+#include "xmlCell.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include "xmlEnums.hxx"
+#include "xmlMasterFields.hxx"
+#include "xmlTable.hxx"
+#include <tools/debug.hxx>
+#include <comphelper/property.hxx>
+#include <com/sun/star/report/XReportControlModel.hpp>
+
+namespace rptxml
+{
+ 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 ::rtl::OUString& rLName
+ ,const Reference< XReportComponent > & _xComponent
+ ,OXMLTable* _pContainer
+ ,OXMLCell* _pCellParent) :
+ OXMLReportElementBase( rImport, nPrfx, rLName,_xComponent.get(),_pContainer)
+,m_xFake(_xComponent)
+,m_pCellParent(_pCellParent)
+,m_nCurrentCount(0)
+,m_bContainsShape(false)
+{
+ DBG_CTOR( rpt_OXMLSubDocument,NULL);
+
+}
+// -----------------------------------------------------------------------------
+
+OXMLSubDocument::~OXMLSubDocument()
+{
+ DBG_DTOR( rpt_OXMLSubDocument,NULL);
+}
+
+// -----------------------------------------------------------------------------
+SvXMLImportContext* OXMLSubDocument::_CreateChildContext(
+ sal_uInt16 _nPrefix,
+ const ::rtl::OUString& _rLocalName,
+ const Reference< XAttributeList > & xAttrList )
+{
+ SvXMLImportContext *pContext = OXMLReportElementBase::_CreateChildContext(_nPrefix,_rLocalName,xAttrList);
+ if ( pContext )
+ return pContext;
+ const SvXMLTokenMap& rTokenMap = static_cast<ORptFilter&>(GetImport()).GetReportElemTokenMap();
+
+ 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;
+ case XML_TOK_SUB_FRAME:
+ {
+ if ( !m_bContainsShape )
+ m_nCurrentCount = m_pContainer->getSection()->getCount();
+ UniReference< XMLShapeImportHelper > xShapeImportHelper = GetImport().GetShapeImport();
+ uno::Reference< drawing::XShapes > xShapes = m_pContainer->getSection().get();
+ pContext = xShapeImportHelper->CreateGroupChildContext(GetImport(),_nPrefix,_rLocalName,xAttrList,xShapes);
+ m_bContainsShape = true;
+ if (m_pCellParent)
+ {
+ // #i94115 say to the parent Cell it contains shapes
+ m_pCellParent->setContainsShape(true);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ if( !pContext )
+ pContext = new SvXMLImportContext( GetImport(), _nPrefix, _rLocalName );
+
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+void OXMLSubDocument::EndElement()
+{
+ if ( m_bContainsShape )
+ {
+ m_xComponent.set(m_pContainer->getSection()->getByIndex(m_nCurrentCount),uno::UNO_QUERY);
+ if ( m_xComponent.is() )
+ {
+ // #i94115# this is no longer need.
+ // m_pContainer->addCell(m_xComponent.get());
+
+ 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()));
+
+ m_xComponent->setName(m_xFake->getName());
+ m_xComponent->setPrintRepeatedValues(m_xFake->getPrintRepeatedValues());
+ uno::Reference< report::XReportControlModel > xFakeModel(m_xFake,uno::UNO_QUERY);
+ uno::Reference< report::XReportControlModel > xComponentModel(m_xComponent,uno::UNO_QUERY);
+ if ( xComponentModel.is() && xFakeModel.is() )
+ {
+ const sal_Int32 nCount = xFakeModel->getCount();
+ try
+ {
+ for (sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ uno::Reference< report::XFormatCondition > xCond(xFakeModel->getByIndex(i),uno::UNO_QUERY);
+ uno::Reference< report::XFormatCondition > xNewCond = xComponentModel->createFormatCondition();
+ ::comphelper::copyProperties(xCond.get(),xNewCond.get());
+ xComponentModel->insertByIndex(xComponentModel->getCount(),uno::makeAny(xNewCond));
+ } // for (sal_Int32 i = 0; i < nCount ; ++i)
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can not access format condition!");
+ }
+
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OXMLSubDocument::addMasterDetailPair(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..874dfd909b2a
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlSubDocument.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLSUBDOCUMENT_HXX
+#define RPT_XMLSUBDOCUMENT_HXX
+
+#include "xmlReportElementBase.hxx"
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <vector>
+
+namespace rptxml
+{
+ class ORptFilter;
+ class OXMLCell;
+ class OXMLSubDocument : public OXMLReportElementBase, public IMasterDetailFieds
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> m_xComponent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> m_xFake;
+ ::std::vector< ::rtl::OUString> m_aMasterFields;
+ ::std::vector< ::rtl::OUString> m_aDetailFields;
+ OXMLCell* m_pCellParent;
+ sal_Int32 m_nCurrentCount;
+ bool m_bContainsShape;
+
+ OXMLSubDocument(const OXMLSubDocument&);
+ void operator =(const OXMLSubDocument&);
+
+ virtual SvXMLImportContext* _CreateChildContext( sal_uInt16 nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ public:
+
+ OXMLSubDocument( ORptFilter& rImport
+ ,sal_uInt16 nPrfx
+ ,const ::rtl::OUString& rLName
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent
+ ,OXMLTable* _pContainer
+ ,OXMLCell* _pCellParent);
+ virtual ~OXMLSubDocument();
+
+ virtual void EndElement();
+ virtual void addMasterDetailPair(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..c693daa98eba
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -0,0 +1,323 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "xmlTable.hxx"
+#include "xmlfilter.hxx"
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/xmluconv.hxx>
+#include "RptDef.hxx"
+#include "xmlHelper.hxx"
+#include "xmlEnums.hxx"
+#ifndef RPT_XMLCOLUMN_HXX
+#include "xmlColumn.hxx"
+#endif
+#include <com/sun/star/report/ForceNewPage.hpp>
+#include "xmlCondPrtExpr.hxx"
+#include "xmlStyleImport.hxx"
+#include "xmlstrings.hrc"
+#include <connectivity/dbtools.hxx>
+#include <tools/debug.hxx>
+#ifndef REPORTDESIGN_SHARED_XMLSTRINGS_HRC
+#include "xmlstrings.hrc"
+#endif
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+
+#define MIN_WIDTH 80
+#define MIN_HEIGHT 20
+
+namespace rptxml
+{
+ 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 ::rtl::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 );
+ const 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_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 ::rtl::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;
+ case XML_TOK_CONDITIONAL_PRINT_EXPRESSION:
+ pContext = new OXMLCondPrtExpr( rImport, _nPrefix, _rLocalName,xAttrList,m_xSection.get());
+ 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.xElements.empty())
+ {
+ ::std::vector< uno::Reference< report::XReportComponent> >::iterator aCellIter = rCell.xElements.begin();
+ const ::std::vector< uno::Reference< report::XReportComponent> >::iterator aCellEnd = rCell.xElements.end();
+ for (;aCellIter != aCellEnd ; ++aCellIter)
+ {
+ uno::Reference<report::XShape> xShape(*aCellIter,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(*aCellIter,uno::UNO_QUERY);
+ if ( xFixedLine.is() )
+ {
+ if ( 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];
+ if ( nWidth < MIN_WIDTH )
+ nWidth = MIN_WIDTH;
+ }
+ else if ( nHeight < MIN_HEIGHT )
+ nHeight = MIN_HEIGHT;
+ }
+ try
+ {
+ (*aCellIter)->setSize(awt::Size(nWidth,nHeight));
+ (*aCellIter)->setPosition(awt::Point(nPosX,nPosY));
+ }
+ catch(beans::PropertyVetoException)
+ {
+ OSL_ENSURE(0,"Could not set the correct position or size!");
+ }
+ }
+ }
+ }
+ 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)
+{
+ uno::Reference<report::XShape> xShape(_xElement,uno::UNO_QUERY);
+ 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];
+ if ( _xElement.is() )
+ rCell.xElements.push_back( _xElement );
+ if ( !xShape.is() )
+ {
+ rCell.nWidth = m_aWidth[m_nColumnIndex-1];
+ rCell.nHeight = m_aHeight[m_nRowIndex-1];
+ rCell.nColSpan = m_nColSpan;
+ rCell.nRowSpan = m_nRowSpan;
+ }
+ }
+
+ if ( !xShape.is() )
+ 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..978723be6758
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlTable.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLTABLE_HXX
+#define RPT_XMLTABLE_HXX
+
+#include <xmloff/xmlictxt.hxx>
+#include <com/sun/star/report/XSection.hpp>
+#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;
+ ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> > xElements;
+ 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..74e6e1dd9341
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -0,0 +1,1137 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include <com/sun/star/packages/zip/ZipIOException.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include "xmlfilter.hxx"
+#include "xmlGroup.hxx"
+#include "xmlReport.hxx"
+#include "xmlHelper.hxx"
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <connectivity/dbtools.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmltoken.hxx>
+#include <xmloff/txtimp.hxx>
+#include <xmloff/nmspmap.hxx>
+#include <xmloff/XMLFontStylesContext.hxx>
+#include <rtl/logfile.hxx>
+#include <com/sun/star/xml/sax/InputSource.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <xmloff/ProgressBarHelper.hxx>
+#include <sfx2/docfile.hxx>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/uno/XNamingService.hpp>
+#include <tools/urlobj.hxx>
+#include <xmloff/DocumentSettingsContext.hxx>
+#include <xmloff/xmluconv.hxx>
+#include <xmloff/xmlmetai.hxx>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+#include <svtools/sfxecode.hxx>
+#include "xmlEnums.hxx"
+#include "xmlStyleImport.hxx"
+#include "xmlstrings.hrc"
+#include "xmlPropertyHandler.hxx"
+#include <xmloff/txtprmap.hxx>
+#include "ReportDefinition.hxx"
+
+
+#define MAP_LEN(x) x, sizeof(x) - 1
+//--------------------------------------------------------------------------
+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 );
+DBG_NAME(rpt_RptMLMasterStylesContext_Impl)
+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)
+{
+ DBG_CTOR(rpt_RptMLMasterStylesContext_Impl,NULL);
+}
+
+RptMLMasterStylesContext_Impl::~RptMLMasterStylesContext_Impl()
+{
+ DBG_DTOR(rpt_RptMLMasterStylesContext_Impl,NULL);
+}
+
+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 Reference< document::XGraphicObjectResolver > & _xGraphicObjectResolver,
+ const Reference<document::XEmbeddedObjectResolver>& _xEmbeddedObjectResolver,
+ const ::rtl::OUString& _sFilterName
+ ,const uno::Reference<beans::XPropertySet>& _xProp)
+{
+ 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 );
+ xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) ) >>= bEncrypted;
+ }
+ catch( packages::WrongPasswordException& )
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch ( uno::Exception& )
+ {
+ return 1; // TODO/LATER: error handling
+ }
+
+ sal_Int32 nArgs = 0;
+ if( _xGraphicObjectResolver.is())
+ nArgs++;
+ if( _xEmbeddedObjectResolver.is())
+ nArgs++;
+ if ( _xProp.is() )
+ nArgs++;
+
+ uno::Sequence< uno::Any > aFilterCompArgs( nArgs );
+
+ nArgs = 0;
+ if( _xGraphicObjectResolver.is())
+ aFilterCompArgs[nArgs++] <<= _xGraphicObjectResolver;
+ if( _xEmbeddedObjectResolver.is())
+ aFilterCompArgs[ nArgs++ ] <<= _xEmbeddedObjectResolver;
+ if ( _xProp.is() )
+ aFilterCompArgs[ nArgs++ ] <<= _xProp;
+
+ Reference< xml::sax::XDocumentHandler > xDocHandler(
+ rFactory->createInstanceWithArguments( _sFilterName, aFilterCompArgs ),
+ uno::UNO_QUERY_THROW );
+ uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
+ // read from the stream
+ return ReadThroughComponent( xInputStream
+ ,xModelComponent
+ ,pStreamName
+ ,rFactory
+ ,xDocHandler
+ ,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;
+}
+
+//---------------------------------------------------------------------
+Reference< XInterface > ORptMetaImportHelper::create(Reference< XComponentContext > const & xContext)
+{
+ return static_cast< XServiceInfo* >(new ORptFilter(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY),
+ IMPORT_META));
+}
+//---------------------------------------------------------------------
+::rtl::OUString ORptMetaImportHelper::getImplementationName_Static( ) throw (RuntimeException)
+{
+ return ::rtl::OUString(SERVICE_METAIMPORTER);
+}
+//---------------------------------------------------------------------
+Sequence< ::rtl::OUString > ORptMetaImportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = SERVICE_IMPORTFILTER;
+ return aSupported;
+}
+
+// -------------
+// - ORptFilter -
+// -------------
+DBG_NAME(rpt_ORptFilter)
+ORptFilter::ORptFilter( const uno::Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 nImportFlags )
+ :SvXMLImport(_rxMSF,nImportFlags)
+{
+ DBG_CTOR(rpt_ORptFilter,NULL);
+ 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(true);
+ 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()
+{
+ DBG_DTOR(rpt_ORptFilter,NULL);
+}
+//------------------------------------------------------------------------------
+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;
+
+#if OSL_DEBUG_LEVEL > 1
+ uno::Reference < container::XNameAccess > xAccess( xStorage, uno::UNO_QUERY );
+ uno::Sequence< ::rtl::OUString> aSeq = xAccess->getElementNames();
+ const ::rtl::OUString* pDebugIter = aSeq.getConstArray();
+ const ::rtl::OUString* pDebugEnd = pDebugIter + aSeq.getLength();
+ for(;pDebugIter != pDebugEnd;++pDebugIter)
+ {
+ (void)*pDebugIter;
+ }
+#endif
+
+ Reference< document::XGraphicObjectResolver > xGraphicObjectResolver;
+ uno::Reference<document::XEmbeddedObjectResolver> xEmbeddedObjectResolver;
+ uno::Reference< lang::XMultiServiceFactory > xServiceFactory( getServiceFactory(), uno::UNO_QUERY);
+ if( xServiceFactory.is())
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] <<= xStorage;
+ xGraphicObjectResolver.set(
+ xServiceFactory->createInstanceWithArguments(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Svx.GraphicImportHelper")), aArgs ), uno::UNO_QUERY );
+
+ uno::Reference< lang::XMultiServiceFactory > xReportServiceFactory( m_xReportDefinition, uno::UNO_QUERY);
+ aArgs[0] <<= beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage")),uno::makeAny(xStorage));
+ xEmbeddedObjectResolver.set( xReportServiceFactory->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ImportEmbeddedObjectResolver")),aArgs) , uno::UNO_QUERY);
+ }
+
+ static const ::rtl::OUString s_sOld(RTL_CONSTASCII_USTRINGPARAM("OldFormat"));
+ static comphelper::PropertyMapEntry pMap[] =
+ {
+ { MAP_LEN( "OldFormat" ), 1, &::getCppuType((const sal_Bool*)0), beans::PropertyAttribute::BOUND, 0 },
+ { MAP_LEN( "StreamName"), 0, &::getCppuType( (::rtl::OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN("PrivateData"), 0, &::getCppuType( (uno::Reference<XInterface> *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "BaseURI"), 0, &::getCppuType( (::rtl::OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { MAP_LEN( "StreamRelPath"), 0, &::getCppuType( (::rtl::OUString *)0 ), beans::PropertyAttribute::MAYBEVOID, 0 },
+ { NULL, 0, 0, NULL, 0, 0 }
+ };
+ ::comphelper::MediaDescriptor aDescriptor(rDescriptor);
+ uno::Reference<beans::XPropertySet> xProp = comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
+ const ::rtl::OUString sVal( aDescriptor.getUnpackedValueOrDefault(aDescriptor.PROP_DOCUMENTBASEURL(),::rtl::OUString()) );
+ xProp->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(sVal));
+ const ::rtl::OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),::rtl::OUString()) );
+ xProp->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), uno::makeAny(sHierarchicalDocumentName));
+
+ uno::Reference<XComponent> xModel(GetModel(),UNO_QUERY);
+ static const ::rtl::OUString s_sMeta(RTL_CONSTASCII_USTRINGPARAM("meta.xml"));
+ static const rtl::OUString s_sStreamName(RTL_CONSTASCII_USTRINGPARAM("StreamName"));
+ xProp->setPropertyValue(s_sStreamName, uno::makeAny(s_sMeta));
+ sal_Int32 nRet = ReadThroughComponent( xStorage
+ ,xModel
+ ,"meta.xml"
+ ,"Meta.xml"
+ ,getServiceFactory()
+ ,xGraphicObjectResolver
+ ,xEmbeddedObjectResolver
+ ,SERVICE_METAIMPORTER
+ ,xProp
+ );
+
+
+ try
+ {
+ xProp->setPropertyValue(s_sOld,uno::makeAny(!(xStorage->hasByName(s_sMeta) || xStorage->isStreamElement( s_sMeta ))));
+ }
+ catch(uno::Exception&)
+ {
+ xProp->setPropertyValue(s_sOld,uno::makeAny(sal_True));
+ }
+
+ if ( nRet == 0 )
+ {
+ xProp->setPropertyValue(s_sStreamName, uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("settings.xml"))));
+ nRet = ReadThroughComponent( xStorage
+ ,xModel
+ ,"settings.xml"
+ ,"Settings.xml"
+ ,getServiceFactory()
+ ,xGraphicObjectResolver
+ ,xEmbeddedObjectResolver
+ ,SERVICE_SETTINGSIMPORTER
+ ,xProp
+ );
+ }
+ if ( nRet == 0 )
+ {
+ xProp->setPropertyValue(s_sStreamName, uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("styles.xml"))));
+ nRet = ReadThroughComponent(xStorage
+ ,xModel
+ ,"styles.xml"
+ ,"Styles.xml"
+ ,getServiceFactory()
+ ,xGraphicObjectResolver
+ ,xEmbeddedObjectResolver
+ ,SERVICE_STYLESIMPORTER
+ ,xProp);
+ }
+
+ if ( nRet == 0 )
+ {
+ xProp->setPropertyValue(s_sStreamName, uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml"))));
+ nRet = ReadThroughComponent( xStorage
+ ,xModel
+ ,"content.xml"
+ ,"Content.xml"
+ ,getServiceFactory()
+ ,xGraphicObjectResolver
+ ,xEmbeddedObjectResolver
+ ,SERVICE_CONTENTIMPORTER
+ ,xProp
+ );
+ }
+
+
+ bRet = nRet == 0;
+
+ if ( bRet )
+ {
+ m_xReportDefinition->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:
+ // don't use the autostyles from the styles-document for the progress
+ if ( ! IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) )
+ 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;
+ case XML_TOK_DOC_META:
+ GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
+ pContext = CreateMetaContext( rLocalName,xAttrList );
+ 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_OFFICE, XML_DOCUMENT_META, XML_TOK_DOC_META },
+ //{ 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() )
+ m_pReportElemTokenMap.reset(OXMLHelper::GetReportElemTokenMap());
+ return *m_pReportElemTokenMap;
+}
+// -----------------------------------------------------------------------------
+const SvXMLTokenMap& ORptFilter::GetSubDocumentElemTokenMap() const
+{
+ if ( !m_pSubDocumentElemTokenMap.get() )
+ m_pSubDocumentElemTokenMap.reset(OXMLHelper::GetSubDocumentElemTokenMap());
+ 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_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_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION, XML_TOK_CONDITIONAL_PRINT_EXPRESSION},
+ 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_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_DRAW, XML_FRAME , XML_TOK_FRAME },
+ { 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!");
+
+ SvXMLImport::startDocument();
+ }
+}
+// -----------------------------------------------------------------------------
+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();
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::removeFunction(const ::rtl::OUString& _sFunctionName)
+{
+ m_aFunctions.erase(_sFunctionName);
+}
+// -----------------------------------------------------------------------------
+void ORptFilter::insertFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > & _xFunction)
+{
+ m_aFunctions.insert(TGroupFunctionMap::value_type(_xFunction->getName(),_xFunction));
+}
+// -----------------------------------------------------------------------------
+SvXMLImportContext* ORptFilter::CreateMetaContext(const ::rtl::OUString& rLocalName,const uno::Reference<xml::sax::XAttributeList>&)
+{
+ SvXMLImportContext* pContext = NULL;
+
+ if ( (getImportFlags() & IMPORT_META) )
+ {
+ uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
+ getServiceFactory()->createInstance(::rtl::OUString::createFromAscii(
+ "com.sun.star.xml.dom.SAXDocumentBuilder")),
+ uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW);
+ pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties(), xDocBuilder);
+ }
+ return pContext;
+}
+// -----------------------------------------------------------------------------
+sal_Bool ORptFilter::isOldFormat() const
+{
+ sal_Bool bOldFormat = sal_True;
+ uno::Reference<beans::XPropertySet> xProp = getImportInfo();
+ if ( xProp.is() )
+ {
+ const static ::rtl::OUString s_sOld(RTL_CONSTASCII_USTRINGPARAM("OldFormat"));
+ if ( xProp->getPropertySetInfo()->hasPropertyByName(s_sOld))
+ {
+ xProp->getPropertyValue(s_sOld) >>= bOldFormat;
+ }
+ } // if ( xProp.is() )
+ return bOldFormat;
+}
+
+// -----------------------------------------------------------------------------
+}// rptxml
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx
new file mode 100644
index 000000000000..30837681b028
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlfilter.hxx
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_XMLFILTER_HXX
+#define RPT_XMLFILTER_HXX
+
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <osl/diagnose.h>
+#include <unotools/tempfile.hxx>
+#include <unotools/localfilehelper.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+#include <xmloff/xmlimp.hxx>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/sequence.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <memory>
+#include <boost/shared_ptr.hpp>
+#include <xmloff/prhdlfac.hxx>
+#include <xmloff/xmlprmap.hxx>
+
+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);
+ DECLARE_STL_USTRINGACCESS_MAP( Reference<XFunction> ,TGroupFunctionMap);
+private:
+
+ TGroupFunctionMap m_aFunctions;
+ 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_Bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
+
+ SvXMLImportContext* CreateStylesContext(const ::rtl::OUString& rLocalName,
+ const Reference< XAttributeList>& xAttrList, sal_Bool bIsAutoStyle );
+ SvXMLImportContext* CreateMetaContext(const ::rtl::OUString& rLocalName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+ 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);
+ /** inserts a new function
+ *
+ * \param _xFunction
+ */
+ void insertFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction > & _xFunction);
+ void removeFunction(const ::rtl::OUString& _sFunctionName);
+ inline const TGroupFunctionMap& getFunctions() const { return m_aFunctions; }
+
+ virtual SvXMLImport& getGlobalContext();
+
+ virtual void enterEventContext();
+ virtual void leaveEventContext();
+
+ sal_Bool isOldFormat() const;
+};
+
+/** 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);
+};
+
+/** Imports only meta data
+ * \ingroup reportdesign_source_filter_xml
+ *
+ */
+class ORptMetaImportHelper
+{
+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..3d7a36c3ffaf
--- /dev/null
+++ b/reportdesign/source/filter/xml/xmlservices.cxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include <cppuhelper/factory.hxx>
+#include <osl/diagnose.h>
+#include <cppuhelper/implementationentry.hxx>
+#include "xmlfilter.hxx"
+#include "xmlExport.hxx"
+#include "dbloader2.hxx"
+#include "xmlExportDocumentHandler.hxx"
+#include "xmlImportDocumentHandler.hxx"
+
+
+/********************************************************************************************/
+
+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 },
+ { &ORptMetaExportHelper::create, &ORptMetaExportHelper::getImplementationName_Static, &ORptMetaExportHelper::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 },
+ { &ExportDocumentHandler::create, &ExportDocumentHandler::getImplementationName_Static, &ExportDocumentHandler::getSupportedServiceNames_static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ImportDocumentHandler::create, &ImportDocumentHandler::getImplementationName_Static, &ImportDocumentHandler::getSupportedServiceNames_static,
+ &cppu::createSingleComponentFactory, 0, 0 },
+ { &ORptMetaImportHelper::create, &ORptMetaImportHelper::getImplementationName_Static, &ORptMetaImportHelper::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;
+}
diff --git a/reportdesign/source/inc/GroupProperties.hxx b/reportdesign/source/inc/GroupProperties.hxx
new file mode 100644
index 000000000000..d1614661df59
--- /dev/null
+++ b/reportdesign/source/inc/GroupProperties.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_SHARED_GROUPS_PROPERTIES_HXX
+#define RPT_SHARED_GROUPS_PROPERTIES_HXX
+
+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..42f9dd829ad4
--- /dev/null
+++ b/reportdesign/source/inc/corestrings.hrc
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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..a84d299901da
--- /dev/null
+++ b/reportdesign/source/inc/stringconstants.hrc
@@ -0,0 +1,288 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _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);
+DECLARE_CONSTASCII_USTRING(SERVICE_OLEOBJECT);
+//============================================================
+//= 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_FONTDESCRIPTORASIAN );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTORCOMPLEX);
+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_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_TIME_STATE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_DATE_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_FONT);
+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_CHAREMPHASISASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTNAMEASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAMEASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILYASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSETASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCHASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARHEIGHTASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINEASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWEIGHTASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARPOSTUREASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWORDMODEASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARROTATIONASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTHASIAN);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARLOCALEASIAN);
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHAREMPHASISCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTNAMECOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAMECOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILYCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSETCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCHCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARHEIGHTCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINECOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWEIGHTCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARPOSTURECOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARWORDMODECOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARROTATIONCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTHCOMPLEX);
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARLOCALECOMPLEX );
+
+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_DATASOURCENAME );
+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_TEXT );
+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_OPAQUE );
+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_SCALEMODE );
+
+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 );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_ORDER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_APPLYFILTER );
+DECLARE_CONSTASCII_USTRING(PROPERTY_MAXROWS );
+
+//============================================================
+//= 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..84807be6904e
--- /dev/null
+++ b/reportdesign/source/inc/uistrings.hrc
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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 );
+DECLARE_CONSTASCII_USTRING(DBOVERLAPPEDCONTROL );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FORMULALIST );
+DECLARE_CONSTASCII_USTRING(PROPERTY_SCOPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_CHARTTYPE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_PREVIEW_COUNT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_TITLE );
+DECLARE_CONSTASCII_USTRING(PROPERTY_AREA );
+
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLCOLOR );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLGRADIENT );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLGRADIENTNAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLHATCHNAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLBITMAPNAME );
+DECLARE_CONSTASCII_USTRING(PROPERTY_FILLSTYLE );
+DECLARE_CONSTASCII_USTRING(DBTEXTBOXBOUNDCONTENT );
+
+}
+
+#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..3f4a6f216174
--- /dev/null
+++ b/reportdesign/source/inc/xmlstrings.hrc
@@ -0,0 +1,56 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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(SERVICE_METAIMPORTER);
+
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERLEFT);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERRIGHT);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERTOP);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_BORDERBOTTOM);
+ DECLARE_CONSTASCII_USTRING(PROPERTY_OLDFORMAT);
+}
+
+#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..fec7a3695047
--- /dev/null
+++ b/reportdesign/source/shared/corestrings.cxx
@@ -0,0 +1,35 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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..e399649bc825
--- /dev/null
+++ b/reportdesign/source/shared/makefile.mk
@@ -0,0 +1,67 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+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..edfa0fab7083
--- /dev/null
+++ b/reportdesign/source/shared/stringconstants.cxx
@@ -0,0 +1,276 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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");
+IMPLEMENT_CONSTASCII_USTRING(SERVICE_OLEOBJECT , "com.sun.star.report.OleObject");
+
+//============================================================
+//= 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_FONTDESCRIPTORASIAN , "FontDescriptorAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTDESCRIPTORCOMPLEX , "FontDescriptorComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLTEXTEMPHASISMARK , "ControlTextEmphasis");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARRELIEF , "CharRelief");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARCOLOR , "CharColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VERTICALALIGN , "VerticalAlign");
+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_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_TIME_STATE , "TimeState");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATE_STATE , "DateState");
+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_FONT, "FontDescriptor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTNAME, "FontName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTORIENTATION, "CharRotation");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTPITCH, "CharFontPitch");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONTSLANT, "FontSlant");
+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");
+
+// Asian
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHAREMPHASISASIAN, "CharEmphasisAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTNAMEASIAN, "CharFontNameAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAMEASIAN, "CharFontStyleNameAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILYASIAN, "CharFontFamilyAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSETASIAN, "CharFontCharSetAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCHASIAN, "CharFontPitchAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARHEIGHTASIAN, "CharHeightAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINEASIAN, "CharUnderlineAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWEIGHTASIAN, "CharWeightAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARPOSTUREASIAN, "CharPostureAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWORDMODEASIAN, "CharWordModeAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARROTATIONASIAN, "CharRotationAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTHASIAN, "CharScaleWidthAsian");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARLOCALEASIAN, "CharLocaleAsian");
+
+// Complex
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHAREMPHASISCOMPLEX, "CharEmphasisComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTNAMECOMPLEX, "CharFontNameComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTSTYLENAMECOMPLEX, "CharFontStyleNameComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTFAMILYCOMPLEX, "CharFontFamilyComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTCHARSETCOMPLEX, "CharFontCharSetComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARFONTPITCHCOMPLEX, "CharFontPitchComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARHEIGHTCOMPLEX, "CharHeightComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARUNDERLINECOMPLEX, "CharUnderlineComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWEIGHTCOMPLEX, "CharWeightComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARPOSTURECOMPLEX, "CharPostureComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARWORDMODECOMPLEX, "CharWordModeComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARROTATIONCOMPLEX, "CharRotationComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARSCALEWIDTHCOMPLEX, "CharScaleWidthComplex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARLOCALECOMPLEX, "CharLocaleComplex");
+
+
+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_DATASOURCENAME, "DataSourceName");
+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_TEXT, "Text");
+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_OPAQUE, "Opaque");
+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_SCALEMODE , "ScaleMode");
+
+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");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ORDER, "Order");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_APPLYFILTER, "ApplyFilter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXROWS, "MaxRows");
diff --git a/reportdesign/source/shared/uistrings.cxx b/reportdesign/source/shared/uistrings.cxx
new file mode 100644
index 000000000000..4a8cdf37ab1a
--- /dev/null
+++ b/reportdesign/source/shared/uistrings.cxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "uistrings.hrc"
+
+namespace rptui
+{
+#include "stringconstants.cxx"
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REPORTNAME , "ReportName");
+ IMPLEMENT_CONSTASCII_USTRING(CFG_REPORTDESIGNER , "SunReportBuilder");
+ 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");
+ IMPLEMENT_CONSTASCII_USTRING(DBOVERLAPPEDCONTROL , "OverlappedControl");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMULALIST , "FormulaList");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCOPE , "Scope");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CHARTTYPE , "ChartType");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PREVIEW_COUNT , "RowLimit");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TITLE , "Title");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_AREA , "Area");
+
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLCOLOR , "FillColor");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLGRADIENT , "FillGradient");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLGRADIENTNAME , "FillGradientName");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLHATCHNAME , "FillHatchName");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLBITMAPNAME , "FillBitmapName");
+ IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLSTYLE , "FillStyle");
+
+ IMPLEMENT_CONSTASCII_USTRING(DBTEXTBOXBOUNDCONTENT , "TextBoxBoundContent");
+}
diff --git a/reportdesign/source/shared/xmlstrings.cxx b/reportdesign/source/shared/xmlstrings.cxx
new file mode 100644
index 000000000000..9c6ef829b95a
--- /dev/null
+++ b/reportdesign/source/shared/xmlstrings.cxx
@@ -0,0 +1,45 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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(SERVICE_METAIMPORTER , "com.sun.star.comp.Report.XMLOasisMetaImporter");
+
+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..11de48113cee
--- /dev/null
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -0,0 +1,574 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "AddField.hxx"
+#include "UITools.hxx"
+#include <svx/dbaexchange.hxx>
+#include <svx/svdpagv.hxx>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/i18n/XCollator.hpp>
+
+#include <vcl/waitobj.hxx>
+#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
+#include <comphelper/stl_types.hxx>
+#include "rptui_slotid.hrc"
+
+#include <connectivity/dbtools.hxx>
+#include "helpids.hrc"
+#include "RptResId.hrc"
+#include "CondFormat.hrc"
+#include "ModuleHelper.hxx"
+#include "uistrings.hrc"
+#include "ColumnInfo.hxx"
+
+#include <comphelper/property.hxx>
+#include <svtools/imgdef.hxx>
+
+namespace rptui
+{
+const long STD_WIN_SIZE_X = 180;
+const long STD_WIN_SIZE_Y = 320;
+
+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 > getSelectedFieldDescriptors();
+
+protected:
+ // DragSourceHelper
+ virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
+
+private:
+ using SvTreeListBox::ExecuteDrop;
+};
+// -----------------------------------------------------------------------------
+uno::Sequence< beans::PropertyValue > OAddFieldWindowListBox::getSelectedFieldDescriptors()
+{
+ 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_TABSTOP|WB_BORDER|WB_SORT )
+ ,m_pTabWin( _pParent )
+{
+ DBG_CTOR( rpt_OAddFieldWindowListBox,NULL);
+ SetHelpId( HID_RPT_FIELD_SEL );
+ SetSelectionMode(MULTIPLE_SELECTION);
+ SetDragDropMode( 0xFFFF );
+ 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;
+}
+
+//------------------------------------------------------------------------------
+void OAddFieldWindowListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ )
+{
+ if ( GetSelectionCount() < 1 )
+ // no drag without a field
+ return;
+
+ OMultiColumnTransferable* pDataContainer = new OMultiColumnTransferable(getSelectedFieldDescriptors());
+ Reference< XTransferable> xEnsureDelete = pDataContainer;
+
+ EndSelection();
+ pDataContainer->StartDrag( this, DND_ACTION_COPYMOVE | DND_ACTION_LINK );
+}
+//========================================================================
+// class OAddFieldWindow
+//========================================================================
+DBG_NAME( rpt_OAddFieldWindow );
+//-----------------------------------------------------------------------
+OAddFieldWindow::OAddFieldWindow(Window* pParent
+ ,const uno::Reference< beans::XPropertySet >& _xRowSet
+ )
+ :FloatingWindow(pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE))
+ ,::comphelper::OPropertyChangeListener(m_aMutex)
+ ,::comphelper::OContainerListener(m_aMutex)
+ ,m_xRowSet(_xRowSet)
+ ,m_aActions(this,ModuleRes(RID_TB_SORTING))
+ ,m_pListBox(new OAddFieldWindowListBox( this ))
+ ,m_aFixedLine(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) )
+ ,m_aHelpText(this, ModuleRes(ADDFIELD_HELP_FIELD) )
+ ,m_aInsertButton(this, WB_TABSTOP|WB_CENTER)
+ ,m_nCommandType(0)
+ ,m_bEscapeProcessing(sal_False)
+ ,m_pChangeListener(NULL)
+ ,m_pContainerListener(NULL)
+{
+ DBG_CTOR( rpt_OAddFieldWindow,NULL);
+ SetHelpId( HID_RPT_FIELD_SEL_WIN );
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
+ SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
+
+ m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING);
+ m_aActions.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
+
+ m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
+ setToolBox(&m_aActions);
+ m_aActions.CheckItem(SID_FM_SORTUP);
+ m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, FALSE);
+
+ m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
+ m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) );
+ m_pListBox->SetDeselectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) );
+ m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
+ m_pListBox->Show();
+ const String sTitle(ModuleRes(RID_STR_INSERT));
+ m_aInsertButton.SetText(sTitle);
+ m_aInsertButton.SetClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
+ m_aInsertButton.Show();
+
+ m_aFixedLine.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
+ m_aHelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
+
+ SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
+ //Show();
+
+ if ( m_xRowSet.is() )
+ {
+ try
+ {
+ // be notified when the settings of report definition change
+ m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer( this, m_xRowSet );
+ 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_pListBox.get() )
+ {
+ SvLBoxTreeList* pModel = m_pListBox->GetModel();
+ ULONG nCount = pModel->GetEntryCount();
+ for(ULONG i = 0; i< nCount;++i)
+ {
+ delete static_cast<ColumnInfo*>(pModel->GetEntry(i)->GetUserData());
+ }
+ }
+ if (m_pChangeListener.is())
+ m_pChangeListener->dispose();
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+ DBG_DTOR( rpt_OAddFieldWindow,NULL);
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::GetFocus()
+{
+ if ( m_pListBox.get() )
+ m_pListBox->GrabFocus();
+ else
+ FloatingWindow::GetFocus();
+}
+//-----------------------------------------------------------------------
+uno::Sequence< beans::PropertyValue > OAddFieldWindow::getSelectedFieldDescriptors()
+{
+ return m_pListBox->getSelectedFieldDescriptors();
+}
+
+//-----------------------------------------------------------------------
+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 ( m_aCreateLink.IsSet() )
+ {
+ m_aCreateLink.Call(this);
+ return 1;
+ }
+ }
+ }
+
+ return FloatingWindow::PreNotify( _rNEvt );
+}
+//-----------------------------------------------------------------------
+void OAddFieldWindow::_propertyChanged( const beans::PropertyChangeEvent& _evt ) throw( uno::RuntimeException )
+{
+ OSL_ENSURE( _evt.Source == m_xRowSet, "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,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries) );
+ }
+ void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
+ {
+ uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
+ const ::rtl::OUString* pEntries = aEntries.getConstArray();
+ sal_Int32 nEntries = aEntries.getLength();
+ for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
+ xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
+ if ( sLabel.getLength() )
+ _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ else
+ _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) );
+ }
+ }
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::Update()
+{
+ if ( m_pContainerListener.is() )
+ m_pContainerListener->dispose();
+ m_pContainerListener = NULL;
+ m_xColumns.clear();
+
+ try
+ {
+ // ListBox loeschen
+ m_pListBox->Clear();
+ const USHORT nItemCount = m_aActions.GetItemCount();
+ for (USHORT j = 0; j< nItemCount; ++j)
+ {
+ m_aActions.EnableItem(m_aActions.GetItemId(j),FALSE);
+ }
+
+ String aTitle(ModuleRes(RID_STR_FIELDSELECTION));
+ SetText(aTitle);
+ if ( m_xRowSet.is() )
+ {
+ ::rtl::OUString sCommand( m_aCommandName );
+ sal_Int32 nCommandType( m_nCommandType );
+ sal_Bool bEscapeProcessing( m_bEscapeProcessing );
+ ::rtl::OUString sFilter( m_sFilter );
+
+ OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand );
+ OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nCommandType );
+ OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_ESCAPEPROCESSING ) >>= bEscapeProcessing );
+ OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_FILTER ) >>= sFilter );
+
+ m_aCommandName = sCommand;
+ m_nCommandType = nCommandType;
+ m_bEscapeProcessing = bEscapeProcessing;
+ m_sFilter = sFilter;
+
+ // add the columns to the list
+ 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 );
+ uno::Reference< container::XContainer> xContainer(m_xColumns,uno::UNO_QUERY);
+ if ( xContainer.is() )
+ m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
+ }
+
+ // add the parameter columns to the list
+ uno::Reference< ::com::sun::star::sdbc::XRowSet > xRowSet(m_xRowSet,uno::UNO_QUERY);
+ Sequence< ::rtl::OUString > aParamNames( getParameterNames( xRowSet ) );
+ lcl_addToList( *m_pListBox, aParamNames );
+
+ // set title
+ aTitle.AppendAscii(" ");
+ aTitle += m_aCommandName.getStr();
+ SetText( aTitle );
+ if ( m_aCommandName.getLength() )
+ {
+ for (USHORT i = 0; i < nItemCount; ++i)
+ {
+ m_aActions.EnableItem(m_aActions.GetItemId(i));
+ }
+ }
+ OnSelectHdl(NULL);
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//-----------------------------------------------------------------------
+void OAddFieldWindow::Resize()
+{
+ FloatingWindow::Resize();
+
+ const Size aWindowSize( GetOutputSizePixel() );
+
+
+ const Size aRelated(LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT ));
+ const Size aFixedTextSize(LogicToPixel( Size( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ), MAP_APPFONT ));
+
+ // ToolBar
+ Size aToolbarSize( m_aActions.GetSizePixel() );
+ Point aToolbarPos( aRelated.Width(), aRelated.Height());
+ m_aActions.SetPosPixel(Point(aToolbarPos.X(), aToolbarPos.Y()));
+
+ Size aLBSize( aWindowSize );
+ aLBSize.Width() -= ( 2 * aRelated.Width() );
+
+ // help text
+ const Size aHelpTextSize = m_aHelpText.CalcMinimumSize(aLBSize.Width());
+
+ // ListBox
+ Point aLBPos( aRelated.Width(), aRelated.Height() + aToolbarSize.Height() + aRelated.Height() );
+
+ aLBSize.Height() -= aToolbarSize.Height(); // Toolbar
+ aLBSize.Height() -= (6*aRelated.Height()); // 6 * gap
+ aLBSize.Height() -= aFixedTextSize.Height(); // fixed line
+ aLBSize.Height() -= aHelpTextSize.Height(); // help text
+ m_pListBox->SetPosSizePixel( aLBPos, aLBSize );
+
+ // FixedLine
+ Size aFLSize( aLBSize.Width(),aFixedTextSize.Height() );
+ Point aFLPos( aRelated.Width(), aLBPos.Y() + aLBSize.Height() + aRelated.Height());
+ m_aFixedLine.SetPosSizePixel( aFLPos, aFLSize );
+
+ // Help text
+ Point aFTPos( aRelated.Width(), aFLPos.Y() + aFLSize.Height() + aRelated.Height() );
+ m_aHelpText.SetPosSizePixel( aFTPos, aHelpTextSize );
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const
+{
+ return uno::Reference< sdbc::XConnection>(m_xRowSet->getPropertyValue( PROPERTY_ACTIVECONNECTION ),uno::UNO_QUERY);
+}
+// -----------------------------------------------------------------------------
+void OAddFieldWindow::fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor)
+{
+ if ( _pSelected && m_xColumns.is() )
+ {
+ uno::Reference<container::XChild> xChild(getConnection(),uno::UNO_QUERY);
+ if ( xChild.is( ) )
+ {
+ uno::Reference<sdb::XDocumentDataSource> xDocument( xChild->getParent(), uno::UNO_QUERY );
+ if ( xDocument.is() )
+ {
+ uno::Reference<frame::XModel> xModel(xDocument->getDatabaseDocument(),uno::UNO_QUERY);
+ if ( xModel.is() )
+ _rDescriptor[ daDatabaseLocation ] <<= xModel->getURL();
+ } // if ( xDocument.is() )
+ }
+
+ _rDescriptor[ ::svx::daCommand ] <<= GetCommand();
+ _rDescriptor[ ::svx::daCommandType ] <<= GetCommandType();
+ _rDescriptor[ ::svx::daEscapeProcessing ] <<= GetEscapeProcessing();
+ _rDescriptor[ ::svx::daConnection ] <<= getConnection();
+
+ ColumnInfo* pInfo = static_cast<ColumnInfo*>(_pSelected->GetUserData());
+ // ::rtl::OUString sColumnName = m_pListBox->GetEntryText( _pSelected );
+ _rDescriptor[ ::svx::daColumnName ] <<= pInfo->sColumnName;
+ if ( m_xColumns->hasByName( pInfo->sColumnName ) )
+ _rDescriptor[ ::svx::daColumnObject ] <<= m_xColumns->getByName(pInfo->sColumnName);
+ }
+}
+// -----------------------------------------------------------------------------
+void OAddFieldWindow::_elementInserted( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pListBox.get() )
+ {
+ ::rtl::OUString sName;
+ if ( (_rEvent.Accessor >>= sName) && m_xColumns->hasByName(sName) )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(m_xColumns->getByName(sName),UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
+ xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
+ if ( sLabel.getLength() )
+ m_pListBox->InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) );
+ else
+ m_pListBox->InsertEntry( sName,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) );
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OAddFieldWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pListBox.get() )
+ {
+ m_pListBox->Clear();
+ if ( m_xColumns.is() )
+ lcl_addToList( *m_pListBox, m_xColumns );
+ }
+}
+// -----------------------------------------------------------------------------
+void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException)
+{
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OAddFieldWindow, OnSelectHdl, void* ,/*_pAddFieldDlg*/)
+{
+ m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 ));
+
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OAddFieldWindow, OnDoubleClickHdl, void* ,/*_pAddFieldDlg*/)
+{
+ if ( m_aCreateLink.IsSet() )
+ m_aCreateLink.Call(this);
+
+ return 0L;
+}
+//------------------------------------------------------------------------------
+ImageList OAddFieldWindow::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const
+{
+ sal_Int16 nN = IMG_ADDFIELD_DLG_SC;
+ sal_Int16 nH = IMG_ADDFIELD_DLG_SCH;
+ if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE )
+ {
+ nN = IMG_ADDFIELD_DLG_LC;
+ nH = IMG_ADDFIELD_DLG_LCH;
+ }
+ return ImageList(ModuleRes( _bHiContast ? nH : nN ));
+}
+//------------------------------------------------------------------
+void OAddFieldWindow::resizeControls(const Size& _rDiff)
+{
+ // we use large images so we must change them
+ if ( _rDiff.Width() || _rDiff.Height() )
+ {
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------
+IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ )
+{
+ const USHORT nCurItem = m_aActions.GetCurItemId();
+ if ( SID_ADD_CONTROL_PAIR == nCurItem )
+ OnDoubleClickHdl(NULL);
+ else
+ {
+ if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) )
+ {
+ const USHORT nItemCount = m_aActions.GetItemCount();
+ for (USHORT j = 0; j< nItemCount; ++j)
+ {
+ const USHORT nItemId = m_aActions.GetItemId(j);
+ if ( nCurItem != nItemId )
+ m_aActions.CheckItem(nItemId,FALSE);
+ }
+ SvSortMode eSortMode = SortNone;
+ if ( SID_FM_REMOVE_FILTER_SORT != nCurItem )
+ {
+ m_aActions.CheckItem(nCurItem,!m_aActions.IsItemChecked(nCurItem));
+ if ( m_aActions.IsItemChecked(SID_FM_SORTUP) )
+ eSortMode = SortAscending;
+ else if ( m_aActions.IsItemChecked(SID_FM_SORTDOWN) )
+ eSortMode = SortDescending;
+ } // if ( SID_FM_REMOVE_FILTER_SORT != nCurItem )
+
+ m_pListBox->GetModel()->SetSortMode(eSortMode);
+ if ( SID_FM_REMOVE_FILTER_SORT == nCurItem )
+ Update();
+
+ m_pListBox->GetModel()->Resort();
+ }
+ }
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
new file mode 100644
index 000000000000..d3617749d10b
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -0,0 +1,625 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 === **/
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+/** === 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>
+#include "UndoActions.hxx"
+
+// .............................................................................
+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
+ //========================================================================
+ DBG_NAME(rpt_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 )
+ {
+ DBG_CTOR(rpt_ConditionalFormattingDialog,NULL);
+ 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();
+ DBG_DTOR(rpt_ConditionalFormattingDialog,NULL);
+ }
+
+ // -----------------------------------------------------------------------------
+ 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( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) );
+ UndoManagerListAction aListAction(*m_rController.getUndoMgr(),sUndoAction);
+ 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;
+ }
+ }
+ 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..89e0e1b88246
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.hrc
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_CONDFORMAT_HRC
+#define RPTUI_CONDFORMAT_HRC
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_WIDTH 60
+#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 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 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..14fe6649aff1
--- /dev/null
+++ b/reportdesign/source/ui/dlg/CondFormat.src
@@ -0,0 +1,445 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "CondFormat.hrc"
+#include "RptResId.hrc"
+#include "helpids.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#include "rptui_slotid.hrc"
+
+Control WIN_CONDITION
+{
+ Size = MAP_APPFONT ( CONDITION_WIDTH , CONDITION_HEIGHT ) ;
+ HelpId = HID_RPT_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 [ 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 [ 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 [ 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_RPT_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_RPT_CRTL_FORMAT_PREVIEW;
+ 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 [ en-US ] = "Conditional Formatting" ;
+ HelpId = HID_RPT_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 [ 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 [ en-US ] = "Condition $number$";
+};
+
+String STR_COLOR_WHITE
+{
+ Text [ en-US ] = "White" ;
+};
+String STR_CHARCOLOR
+{
+ Text [ en-US ] = "Font color" ;
+};
+String STR_CHARBACKGROUND
+{
+ Text [ en-US ] = "Background";
+};
+String STR_TRANSPARENT
+{
+ Text [ en-US ] = "No Fill" ;
+};
+
+#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;
+
+};
+
+ToolBox RID_TB_SORTING
+{
+ Pos = MAP_APPFONT ( 0,0 ) ;
+ ButtonType = BUTTON_SYMBOL;
+ Align = BOXALIGN_TOP;
+ Customize = FALSE;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_FM_SORTUP;
+ Text [ en-US ] = "Sort Ascending" ;
+ Checkable = TRUE;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_FM_SORTDOWN;
+ Text [ en-US ] = "Sort Descending" ;
+ Checkable = TRUE;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_FM_REMOVE_FILTER_SORT;
+ Text [ en-US ] = "Remove sorting" ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_ADD_CONTROL_PAIR;
+ Text [ en-US ] = "Insert" ;
+ };
+ };
+};
+
+ImageList IMG_ADDFIELD_DLG_SC
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/sc_sortup.png" ; SID_FM_SORTUP ; > ;
+ < "res/commandimagelist/sc_sortdown.png" ; SID_FM_SORTDOWN ; > ;
+ < "res/commandimagelist/sc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ;
+ };
+};
+
+ImageList IMG_ADDFIELD_DLG_SCH
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/sch_sortup.png" ; SID_FM_SORTUP ; > ;
+ < "res/commandimagelist/sch_sortdown.png" ; SID_FM_SORTDOWN ; > ;
+ < "res/commandimagelist/sch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ;
+ };
+};
+
+ImageList IMG_ADDFIELD_DLG_LC
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/lc_sortup.png" ; SID_FM_SORTUP ; > ;
+ < "res/commandimagelist/lc_sortdown.png" ; SID_FM_SORTDOWN ; > ;
+ < "res/commandimagelist/lc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ;
+ };
+};
+
+ImageList IMG_ADDFIELD_DLG_LCH
+{
+ MASKCOLOR;
+ FileList =
+ {
+ < "res/commandimagelist/lch_sortup.png" ; SID_FM_SORTUP ; > ;
+ < "res/commandimagelist/lch_sortdown.png" ; SID_FM_SORTDOWN ; > ;
+ < "res/commandimagelist/lch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ;
+ };
+};
+
+FixedLine ADDFIELD_FL_HELP_SEPARATOR
+{
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ Text [ en-US ] = "Help";
+};
+
+FixedText ADDFIELD_HELP_FIELD
+{
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ Size = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS ) ;
+ WordBreak = TRUE;
+ Text [ en-US ] = "Highlight the fields to insert into the selected section of the template, then click Insert or press Enter.";
+};
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
new file mode 100644
index 000000000000..e3591ae03534
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -0,0 +1,740 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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"
+#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/ui/ImageType.hpp>
+
+#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 <unotools/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;
+
+ConditionField::ConditionField( Condition* _pParent, const ResId& _rResId ) : Edit(_pParent,_rResId)
+,m_pParent(_pParent)
+,m_aFormula(this)
+{
+ m_pSubEdit = new Edit(this,0);
+ SetSubEdit(m_pSubEdit);
+ m_pSubEdit->EnableRTL( FALSE );
+ m_pSubEdit->SetPosPixel( Point() );
+
+ m_aFormula.SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("...")));
+ m_aFormula.SetClickHdl( LINK( this, ConditionField, OnFormula ) );
+ m_aFormula.Show();
+ m_pSubEdit->Show();
+ Resize();
+}
+// -----------------------------------------------------------------------------
+ConditionField::~ConditionField()
+{
+ SetSubEdit(NULL);
+ delete m_pSubEdit;
+}
+// -----------------------------------------------------------------------------
+void ConditionField::Resize()
+{
+ Edit::Resize();
+ const Size aSize = GetOutputSizePixel();
+ const Size aButtonSize( LogicToPixel( Size( 12, 0 ), MAP_APPFONT ).Width(),aSize.Height());
+ const Point aButtonPos(aSize.Width() - aButtonSize.Width(), 0);
+ m_aFormula.SetPosSizePixel(aButtonPos,aButtonSize);
+ m_pSubEdit->SetPosSizePixel(Point(0,0),Size(aButtonPos.X() ,aSize.Height()));
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( ConditionField, OnFormula, Button*, /*_pClickedButton*/ )
+{
+ ::rtl::OUString sFormula(m_pSubEdit->GetText());
+ const sal_Int32 nLen = sFormula.getLength();
+ if ( nLen )
+ {
+ ReportFormula aFormula( sFormula );
+ sFormula = aFormula.getCompleteFormula();
+ } // if ( nLen )
+ uno::Reference< awt::XWindow> xInspectorWindow = VCLUnoHelper::GetInterface(this);
+ uno::Reference< beans::XPropertySet> xProp(m_pParent->getController().getRowSet(),uno::UNO_QUERY);
+ if ( rptui::openDialogFormula_nothrow( sFormula, m_pParent->getController().getContext(),xInspectorWindow,xProp ) )
+ {
+ ReportFormula aFormula( sFormula );
+ m_pSubEdit->SetText(aFormula.getUndecoratedContent());
+ }
+ return 0L;
+}
+//========================================================================
+// 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;
+}
+
+// =============================================================================
+// = 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_aMoveUp.SetModeImage( ModuleRes( IMG_MOVE_UP_HC ), BMP_COLOR_HIGHCONTRAST );
+ m_aMoveDown.SetModeImage( ModuleRes( IMG_MOVE_DOWN_HC ), BMP_COLOR_HIGHCONTRAST );
+
+ FreeResource();
+ 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 );
+
+ Show();
+
+ impl_layoutAll();
+
+ ConditionalExpressionFactory::getKnownConditionalExpressions( m_aConditionalExpressions );
+}
+
+// -----------------------------------------------------------------------------
+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
+ const Rectangle aCondTypeRect( m_aConditionType.GetPosPixel(), m_aConditionType.GetSizePixel() );
+ const Point aOpListPos( aCondTypeRect.Right() + aRelatedControls.Width(), aCondTypeRect.Top() );
+ const 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
+ const Point aOpGluePos( aLHSPos.X() + aLHSSize.Width() + aRelatedControls.Width(), aLHSPos.Y() );
+ const 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
+ const Point aRHSPos( aOpGluePos.X() + aOpGlueSize.Width() + aRelatedControls.Width(), aOpGluePos.Y() );
+ const 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
+ eType = eExpression;
+ 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 ( ConditionalExpressions::const_iterator exp = m_aConditionalExpressions.begin();
+ exp != m_aConditionalExpressions.end();
+ ++exp
+ )
+ {
+ if ( exp->second->matchExpression( sExpression, sUnprefixedFieldContent, sLHS, sRHS ) )
+ {
+ eType = eFieldValueComparison;
+ eOperation = exp->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() );
+
+ PConditionalExpression pFactory( m_aConditionalExpressions[ 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..12517480b3b5
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Condition.hxx
@@ -0,0 +1,198 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_CONDITION_HXX
+#define RPTUI_CONDITION_HXX
+
+#include "conditionalexpression.hxx"
+
+#include <com/sun/star/report/XFormatCondition.hpp>
+
+#include <dbaccess/ToolBoxHelper.hxx>
+
+#include <svx/fntctrl.hxx>
+
+#include <svtools/valueset.hxx>
+
+#include <vcl/fixed.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#include <vcl/button.hxx>
+#include <vcl/toolbox.hxx>
+
+#include <memory>
+
+namespace svx { class ToolboxButtonColorUpdater; }
+
+namespace rptui
+{
+ class ConditionalFormattingDialog;
+ class OColorPopup;
+ class OReportController;
+ class IConditionalFormatAction;
+ class Condition;
+
+ class ConditionField : public Edit
+ {
+ Condition* m_pParent;
+ Edit* m_pSubEdit;
+ PushButton m_aFormula;
+
+ DECL_LINK( OnFormula, Button* );
+ public:
+ ConditionField( Condition* pParent, const ResId& rResId );
+ virtual ~ConditionField();
+ virtual void Resize();
+ };
+
+ //========================================================================
+ //= Condition
+ //========================================================================
+ class Condition :public Control
+ ,public dbaui::OToolBoxHelper
+ {
+ ::rptui::OReportController& m_rController;
+ IConditionalFormatAction& m_rAction;
+ FixedLine m_aHeader;
+ ListBox m_aConditionType;
+ ListBox m_aOperationList;
+ ConditionField m_aCondLHS;
+ FixedText m_aOperandGlue;
+ ConditionField 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;
+
+ ConditionalExpressions m_aConditionalExpressions;
+
+ 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 );
+
+ inline ::rptui::OReportController& getController() const { return m_rController; }
+
+ 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..e2180098af0c
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.cxx
@@ -0,0 +1,273 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "DateTime.hxx"
+#ifndef RPTUI_DATETIME_HRC
+#include "DateTime.hrc"
+#endif
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <tools/debug.hxx>
+#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
+#include <vcl/msgbox.hxx>
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#include <connectivity/dbconversion.hxx>
+#include <unotools/syslocale.hxx>
+#ifndef RPTUI_TOOLS_HXX
+#include "UITools.hxx"
+#endif
+#include "RptDef.hxx"
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#include "ReportController.hxx"
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/util/NumberFormat.hpp>
+#include <com/sun/star/util/XNumberFormatPreviewer.hpp>
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#include <com/sun/star/i18n/NumberFormatIndex.hpp>
+#include <comphelper/numbers.hxx>
+#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_aDate(this, ModuleRes(CB_DATE ) )
+ ,m_aFTDateFormat(this, ModuleRes(FT_DATE_FORMAT ) )
+ ,m_aDateListBox(this, ModuleRes(LB_DATE_TYPE ) )
+ ,m_aFL0(this, ModuleRes(FL_SEPARATOR0 ) )
+ ,m_aTime(this, ModuleRes(CB_TIME ) )
+ ,m_aFTTimeFormat(this, ModuleRes(FT_TIME_FORMAT ) )
+ ,m_aTimeListBox(this, ModuleRes(LB_TIME_TYPE ) )
+ ,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_aDateControlling()
+ ,m_aTimeControlling()
+ ,m_pController(_pController)
+ ,m_xHoldAlive(_xHoldAlive)
+{
+ DBG_CTOR( rpt_ODateTimeDialog,NULL);
+
+ try
+ {
+ SvtSysLocale aSysLocale;
+ m_nLocale = aSysLocale.GetLocaleData().getLocale();
+ // Fill listbox with all well known date types
+ InsertEntry(util::NumberFormat::DATE);
+ InsertEntry(util::NumberFormat::TIME);
+ }
+ catch(uno::Exception&)
+ {
+ }
+
+ m_aDateListBox.SetDropDownLineCount(20);
+ m_aDateListBox.SelectEntryPos(0);
+
+ m_aTimeListBox.SetDropDownLineCount(20);
+ m_aTimeListBox.SelectEntryPos(0);
+
+ // use nice enhancement, to toggle enable/disable if a checkbox is checked or not
+ m_aDateControlling.enableOnCheckMark( m_aDate, m_aFTDateFormat, m_aDateListBox);
+ m_aTimeControlling.enableOnCheckMark( m_aTime, m_aFTTimeFormat, m_aTimeListBox);
+
+ 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();
+}
+// -----------------------------------------------------------------------------
+ void ODateTimeDialog::InsertEntry(sal_Int16 _nNumberFormatId)
+ {
+ const bool bTime = util::NumberFormat::TIME == _nNumberFormatId;
+ ListBox* pListBox = &m_aDateListBox;
+ if ( bTime )
+ pListBox = &m_aTimeListBox;
+
+ const uno::Reference< util::XNumberFormatter> xNumberFormatter = m_pController->getReportNumberFormatter();
+ const uno::Reference< util::XNumberFormats> xFormats = xNumberFormatter->getNumberFormatsSupplier()->getNumberFormats();
+ const uno::Sequence<sal_Int32> aFormatKeys = xFormats->queryKeys(_nNumberFormatId,m_nLocale,sal_True);
+ const sal_Int32* pIter = aFormatKeys.getConstArray();
+ const sal_Int32* pEnd = pIter + aFormatKeys.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ const sal_Int16 nPos = pListBox->InsertEntry(getFormatStringByKey(*pIter,xFormats,bTime));
+ pListBox->SetEntryData(nPos, reinterpret_cast<void*>(*pIter));
+ }
+ }
+//------------------------------------------------------------------------
+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( 6 );
+ aValues[nLength].Name = PROPERTY_SECTION;
+ aValues[nLength++].Value <<= m_xHoldAlive;
+
+ aValues[nLength].Name = PROPERTY_TIME_STATE;
+ aValues[nLength++].Value <<= m_aTime.IsChecked();
+
+ aValues[nLength].Name = PROPERTY_DATE_STATE;
+ aValues[nLength++].Value <<= m_aDate.IsChecked();
+
+ aValues[nLength].Name = PROPERTY_FORMATKEYDATE;
+ aValues[nLength++].Value <<= getFormatKey(sal_True);
+
+ aValues[nLength].Name = PROPERTY_FORMATKEYTIME;
+ aValues[nLength++].Value <<= getFormatKey(sal_False);
+
+ sal_Int32 nWidth = 0;
+ if ( m_aDate.IsChecked() )
+ {
+ String sDateFormat = m_aDateListBox.GetEntry( m_aDateListBox.GetSelectEntryPos() );
+ nWidth = LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MAP_100TH_MM);
+ }
+ if ( m_aTime.IsChecked() )
+ {
+ String sDateFormat = m_aTimeListBox.GetEntry( m_aTimeListBox.GetSelectEntryPos() );
+ nWidth = ::std::max<sal_Int32>(LogicToLogic(PixelToLogic(Size(GetCtrlTextWidth(sDateFormat),0)).Width(),GetMapMode().GetMapUnit(),MAP_100TH_MM),nWidth);
+ }
+
+ if ( nWidth > 4000 )
+ {
+ aValues[nLength].Name = PROPERTY_WIDTH;
+ aValues[nLength++].Value <<= nWidth;
+ }
+
+ m_pController->executeChecked(SID_DATETIME,aValues);
+ }
+ catch(uno::Exception&)
+ {
+ nRet = RET_NO;
+ }
+ }
+ return nRet;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString ODateTimeDialog::getFormatStringByKey(::sal_Int32 _nNumberFormatKey,const uno::Reference< util::XNumberFormats>& _xFormats,bool _bTime)
+{
+ uno::Reference< beans::XPropertySet> xFormSet = _xFormats->getByKey(_nNumberFormatKey);
+ OSL_ENSURE(xFormSet.is(),"XPropertySet is null!");
+ ::rtl::OUString sFormat;
+ xFormSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormatString"))) >>= sFormat;
+
+ double nValue = 0;
+ if ( _bTime )
+ {
+ Time aCurrentTime;
+ nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toTime(aCurrentTime.GetTime()));
+ }
+ else
+ {
+ Date aCurrentDate;
+ static ::com::sun::star::util::Date STANDARD_DB_DATE(30,12,1899);
+ nValue = ::dbtools::DBTypeConversion::toDouble(::dbtools::DBTypeConversion::toDate(static_cast<sal_Int32>(aCurrentDate.GetDate())),STANDARD_DB_DATE);
+ }
+
+ uno::Reference< util::XNumberFormatPreviewer> xPreViewer(m_pController->getReportNumberFormatter(),uno::UNO_QUERY);
+ OSL_ENSURE(xPreViewer.is(),"XNumberFormatPreviewer is null!");
+ return xPreViewer->convertNumberToPreviewString(sFormat,nValue,m_nLocale,sal_True);
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( ODateTimeDialog, CBClickHdl, CheckBox*, _pBox )
+{
+ (void)_pBox;
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+
+ if ( _pBox == &m_aDate || _pBox == &m_aTime)
+ {
+ sal_Bool bDate = m_aDate.IsChecked();
+ sal_Bool bTime = m_aTime.IsChecked();
+ if (!bDate && !bTime)
+ {
+ m_aPB_OK.Disable();
+ }
+ else
+ {
+ m_aPB_OK.Enable();
+ }
+ }
+ return 1L;
+}
+// -----------------------------------------------------------------------------
+sal_Int32 ODateTimeDialog::getFormatKey(sal_Bool _bDate) const
+{
+ DBG_CHKTHIS( rpt_ODateTimeDialog,NULL);
+ sal_Int32 nFormatKey;
+ if ( _bDate )
+ {
+ // nFormat = m_aDateF1.IsChecked() ? i18n::NumberFormatIndex::DATE_SYSTEM_LONG : (m_aDateF2.IsChecked() ? i18n::NumberFormatIndex::DATE_SYS_DMMMYYYY : i18n::NumberFormatIndex::DATE_SYSTEM_SHORT);
+ nFormatKey = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(m_aDateListBox.GetEntryData( m_aDateListBox.GetSelectEntryPos() )));
+ }
+ else
+ {
+ // nFormat = m_aTimeF1.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSS : (m_aTimeF2.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSSAMPM : i18n::NumberFormatIndex::TIME_HHMM);
+ nFormatKey = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(m_aTimeListBox.GetEntryData( m_aTimeListBox.GetSelectEntryPos() )));
+ }
+ return nFormatKey;
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/DateTime.hrc b/reportdesign/source/ui/dlg/DateTime.hrc
new file mode 100644
index 000000000000..02a421f10c18
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.hrc
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_DATETIME_HRC
+#define RPTUI_DATETIME_HRC
+
+#define CB_DATE (1)
+#define FT_DATE_FORMAT (2)
+#define LB_DATE_TYPE (3)
+#define FL_SEPARATOR0 (4)
+#define CB_TIME (5)
+#define FT_TIME_FORMAT (6)
+#define LB_TIME_TYPE (7)
+#define FL_SEPARATOR1 (8)
+#define PB_OK (9)
+#define PB_CANCEL (10)
+#define PB_HELP (11)
+
+#define CHECKBOX_HEIGHT 8
+#define FIXEDTEXT_HEIGHT 8
+#define RELATED_CONTROLS 4
+#define UNRELATED_CONTROLS 7
+#define EDIT_HEIGHT 12
+#define LISTBOX_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 (2*RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT + 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..09e557007ab4
--- /dev/null
+++ b/reportdesign/source/ui/dlg/DateTime.src
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 [ en-US ] = "Date and Time" ;
+ HelpId = HID_RPT_DATETIME_DLG;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+
+ CheckBox CB_DATE
+ {
+ HelpID = "reportdesign:CheckBox:RID_DATETIME_DLG:CB_DATE";
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS , RELATED_CONTROLS /* + UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT */) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ;
+ Check = TRUE;
+ Text [ en-US ] = "Include Date";
+ };
+
+ FixedText FT_DATE_FORMAT
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + 2*UNRELATED_CONTROLS, RELATED_CONTROLS + UNRELATED_CONTROLS + CHECKBOX_HEIGHT );
+ Size = MAP_APPFONT( BUTTON_WIDTH - RELATED_CONTROLS, FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Format";
+ };
+
+ ListBox LB_DATE_TYPE
+ {
+ HelpID = "reportdesign:ListBox:RID_DATETIME_DLG:LB_DATE_TYPE";
+ Pos = MAP_APPFONT ( 2 * UNRELATED_CONTROLS + BUTTON_WIDTH, RELATED_CONTROLS + UNRELATED_CONTROLS + CHECKBOX_HEIGHT) ;
+ Size = MAP_APPFONT( PAGE_WIDTH - 3*UNRELATED_CONTROLS - BUTTON_WIDTH, 60 );
+ Border = TRUE;
+ DropDown = TRUE;
+ TabStop = TRUE;
+ Sort = FALSE;
+ };
+
+ FixedLine FL_SEPARATOR0
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS + 2*UNRELATED_CONTROLS + CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ;
+ // Text [ en-US ] = "Time";
+ };
+ CheckBox CB_TIME
+ {
+ HelpID = "reportdesign:CheckBox:RID_DATETIME_DLG:CB_TIME";
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, RELATED_CONTROLS + 3*UNRELATED_CONTROLS + CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ;
+ Check = TRUE;
+ Text [ en-US ] = "Include Time";
+ };
+
+ FixedText FT_TIME_FORMAT
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS + 2*UNRELATED_CONTROLS, RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + LISTBOX_HEIGHT);
+ Size = MAP_APPFONT( BUTTON_WIDTH - RELATED_CONTROLS, FIXEDTEXT_HEIGHT );
+ Text [ en-US ] = "Format";
+ };
+
+ ListBox LB_TIME_TYPE
+ {
+ HelpID = "reportdesign:ListBox:RID_DATETIME_DLG:LB_TIME_TYPE";
+ Pos = MAP_APPFONT ( 2 * UNRELATED_CONTROLS + BUTTON_WIDTH, RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ;
+ Size = MAP_APPFONT( PAGE_WIDTH - 3*UNRELATED_CONTROLS - BUTTON_WIDTH, 60 );
+ Border = TRUE;
+ DropDown = TRUE;
+ TabStop = TRUE;
+ Sort = FALSE;
+ };
+ FixedLine FL_SEPARATOR1
+ {
+ Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS + 5*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT) ;
+ Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ;
+ };
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( UNRELATED_CONTROLS, RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_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 , RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_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 , RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT +1) ;
+ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ;
+ Text [ en-US ] = "~Help";
+ };
+};
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
new file mode 100644
index 000000000000..682ec6b17438
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -0,0 +1,273 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_reportdesign.hxx"
+
+
+//----------------------------------------------------------------------------
+
+#include <vcl/svapp.hxx>
+#include <vcl/mnemonic.hxx>
+#include <vcl/msgbox.hxx>
+#include <unotools/charclass.hxx>
+#include <unotools/viewoptions.hxx>
+#include <tools/urlobj.hxx>
+#include <formula/formdata.hxx>
+#include <formula/funcutl.hxx>
+#include <formula/tokenarray.hxx>
+
+#include "Formula.hxx"
+#include "AddField.hxx"
+#include "helpids.hrc"
+
+//============================================================================
+namespace rptui
+{
+ using namespace formula;
+ using namespace ::com::sun::star;
+
+// --------------------------------------------------------------------------
+// Initialisierung / gemeinsame Funktionen fuer Dialog
+// --------------------------------------------------------------------------
+
+FormulaDialog::FormulaDialog(Window* pParent
+ , const uno::Reference<lang::XMultiServiceFactory>& _xServiceFactory
+ , const ::boost::shared_ptr< IFunctionManager >& _pFunctionMgr
+ , const ::rtl::OUString& _sFormula
+ , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet)
+ : FormulaModalDialog( pParent, false,false,false,this,_pFunctionMgr.get(),this)
+ ,m_aFunctionManager(_pFunctionMgr)
+ ,m_pFormulaData(new FormEditData())
+ ,m_pAddField(NULL)
+ ,m_xRowSet(_xRowSet)
+ ,m_pEdit(NULL)
+ ,m_sFormula(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("=")))
+ ,m_nStart(0)
+ ,m_nEnd(1)
+{
+ if ( _sFormula.getLength() > 0 )
+ {
+ if ( _sFormula.getStr()[0] != '=' )
+ m_sFormula += String(_sFormula);
+ else
+ m_sFormula = _sFormula;
+ }
+ m_xParser.set(_xServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOFormulaParser"))),uno::UNO_QUERY);
+ if ( m_xParser.is() )
+ m_xOpCodeMapper = m_xParser->getFormulaOpCodeMapper();
+ fill();
+}
+
+void FormulaDialog::notifyChange()
+{
+}
+// -----------------------------------------------------------------------------
+void FormulaDialog::fill()
+{
+ SetMeText(m_sFormula);
+ Update(m_sFormula);
+ CheckMatrix(m_sFormula);
+ Update();
+}
+
+FormulaDialog::~FormulaDialog()
+{
+ if ( m_pAddField )
+ {
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( HID_RPT_FIELD_SEL_WIN ) );
+ aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pAddField->GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)).GetBuffer() ) );
+
+ ::std::auto_ptr<Window> aTemp2(m_pAddField);
+ m_pAddField = NULL;
+ }
+}
+
+// --------------------------------------------------------------------------
+// Funktionen fuer rechte Seite
+// --------------------------------------------------------------------------
+bool FormulaDialog::calculateValue( const String& rStrExp, String& rStrResult )
+{
+ rStrResult = rStrExp;
+ return false;
+}
+void FormulaDialog::doClose(BOOL _bOk)
+{
+ EndDialog(_bOk ? RET_OK : RET_CANCEL);
+}
+void FormulaDialog::insertEntryToLRUList(const IFunctionDescription* /*_pDesc*/)
+{
+}
+void FormulaDialog::showReference(const String& /*_sFormula*/)
+{
+}
+void FormulaDialog::dispatch(BOOL /*_bOK*/,BOOL /*_bMartixChecked*/)
+{
+}
+void FormulaDialog::setDispatcherLock( BOOL /*bLock*/ )
+{
+}
+void FormulaDialog::setReferenceInput(const FormEditData* /*_pData*/)
+{
+}
+void FormulaDialog::deleteFormData()
+{
+}
+void FormulaDialog::clear()
+{
+}
+void FormulaDialog::switchBack()
+{
+}
+FormEditData* FormulaDialog::getFormEditData() const
+{
+ return m_pFormulaData;
+}
+void FormulaDialog::setCurrentFormula(const String& _sReplacement)
+{
+ const xub_StrLen nOldLen = m_nEnd - m_nStart;
+ const xub_StrLen nNewLen = _sReplacement.Len();
+ if (nOldLen)
+ m_sFormula.Erase( m_nStart, nOldLen );
+ if (nNewLen)
+ m_sFormula.Insert( _sReplacement, m_nStart );
+ m_nEnd = m_nStart + nNewLen;
+}
+void FormulaDialog::setSelection(xub_StrLen _nStart,xub_StrLen _nEnd)
+{
+ if ( _nStart <= _nEnd )
+ {
+ m_nStart = _nStart;
+ m_nEnd = _nEnd;
+ }
+ else
+ {
+ m_nEnd = _nStart;
+ m_nStart = _nEnd;
+ }
+}
+void FormulaDialog::getSelection(xub_StrLen& _nStart,xub_StrLen& _nEnd) const
+{
+ _nStart = m_nStart;
+ _nEnd = m_nEnd;
+}
+String FormulaDialog::getCurrentFormula() const
+{
+ return m_sFormula;
+}
+IFunctionManager* FormulaDialog::getFunctionManager()
+{
+ return m_aFunctionManager.get();
+}
+// -----------------------------------------------------------------------------
+void FormulaDialog::ShowReference(const String& /*_sRef*/)
+{
+}
+// -----------------------------------------------------------------------------
+void FormulaDialog::HideReference( BOOL /*bDoneRefMode*/)
+{
+}
+// -----------------------------------------------------------------------------
+void FormulaDialog::ReleaseFocus( RefEdit* /*pEdit*/, RefButton* /*pButton*/)
+{
+}
+// -----------------------------------------------------------------------------
+void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton)
+{
+ ::std::pair<RefButton*,RefEdit*> aPair = RefInputStartBefore( _pEdit, _pButton );
+ m_pEdit = aPair.second;
+ if ( m_pEdit )
+ m_pEdit->Hide();
+ if ( aPair.first )
+ aPair.first->Hide();
+
+ if ( !m_pAddField )
+ {
+ m_pAddField = new OAddFieldWindow(this,m_xRowSet);
+ m_pAddField->SetCreateHdl(LINK( this, FormulaDialog, OnClickHdl ) );
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( HID_RPT_FIELD_SEL_WIN ) );
+ if ( aDlgOpt.Exists() )
+ {
+ m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
+
+ }
+
+ m_pAddField->Update();
+ } // if ( !m_pAddField )
+ RefInputStartAfter( aPair.second, aPair.first );
+ m_pAddField->Show();
+
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( FormulaDialog, OnClickHdl, OAddFieldWindow* ,_pAddFieldDlg)
+{
+ const uno::Sequence< beans::PropertyValue > aArgs = _pAddFieldDlg->getSelectedFieldDescriptors();
+ // we use this way to create undo actions
+ if ( m_pEdit && aArgs.getLength() == 1)
+ {
+ uno::Sequence< beans::PropertyValue > aValue;
+ aArgs[0].Value >>= aValue;
+ ::svx::ODataAccessDescriptor aDescriptor(aValue);
+ ::rtl::OUString sName;
+ aDescriptor[ ::svx::daColumnName ] >>= sName;
+ if ( sName.getLength() )
+ {
+ sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("[")) + sName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));
+ m_pEdit->SetText(sName);
+ }
+ } // if ( m_pEdit && aArgs.getLength() )
+ m_pEdit = NULL;
+ _pAddFieldDlg->Hide();
+ RefInputDoneAfter( TRUE );
+
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sheet::XFormulaParser> FormulaDialog::getFormulaParser() const
+{
+ return m_xParser.get();
+}
+// -----------------------------------------------------------------------------
+uno::Reference< sheet::XFormulaOpCodeMapper> FormulaDialog::getFormulaOpCodeMapper() const
+{
+ return m_xOpCodeMapper;
+}
+// -----------------------------------------------------------------------------
+table::CellAddress FormulaDialog::getReferencePosition() const
+{
+ return table::CellAddress();
+}
+// -----------------------------------------------------------------------------
+::std::auto_ptr<formula::FormulaTokenArray> FormulaDialog::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
+{
+ ::std::auto_ptr<formula::FormulaTokenArray> pArray(new FormulaTokenArray());
+ pArray->Fill(_aTokenList, NULL);
+ return pArray;
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx
new file mode 100644
index 000000000000..cbce03c629fd
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupExchange.cxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "GroupExchange.hxx"
+#include <sot/formats.hxx>
+#include <sot/storage.hxx>
+
+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..7c8afeedeb03
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupExchange.hxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_GROUP_EXCHANGE_HXX
+#define RPTUI_GROUP_EXCHANGE_HXX
+
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <svtools/transfer.hxx>
+#include "GroupsSorting.hxx"
+
+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..d4ea5fa17a48
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -0,0 +1,1562 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "GroupsSorting.hxx"
+#include "GroupsSorting.hrc"
+#include <connectivity/dbtools.hxx>
+#include <svtools/editbrowsebox.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/report/GroupOn.hpp>
+#include <com/sun/star/sdbc/DataType.hpp>
+
+#include <tools/debug.hxx>
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#include "ModuleHelper.hxx"
+#include "helpids.hrc"
+
+#include <svx/globlmn.hrc>
+#include <svx/svxids.hrc>
+#include <svtools/imgdef.hxx>
+
+#include "GroupExchange.hxx"
+#include "UITools.hxx"
+#include "UndoActions.hxx"
+#include "uistrings.hrc"
+#include "ReportController.hxx"
+#include "ColumnInfo.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/property.hxx>
+#include <vcl/mnemonic.hxx>
+#include <vcl/msgbox.hxx>
+#include <algorithm>
+#include <boost/bind.hpp>
+
+#include <cppuhelper/bootstrap.hxx>
+
+#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;
+
+ void lcl_addToList_throw( ComboBoxControl& _rListBox, ::std::vector<ColumnInfo>& o_aColumnList,const uno::Reference< container::XNameAccess>& i_xColumns )
+ {
+ uno::Sequence< ::rtl::OUString > aEntries = i_xColumns->getElementNames();
+ const ::rtl::OUString* pEntries = aEntries.getConstArray();
+ sal_Int32 nEntries = aEntries.getLength();
+ for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(*pEntries),uno::UNO_QUERY_THROW);
+ ::rtl::OUString sLabel;
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
+ xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
+ o_aColumnList.push_back( ColumnInfo(*pEntries,sLabel) );
+ if ( sLabel.getLength() )
+ _rListBox.InsertEntry( sLabel );
+ else
+ _rListBox.InsertEntry( *pEntries );
+ }
+ }
+
+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;
+ ::std::vector<ColumnInfo> m_aColumnInfo;
+ ::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&); // NO COPY
+ void operator =(const OFieldExpressionControl&); // NO ASSIGN
+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( CBChangeHdl,ComboBox*);
+
+ void InsertRows( long nRow );
+
+public:
+ DECL_LINK( DelayedDelete, void* );
+
+};
+//========================================================================
+// 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(xOrgGroup) );
+ }
+ }
+ 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 ( IsEditing() )
+ {
+ USHORT nPos = m_pComboCell->GetSelectEntryPos();
+ if ( COMBOBOX_ENTRY_NOTFOUND != nPos || m_pComboCell->GetText().Len() )
+ SaveModified();
+ DeactivateCell();
+ }
+ if ( IsDropFormatSupported( OGroupExchange::getReportGroupId() ) && m_pParent->getGroups()->getCount() > 1 && rEvt.GetWindow() == &GetDataWindow() )
+ {
+ 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(ModuleRes(RID_STR_UNDO_MOVE_GROUP));
+ UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+
+ 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_bIgnoreEvent = false;
+ Invalidate();
+ } // if ( _aGroups.getLength() )
+}
+// -----------------------------------------------------------------------------
+void OFieldExpressionControl::fillColumns(const uno::Reference< container::XNameAccess>& _xColumns)
+{
+ m_pComboCell->Clear();
+ if ( _xColumns.is() )
+ lcl_addToList_throw(*m_pComboCell,m_aColumnInfo,_xColumns);
+}
+//------------------------------------------------------------------------------
+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_RPT_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(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();
+ ::rtl::OUString sExpression;
+ if ( COMBOBOX_ENTRY_NOTFOUND == nPos )
+ sExpression = m_pComboCell->GetText();
+ else
+ {
+ sExpression = m_aColumnInfo[nPos].sColumnName;
+ }
+ xGroup->setExpression( sExpression );
+
+ ::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]);
+ ::rtl::OUString sExpression = xGroup->getExpression();
+
+ for(::std::vector<ColumnInfo>::const_iterator aIter = m_aColumnInfo.begin(); aIter != m_aColumnInfo.end();++aIter)
+ {
+ if ( aIter->sColumnName == sExpression )
+ {
+ if ( aIter->sLabel.getLength() )
+ sExpression = aIter->sLabel;
+ break;
+ }
+ }
+ sText = sExpression;
+ }
+ 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);
+
+ sal_Bool bIsEditing = IsEditing();
+ if (bIsEditing)
+ {
+ DeactivateCell();
+ }
+ long nIndex = FirstSelectedRow();
+ if (nIndex == -1)
+ {
+ nIndex = GetCurRow();
+ }
+ 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(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(ModuleRes(RID_STR_UNDO_APPEND_GROUP));
+ UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction);
+
+ 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_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_aPB_Up(this, ModuleRes(PB_UP) )
+ ,m_aPB_Down(this, ModuleRes(PB_DOWN) )
+ ,m_aPB_Delete(this, ModuleRes(PB_DELETE) )
+*/
+ ,m_aToolBox(this, ModuleRes(TB_TOOLBOX) )
+
+ ,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 aSize(UNRELATED_CONTROLS, PAGE_HEIGHT);
+ Size aSpace = LogicToPixel( aSize, 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() );
+ //BTN m_aPB_Up.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl));
+ //BTN m_aPB_Down.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl));
+ //BTN m_aPB_Delete.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl));
+
+ m_pFieldExpression->SetZOrder(&m_aFL2, WINDOW_ZORDER_BEHIND);
+
+ m_aMove.SetZOrder(m_pFieldExpression, WINDOW_ZORDER_BEHIND);
+ //BTN m_aPB_Up.SetZOrder(&m_aMove, WINDOW_ZORDER_BEHIND);
+ //BTN m_aPB_Down.SetZOrder(&m_aPB_Up, WINDOW_ZORDER_BEHIND);
+ // set Hi contrast bitmaps
+ //BTN m_aPB_Up.SetModeImage( ModuleRes(IMG_UP_H),BMP_COLOR_HIGHCONTRAST);
+ //BTN m_aPB_Down.SetModeImage( ModuleRes(IMG_DOWN_H),BMP_COLOR_HIGHCONTRAST);
+ m_aToolBox.SetStyle(m_aToolBox.GetStyle()|WB_LINESPACING);
+ m_aToolBox.SetSelectHdl(LINK(this, OGroupsSortingDialog, OnFormatAction));
+ m_aToolBox.SetImageListProvider(this);
+ setToolBox(&m_aToolBox);
+
+ checkButtons(0);
+ Resize();
+
+ 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_IntPtr>(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() )
+ fillColumns();
+ 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, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ )
+// IMPL_LINK( OGroupsSortingDialog, ClickHdl, ImageButton*, _pButton )
+{
+ DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL);
+
+ USHORT nCommand = m_aToolBox.GetCurItemId();
+
+ 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);
+ }
+ //BTN if ( _pButton == &m_aPB_Up )
+ if ( nCommand == SID_RPT_GROUPSORT_MOVE_UP )
+ {
+ --nIndex;
+ }
+ //BTN if ( _pButton == &m_aPB_Down )
+ if ( nCommand == SID_RPT_GROUPSORT_MOVE_DOWN )
+ {
+ ++nIndex;
+ }
+ //BTN if ( _pButton == &m_aPB_Delete )
+ if ( nCommand == SID_RPT_GROUPSORT_DELETE )
+ {
+ // m_pFieldExpression->DeleteCurrentRow();
+ Application::PostUserEvent( LINK(m_pFieldExpression, OFieldExpressionControl, DelayedDelete) );
+ // UpdateData( );
+ }
+ else
+ {
+ 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);
+ if ( pListBox == &m_aGroupOnLst )
+ m_aGroupIntervalEd.Enable( pListBox->GetSelectEntryPos() != 0 );
+ }
+ 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 = m_pController->getColumns();
+ 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_aGroupIntervalEd.Enable( nPos != 0 );
+ 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()));
+
+//BTN sal_Int32 nPos = aTotalOutputSize.Width() - aSpace.Width() - m_aPB_Up.GetSizePixel().Width();
+//BTN m_aPB_Delete.SetPosPixel(Point(nPos,m_aPB_Delete.GetPosPixel().Y()));
+//BTN
+//BTN nPos -= (m_aPB_Up.GetSizePixel().Width() + LogicToPixel( Size( UNRELATED_CONTROLS, 0 ), MAP_APPFONT ).Width());
+//BTN m_aPB_Down.SetPosPixel(Point(nPos,m_aPB_Down.GetPosPixel().Y()));
+//BTN
+//BTN nPos -= (m_aPB_Up.GetSizePixel().Width() + LogicToPixel( Size( RELATED_CONTROLS, 0 ), MAP_APPFONT ).Width());
+//BTN m_aPB_Up.SetPosPixel(Point(nPos,m_aPB_Up.GetPosPixel().Y()));
+ sal_Int32 nPos = aTotalOutputSize.Width() - aSpace.Width() - m_aToolBox.GetSizePixel().Width();
+ m_aToolBox.SetPosPixel(Point(nPos,m_aToolBox.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_Int32 nRowCount = m_pFieldExpression->GetRowCount();
+ sal_Bool bEnabled = nGroupCount > 1;
+
+ if (bEnabled && _nRow > 0 /* && _nRow < nGroupCount */ )
+ {
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_UP, sal_True);
+ }
+ else
+ {
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_UP, sal_False);
+ }
+ if (bEnabled && _nRow < (nRowCount - 1) /* && _nRow < (nGroupCount - 1) */ )
+ {
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, sal_True);
+ }
+ else
+ {
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, sal_False);
+ }
+ //BTN m_aPB_Up.Enable(bEnable && _nRow > 0 );
+ //BTN m_aPB_Down.Enable(bEnable && _nRow < (m_pFieldExpression->GetRowCount()-1) );
+ // m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, bEnable && _nRow < (-1) );
+
+ sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(_nRow);
+ if ( nGroupPos != NO_GROUP )
+ {
+ sal_Bool bEnableDelete = nGroupCount > 0;
+ //BTN m_aPB_Delete.Enable(bEnableDelete );
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_DELETE, bEnableDelete);
+ }
+ else
+ {
+ //BTN m_aPB_Delete.Enable( sal_False );
+ m_aToolBox.EnableItem(SID_RPT_GROUPSORT_DELETE, sal_False);
+ }
+}
+
+ImageList OGroupsSortingDialog::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 OGroupsSortingDialog::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();
+ }
+}
+
+//------------------------------------------------------------------
+// load the images
+ImageList OGroupsSortingDialog::getImageList(vcl::ImageListType _eType) SAL_THROW (( com::sun::star::lang::IllegalArgumentException ))
+{
+ if (_eType == vcl::HIGHCONTRAST_NO)
+ {
+ return ImageList(ModuleRes(IMGLST_GROUPSORT_DLG_SC));
+ }
+ else if (_eType == vcl::HIGHCONTRAST_YES)
+ {
+ return ImageList(ModuleRes(IMGLST_GROUPSORT_DLG_SCH));
+ }
+ else
+ {
+ throw com::sun::star::lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("High contrast parameter is wrong.")), NULL, 0);
+ }
+}
+
+
+
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.hrc b/reportdesign/source/ui/dlg/GroupsSorting.hrc
new file mode 100644
index 000000000000..8dfbfd3224a4
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.hrc
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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)
+//BTN #define IMG_UP_H (24)
+//BTN #define IMG_DOWN_H (25)
+//BTN #define PB_DELETE (26)
+#define TB_TOOLBOX (27)
+
+// #define IMG_GROUPSORT_MOVE_DOWN (28)
+// #define IMG_GROUPSORT_MOVE_UP (29)
+// #define IMG_GROUPSORT_DELETE (30)
+// #define IMG_GROUPSORT_MOVE_DOWN_H (31)
+// #define IMG_GROUPSORT_MOVE_UP_H (32)
+// #define IMG_GROUPSORT_DELETE_H (33)
+
+
+#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..186fb771ad46
--- /dev/null
+++ b/reportdesign/source/ui/dlg/GroupsSorting.src
@@ -0,0 +1,502 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 [ en-US ] = "Sorting and Grouping" ;
+ HelpId = HID_RPT_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 [ 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_RPT_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 [ en-US ] = "Move group" ;
+ Text [ en-US ] = "Group actions" ;
+ };
+
+// /*
+// | PAGE_WIDTH |
+// | /-----\ {-------\ /---------\ |
+// | unreleated FT_MOVELABEL |PB_UP| unreleated |PB_DOWN| unreleated |PD_DELETE| unreleated |
+// | \_____/ \_______/ \_________/ |
+//
+// Don't set any position here, it will be done in OGroupsSortingDialog::Resize()
+//
+// Find possible IMAGEBUTTON_* in rscicpx.cxx
+// Symbol is vclrsc.hxx
+// */
+// ImageButton PB_UP
+// {
+// Pos = MAP_APPFONT ( PAGE_WIDTH - 3*UNRELATED_CONTROLS - 3*14 - 2*RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT -1 ) ;
+// Size = MAP_APPFONT ( 14 , 14 ) ;
+// TabStop = TRUE;
+// // Symbol = IMAGEBUTTON_ARROW_UP ; // arrow up
+// Symbol = IMAGEBUTTON_SPIN_UP ; // triangle up
+// // Symbol = IMAGEBUTTON_FLOAT;
+// };
+//
+// ImageButton PB_DOWN
+// {
+// Pos = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS - 2*14 - 2*RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ;
+// Size = MAP_APPFONT ( 14 , 14 ) ;
+// TabStop = TRUE;
+// // Symbol = IMAGEBUTTON_ARROW_DOWN ; // arrow down
+// // Symbol = IMAGEBUTTON_FIRST ;
+// Symbol = IMAGEBUTTON_SPIN_DOWN;
+//
+// };
+//
+// ImageButton PB_DELETE
+// {
+// Pos = MAP_APPFONT ( PAGE_WIDTH - UNRELATED_CONTROLS - 14, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ;
+// Size = MAP_APPFONT ( 14 , 14 ) ;
+// TabStop = TRUE;
+// Symbol = IMAGEBUTTON_CLOSE ;
+// };
+
+
+ ToolBox TB_TOOLBOX
+ {
+ Pos = MAP_APPFONT ( PAGE_WIDTH - 4*14 - UNRELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ;
+ ButtonType = BUTTON_SYMBOL;
+// Align = BOXALIGN_TOP;
+// HelpId = HID_RPT_CONDFORMAT_TB;
+ Customize = FALSE;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_RPT_GROUPSORT_MOVE_UP ;
+ // Command = ".uno:ReportGroupMoveUp" ; // default_images/res/commandimages/sc_reportgroupmoveup.png
+ HelpID = HID_RPT_GROUPSORT_MOVE_UP ;
+ Text [ en-US ] = "Move up" ;
+ Checkable = TRUE;
+// Disable = TRUE;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_RPT_GROUPSORT_MOVE_DOWN ;
+ // Command = ".uno:ReportGroupMoveDown" ;
+ HelpID = HID_RPT_GROUPSORT_MOVE_DOWN ;
+ Text [ en-US ] = "Move down" ;
+ Checkable = TRUE;
+// Disable = TRUE;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_RPT_GROUPSORT_DELETE ;
+ // Command = ".uno:ReportGroupDelete" ;
+ HelpID = HID_RPT_GROUPSORT_DELETE ;
+ Text [ en-US ] = "~Delete" ;
+ Checkable = TRUE;
+// Disable = TRUE;
+ };
+ };
+ };
+
+ 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 [ 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 [ en-US ] = "Sorting" ;
+ };
+ ListBox LST_ORDER
+ {
+ HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING: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 [ 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
+ {
+ HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING: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 [ 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
+ {
+ HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING: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 [ 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
+ {
+ HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING: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 [ 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 [ en-US ] = "Group Interval" ;
+ };
+ NumericField ED_GROUPINTERVALLST
+ {
+ HelpID = "reportdesign:NumericField:RID_GROUPS_SORTING: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
+ {
+ HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING: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 [ 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 [ 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;
+ };
+
+//BTN Image IMG_UP_H
+//BTN {
+//BTN ImageBitmap = Bitmap { File = "arrow_move_up_hc" ; };
+//BTN };
+//BTN Image IMG_DOWN_H
+//BTN {
+//BTN ImageBitmap = Bitmap { File = "arrow_move_down_hc" ; };
+//BTN };
+
+
+};
+
+String STR_RPT_EXPRESSION
+{
+ Text [ en-US ] = "Field/Expression" ;
+};
+String STR_RPT_SORTING
+{
+ Text [ en-US ] = "Sort Order" ;
+};
+String STR_RPT_PREFIXCHARS
+{
+ Text [ en-US ] = "Prefix Characters" ;
+};
+String STR_RPT_YEAR
+{
+ Text [ en-US ] = "Year" ;
+};
+String STR_RPT_QUARTER
+{
+ Text [ en-US ] = "Quarter" ;
+};
+String STR_RPT_MONTH
+{
+ Text [ en-US ] = "Month" ;
+};
+String STR_RPT_WEEK
+{
+ Text [ en-US ] = "Week" ;
+};
+String STR_RPT_DAY
+{
+ Text [ en-US ] = "Day" ;
+};
+String STR_RPT_HOUR
+{
+ Text [ en-US ] = "Hour" ;
+};
+String STR_RPT_MINUTE
+{
+ Text [ en-US ] = "Minute" ;
+};
+String STR_RPT_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
+ };
+ };
+};
+
+
+#define DEF_MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
+
+#define DEF_IL_GROUPSORT \
+\
+ IdList = {\
+ SID_RPT_GROUPSORT_MOVE_UP;\
+ SID_RPT_GROUPSORT_MOVE_DOWN;\
+ SID_RPT_GROUPSORT_DELETE;\
+ };\
+ IdCount = {\
+ 3;\
+ }
+
+ImageList IMGLST_GROUPSORT_DLG_SC
+{
+ DEF_MASKCOLOR;
+ prefix = "sc";
+ DEF_IL_GROUPSORT ;
+};
+
+ImageList IMGLST_GROUPSORT_DLG_SCH
+{
+ DEF_MASKCOLOR;
+ prefix = "sch";
+ DEF_IL_GROUPSORT ;
+};
+
+
+// Image IMG_GROUPSORT_MOVEUP
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupmoveup"; // reportdesign/res/...
+// };
+// DEF_MASKCOLOR;
+// };
+// Image IMG_GROUPSORT_MOVEDOWN
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupmovedown";
+// };
+// DEF_MASKCOLOR;
+// };
+// Image IMG_GROUPSORT_DELETE
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupdelete";
+// };
+// DEF_MASKCOLOR;
+// };
+//
+// Image IMG_GROUPSORT_MOVEUP_H
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupmoveup_h"; // reportdesign/res/...
+// };
+// DEF_MASKCOLOR;
+// };
+// Image IMG_GROUPSORT_MOVEDOWN_H
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupmovedown_h";
+// };
+// DEF_MASKCOLOR;
+// };
+// Image IMG_GROUPSORT_DELETE_H
+// {
+// ImageBitmap = Bitmap
+// {
+// File = "reportgroupdelete_h";
+// };
+// DEF_MASKCOLOR;
+// };
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
new file mode 100644
index 000000000000..af61f3b6d514
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -0,0 +1,986 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "Navigator.hxx"
+
+#include "uistrings.hrc"
+#include "ReportController.hxx"
+#include "UITools.hxx"
+#include "Undo.hxx"
+#include "reportformula.hxx"
+#include <com/sun/star/container/XContainerListener.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#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>
+#include <svx/globlmn.hrc>
+#include <svx/svxids.hrc>
+#include "helpids.hrc"
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#include <tools/debug.hxx>
+#include <comphelper/propmultiplex.hxx>
+#include <comphelper/containermultiplexer.hxx>
+#include <comphelper/types.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include "comphelper/SelectionMultiplex.hxx"
+#include <svtools/svtreebx.hxx>
+#include <svl/solar.hrc>
+#include "ReportVisitor.hxx"
+#include "ModuleHelper.hxx"
+#include <rtl/ref.hxx>
+
+#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 utl;
+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< beans::XPropertySet>& _xElement)
+{
+ OSL_ENSURE(_xElement.is(),"Found report element which is NULL!");
+ ::rtl::OUString sTempName;
+ _xElement->getPropertyValue(PROPERTY_NAME) >>= sTempName;
+ ::rtl::OUStringBuffer sName = sTempName;
+ 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.is() && _xElement->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_rController;
+ 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 _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& _rController );
+ virtual ~NavigatorTree();
+
+ DECL_LINK(OnEntrySelDesel, NavigatorTree*);
+ DECL_LINK( OnDropActionTimer, void* );
+
+ virtual void _selectionChanged( const lang::EventObject& aEvent ) throw (uno::RuntimeException);
+
+ // 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;
+};
+DBG_NAME(rpt_NavigatorTree)
+// -----------------------------------------------------------------------------
+NavigatorTree::NavigatorTree( Window* pParent,OReportController& _rController )
+ :SvTreeListBox( pParent, WB_TABSTOP| 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_rController(_rController)
+ ,m_pMasterReport(NULL)
+ ,m_pDragedEntry(NULL)
+ ,m_nTimerCounter( DROP_ACTION_TIMER_INITIAL_TICKS )
+{
+ DBG_CTOR(rpt_NavigatorTree,NULL);
+ m_pReportListener = new OPropertyChangeMultiplexer(this,m_rController.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_rController);
+
+ 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();
+ DBG_DTOR(rpt_NavigatorTree,NULL);
+}
+//------------------------------------------------------------------------------
+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_rController.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_rController.isCommandChecked(nId));
+ sal_Bool bEnabled = m_rController.isCommandEnabled(nId);
+ if ( nId == SID_RPT_NEW_FUNCTION )
+ aContextMenu.EnableItem(nId,m_rController.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_rController.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_rController.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_THROW);
+ OSL_ENSURE(xElement.is(),"Found report element which is NULL!");
+ insertEntry(lcl_getName(xElement.get()),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 ( xProp.is() )
+ sName = lcl_getName(xProp);
+ insertEntry(sName,pEntry,(!xElement.is() ? USHORT(SID_RPT_NEW_FUNCTION) : 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);
+ }
+}
+DBG_NAME(rpt_NavigatorTree_UserData)
+// -----------------------------------------------------------------------------
+NavigatorTree::UserData::UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent)
+ : OPropertyChangeListener(m_aMutex)
+ , OContainerListener(m_aMutex)
+ , m_xContent(_xContent)
+ , m_pTree(_pTree)
+{
+ DBG_CTOR(rpt_NavigatorTree_UserData,NULL);
+ 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_DATAFIELD) )
+ m_pListener->addProperty(PROPERTY_DATAFIELD);
+ if ( xInfo->hasPropertyByName(PROPERTY_LABEL) )
+ m_pListener->addProperty(PROPERTY_LABEL);
+ 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()
+{
+ DBG_DTOR(rpt_NavigatorTree_UserData,NULL);
+ 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);
+ try
+ {
+ 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_EXPRESSION == _rEvent.PropertyName)
+ {
+ ::rtl::OUString sNewName;
+ _rEvent.NewValue >>= sNewName;
+ m_pTree->SetEntryText(pEntry,sNewName);
+ }
+ else if ( PROPERTY_DATAFIELD == _rEvent.PropertyName || PROPERTY_LABEL == _rEvent.PropertyName || PROPERTY_NAME == _rEvent.PropertyName )
+ {
+ uno::Reference<beans::XPropertySet> xProp(_rEvent.Source,uno::UNO_QUERY);
+ m_pTree->SetEntryText(pEntry,lcl_getName(xProp));
+ }
+ }
+ catch(uno::Exception)
+ {}
+}
+// -----------------------------------------------------------------------------
+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& _rController,ONavigator* _pParent);
+ virtual ~ONavigatorImpl();
+
+ uno::Reference< report::XReportDefinition> m_xReport;
+ ::rptui::OReportController& m_rController;
+ ::std::auto_ptr<NavigatorTree> m_pNavigatorTree;
+};
+
+ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent)
+ :m_xReport(_rController.getReportDefinition())
+ ,m_rController(_rController)
+ ,m_pNavigatorTree(new NavigatorTree(_pParent,_rController))
+{
+ reportdesign::OReportVisitor aVisitor(m_pNavigatorTree.get());
+ aVisitor.start(m_xReport);
+ m_pNavigatorTree->Expand(m_pNavigatorTree->find(m_xReport));
+ lang::EventObject aEvent(m_rController);
+ m_pNavigatorTree->_selectionChanged(aEvent);
+}
+//------------------------------------------------------------------------
+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& _rController)
+ : FloatingWindow( _pParent, ModuleRes(RID_NAVIGATOR) )
+{
+ DBG_CTOR( rpt_ONavigator,NULL);
+
+ m_pImpl.reset(new ONavigatorImpl(_rController,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();
+ m_pImpl->m_pNavigatorTree->GrabFocus();
+ 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 );
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+void ONavigator::GetFocus()
+{
+ Window::GetFocus();
+ if ( m_pImpl->m_pNavigatorTree.get() )
+ m_pImpl->m_pNavigatorTree->GrabFocus();
+}
+// =============================================================================
+} // rptui
+// =============================================================================
+
diff --git a/reportdesign/source/ui/dlg/Navigator.src b/reportdesign/source/ui/dlg/Navigator.src
new file mode 100644
index 000000000000..b9e639dfe646
--- /dev/null
+++ b/reportdesign/source/ui/dlg/Navigator.src
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 <svl/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 [ en-US ] = "Report navigator" ;
+ HelpId = HID_RPT_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 [ en-US ] = "Functions" ;
+};
+String RID_STR_GROUPS
+{
+ Text [ en-US ] = "Groups" ;
+};
+Menu RID_MENU_NAVIGATOR
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_SORTINGANDGROUPING;
+ Command = ".uno:DbSortingAndGrouping";
+ Text [ en-US ] = "Sorting and Grouping...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_PAGEHEADERFOOTER;
+ Command = ".uno:PageHeaderFooter";
+ Checkable = TRUE;
+ Text [ en-US ] = "Page Header/Footer...";
+ };
+ MenuItem
+ {
+ Identifier = SID_REPORTHEADERFOOTER;
+ Command = ".uno:ReportHeaderFooter";
+ Checkable = TRUE;
+ Text [ en-US ] = "Report Header/Footer...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_RPT_NEW_FUNCTION;
+ Command = ".uno:NewFunction";
+ Text [ en-US ] = "New Function";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_SHOW_PROPERTYBROWSER;
+ Command = ".uno:FormProperties";
+ 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..dba4a7648aaf
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.cxx
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "PageNumber.hxx"
+#ifndef RPTUI_PAGENUMBER_HRC
+#include "PageNumber.hrc"
+#endif
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <tools/debug.hxx>
+#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
+#include "RptDef.hxx"
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#include <vcl/msgbox.hxx>
+#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
+#include "ReportController.hxx"
+#include <com/sun/star/report/XFixedText.hpp>
+#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..a6087c50b00f
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.hrc
@@ -0,0 +1,59 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef 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..c5c760e1755d
--- /dev/null
+++ b/reportdesign/source/ui/dlg/PageNumber.src
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 [ en-US ] = "Page Numbers" ;
+ HelpId = HID_RPT_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 [ en-US ] = "Format";
+ };
+
+ RadioButton RB_PAGE_N
+ {
+ HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS: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 [ en-US ] = "Page N";
+ };
+ RadioButton RB_PAGE_N_OF_M
+ {
+ HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS: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 [ 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 [ en-US ] = "Position";
+ };
+
+ RadioButton RB_PAGE_TOPPAGE
+ {
+ HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS: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 [ en-US ] = "Top of Page (Header)";
+ };
+ RadioButton RB_PAGE_BOTTOMPAGE
+ {
+ HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS: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 [ 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 [ 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 [ en-US ] = "Alignment:";
+ };
+ ListBox LST_ALIGNMENT
+ {
+ HelpID = "reportdesign:ListBox:RID_PAGENUMBERS: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 [ en-US ] =
+ {
+ < "Left" ; Default ; > ;
+ < "Center" ; Default ; > ;
+ < "Right" ; Default ; > ;
+ //< "Inside" ; Default ; > ;
+ //< "Outside" ; Default ; > ;
+ };
+ };
+ CheckBox CB_SHOWNUMBERONFIRSTPAGE
+ {
+ HelpID = "reportdesign:CheckBox:RID_PAGENUMBERS: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 [ 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 [ en-US ] = "~Help";
+ };
+};
+String STR_RPT_PN_PAGE
+{
+ 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 [ 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..0f6d328de729
--- /dev/null
+++ b/reportdesign/source/ui/dlg/dlgpage.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+
+#include <svx/dialogs.hrc>
+#include <svx/tabarea.hxx>
+#include <svx/flagsdef.hxx>
+#include <svx/svxdlg.hxx>
+#include <editeng/svxenum.hxx>
+#include "dlgpage.hxx"
+#include "ModuleHelper.hxx"
+#include "RptResId.hrc"
+#include <svl/intitem.hxx> //add CHINA001
+#include <svl/cjkoptions.hxx>
+#include <svl/aeitem.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..b8dfcd377994
--- /dev/null
+++ b/reportdesign/source/ui/dlg/dlgpage.src
@@ -0,0 +1,304 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <svx/dialogs.hrc>
+#include "RptResId.hrc"
+
+TabDialog RID_PAGEDIALOG_PAGE
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ en-US ] = "Page Setup" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PAGE ;
+ Text [ en-US ] = "Page" ;
+ PageResID = RID_SVXPAGE_PAGE ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_BACKGROUND ;
+ 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 [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ en-US ] = "Page" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Background" ;
+ };
+};
+
+TabDialog RID_PAGEDIALOG_BACKGROUND
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ 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 [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ en-US ] = "Background" ;
+ };
+};
+TabDialog RID_PAGEDIALOG_CHAR
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ en-US ] = "Character Settings" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_PAGE_CHAR ;
+ Text [ en-US ] = "Font" ;
+ PageResID = RID_PAGE_CHAR ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_EFFECTS ;
+ Text [ en-US ] = "Font Effects" ;
+ PageResID = RID_PAGE_EFFECTS ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_POSITION ;
+ PageResID = RID_PAGE_POSITION ;
+ Text [ en-US ] = "Position";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_TWOLN ;
+ PageResID = RID_PAGE_TWOLN;
+ Text [ en-US ] = "Asian Layout";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_BACKGROUND ;
+ Text [ en-US ] = "Background" ;
+ PageResID = RID_PAGE_BACKGROUND ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_PAGE_ALIGNMENT ;
+ 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 [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ en-US ] = "Character" ;
+ };
+};
+TabDialog RID_PAGEDIALOG_LINE
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ 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 [ en-US ] = "Line" ;
+ PageResID = RID_SVXPAGE_LINE ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_LINE_DEF ;
+ Text [ en-US ] = "Line Styles" ;
+ PageResID = RID_SVXPAGE_LINE_DEF ;
+ Text [ x-comment ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_LINEEND_DEF ;
+ 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 [ en-US ] = "Return" ;
+ TabStop = TRUE ;
+ Text [ x-comment ] = " ";
+ };
+ Text [ x-comment ] = " ";
+
+ String 1
+ {
+ Text [ en-US ] = "Line" ;
+ };
+};
diff --git a/reportdesign/source/ui/dlg/makefile.mk b/reportdesign/source/ui/dlg/makefile.mk
new file mode 100644
index 000000000000..a2c7756213fc
--- /dev/null
+++ b/reportdesign/source/ui/dlg/makefile.mk
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=uidlg
+IMGLST_SRS=$(SRS)$/$(TARGET).srs
+BMP_IN=$(PRJ)$/res
+
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+# .INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- 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 \
+ $(SLO)$/Formula.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..fe9cbff6aa6c
--- /dev/null
+++ b/reportdesign/source/ui/inc/AddField.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_ADDFIELDWINDOW_HXX
+#define RPTUI_ADDFIELDWINDOW_HXX
+
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <svtools/transfer.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <svtools/svtreebx.hxx>
+#include <svtools/transfer.hxx>
+#include <vcl/floatwin.hxx>
+#include <comphelper/propmultiplex.hxx>
+#include <comphelper/containermultiplexer.hxx>
+#include <vcl/button.hxx>
+
+#include <svx/dataaccessdescriptor.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include <dbaccess/ToolBoxHelper.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/fixed.hxx>
+
+#include <rtl/ref.hxx>
+
+namespace rptui
+{
+//==================================================================
+class OAddFieldWindow;
+class OAddFieldWindowListBox;
+//========================================================================
+class OAddFieldWindow :public FloatingWindow
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ , public ::comphelper::OContainerListener
+ , public dbaui::OToolBoxHelper
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xHoldAlive;
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet;
+
+ ToolBox m_aActions;
+
+ ::std::auto_ptr<OAddFieldWindowListBox> m_pListBox;
+ FixedLine m_aFixedLine;
+ FixedText m_aHelpText;
+
+ PushButton m_aInsertButton;
+ Link m_aCreateLink;
+ ::rtl::OUString m_aCommandName;
+ ::rtl::OUString m_sFilter;
+ sal_Int32 m_nCommandType;
+ sal_Bool m_bEscapeProcessing;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener;
+ ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
+
+ DECL_LINK( OnDoubleClickHdl, void* );
+ DECL_LINK( OnSelectHdl, void* );
+ DECL_LINK( OnSortAction, ToolBox* );
+
+ OAddFieldWindow(const OAddFieldWindow&);
+ void operator =(const OAddFieldWindow&);
+public:
+ OAddFieldWindow(Window* pParent
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet);
+
+ 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 void SetCreateHdl(const Link& _aCreateLink) { m_aCreateLink = _aCreateLink; }
+
+ 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;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getSelectedFieldDescriptors();
+
+ /** 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);
+
+ /// 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);
+
+private:
+ // FmXChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException );
+ // OContainerListener
+ virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementRemoved( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) 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..a2e01c135007
--- /dev/null
+++ b/reportdesign/source/ui/inc/ColorChanger.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_COLORCHANGER_HXX
+#define RPTUI_COLORCHANGER_HXX
+
+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..4216e39a3652
--- /dev/null
+++ b/reportdesign/source/ui/inc/ColorListener.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_COLORLISTENER_HXX
+#define RPTUI_COLORLISTENER_HXX
+
+#include <vcl/window.hxx>
+#include <svtools/colorcfg.hxx>
+#include <svtools/extcolorcfg.hxx>
+#include "ModuleHelper.hxx"
+#include <tools/link.hxx>
+
+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/ColumnInfo.hxx b/reportdesign/source/ui/inc/ColumnInfo.hxx
new file mode 100644
index 000000000000..392a141e6382
--- /dev/null
+++ b/reportdesign/source/ui/inc/ColumnInfo.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: AddField.cxx,v $
+ * $Revision: 1.5 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_COLUMNINFO_HXX
+#define RPTUI_COLUMNINFO_HXX
+
+#include <rtl/ustring.hxx>
+
+namespace rptui
+{
+ struct ColumnInfo
+ {
+ ::rtl::OUString sColumnName;
+ ::rtl::OUString sLabel;
+ bool bColumn;
+ ColumnInfo(const ::rtl::OUString& i_sColumnName,const ::rtl::OUString& i_sLabel)
+ : sColumnName(i_sColumnName)
+ , sLabel(i_sLabel)
+ , bColumn(true)
+ {
+ }
+ ColumnInfo(const ::rtl::OUString& i_sColumnName)
+ : sColumnName(i_sColumnName)
+ , bColumn(false)
+ {
+ }
+ };
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_COLUMNINFO_HXX
diff --git a/reportdesign/source/ui/inc/CondFormat.hxx b/reportdesign/source/ui/inc/CondFormat.hxx
new file mode 100644
index 000000000000..79907f4e5e87
--- /dev/null
+++ b/reportdesign/source/ui/inc/CondFormat.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef 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/DataProviderHandler.hxx b/reportdesign/source/ui/inc/DataProviderHandler.hxx
new file mode 100644
index 000000000000..d5b3221f7745
--- /dev/null
+++ b/reportdesign/source/ui/inc/DataProviderHandler.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_DATAPROVIDERHANDLER_HXX
+#define RPT_DATAPROVIDERHANDLER_HXX
+
+#include "sal/config.h"
+
+#include "cppuhelper/compbase2.hxx"
+#include "cppuhelper/basemutex.hxx"
+
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#include "com/sun/star/chart2/XChartDocument.hpp"
+#include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp"
+#include "com/sun/star/report/XReportComponent.hpp"
+#include "com/sun/star/script/XTypeConverter.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+
+#include <memory>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ class OPropertyInfoService;
+
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::inspection::XPropertyHandler
+ , ::com::sun::star::lang::XServiceInfo> DataProviderHandler_Base;
+
+ class DataProviderHandler:
+ private ::cppu::BaseMutex,
+ public DataProviderHandler_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 >&);
+
+ explicit DataProviderHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
+ private:
+
+ // 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 ~DataProviderHandler() {}
+ private:
+ DataProviderHandler(DataProviderHandler &); // not defined
+ void operator =(DataProviderHandler &); // not defined
+
+
+ bool impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
+ bool impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
+ void impl_updateChartTitle_throw(const ::com::sun::star::uno::Any& _aValue);
+
+ // 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::chart2::data::XDatabaseDataProvider> m_xDataProvider; /// inspectee
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xFormComponent; /// inspectee
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > m_xReportComponent; /// inspectee
+ ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument> m_xChartModel;
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xMasterDetails;
+ /// type converter, needed on various occasions
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter > m_xTypeConverter;
+ ::std::auto_ptr< OPropertyInfoService > m_pInfoService;
+ };
+//........................................................................
+} // namespace rptui
+//........................................................................
+
+#endif // RPT_DATAPROVIDERHANDLER_HXX
diff --git a/reportdesign/source/ui/inc/DateTime.hxx b/reportdesign/source/ui/inc/DateTime.hxx
new file mode 100644
index 000000000000..1526e5978331
--- /dev/null
+++ b/reportdesign/source/ui/inc/DateTime.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_DATETIME_HXX
+#define RPTUI_DATETIME_HXX
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/util/XNumberFormats.hpp>
+#include <com/sun/star/lang/Locale.hpp>
+
+#include <svtools/dialogcontrolling.hxx>
+
+namespace rptui
+{
+class OReportController;
+/*************************************************************************
+|*
+|* Groups and Sorting dialog
+|*
+\************************************************************************/
+class ODateTimeDialog : public ModalDialog
+{
+ // FixedLine m_aFLDate;
+ CheckBox m_aDate;
+ FixedText m_aFTDateFormat;
+ ListBox m_aDateListBox;
+ FixedLine m_aFL0;
+ CheckBox m_aTime;
+ FixedText m_aFTTimeFormat;
+ ListBox m_aTimeListBox;
+ FixedLine m_aFL1;
+ OKButton m_aPB_OK;
+ CancelButton m_aPB_CANCEL;
+ HelpButton m_aPB_Help;
+
+
+ svt::ControlDependencyManager m_aDateControlling;
+ svt::ControlDependencyManager m_aTimeControlling;
+
+ ::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 frmat string
+ *
+ * \param _nNumberFormatKey the number format key
+ * \param _xFormats
+ * \param _bTime
+ * \return
+ */
+ ::rtl::OUString getFormatStringByKey(::sal_Int32 _nNumberFormatKey,const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats>& _xFormats,bool _bTime);
+
+ /** returns the number format key
+ @param _nNumberFormatIndex the number format index @see com::sun::star::i18n::NumberFormatIndex
+ */
+ sal_Int32 getFormatKey(sal_Bool _bDate) const;
+
+ DECL_LINK( CBClickHdl, CheckBox* );
+ ODateTimeDialog(const ODateTimeDialog&);
+ void operator =(const ODateTimeDialog&);
+
+ // fill methods
+ void InsertEntry(sal_Int16 _nNumberFormatId);
+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..a0382ab0e7f8
--- /dev/null
+++ b/reportdesign/source/ui/inc/DefaultInspection.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_DEFAULTINSPECTION_HXX
+#define RPT_DEFAULTINSPECTION_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/inspection/XObjectInspectorModel.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+/** === end UNO includes === **/
+#include <cppuhelper/implbase3.hxx>
+
+#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..4da25a831607
--- /dev/null
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -0,0 +1,298 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_DESIGNVIEW_HXX
+#define RPTUI_DESIGNVIEW_HXX
+
+#include <dbaccess/dataview.hxx>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+#include <vcl/split.hxx>
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <tools/link.hxx>
+#include <tools/gen.hxx>
+#include <vcl/timer.hxx>
+#include <svl/hint.hxx>
+#include <svl/brdcst.hxx>
+#include <comphelper/stl_types.hxx>
+#include "ReportDefines.hxx"
+#include <svtools/colorcfg.hxx>
+#include <boost/shared_ptr.hpp>
+#include <svx/svdedtv.hxx>
+#include <vcl/tabpage.hxx>
+#include <vcl/splitwin.hxx>
+#include <MarkedSection.hxx>
+#include "ScrollHelper.hxx"
+
+class KeyEvent;
+class MouseEvent;
+class Timer;
+class Window;
+
+namespace rptui
+{
+ 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:
+ SplitWindow m_aSplitWin;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xReportComponent;
+ OReportController& m_rReportController;
+ OScrollWindowHelper m_aScrollWindow;
+ 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_aGridSizeCoarse;
+ Size m_aGridSizeFine;
+ BOOL m_bGridVisible;
+ BOOL m_bGridSnap;
+ BOOL m_bDeleted;
+
+
+ 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& _rController);
+ 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_rReportController; }
+
+ void SetMode( DlgEdMode m_eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ USHORT GetInsertObj() const;
+ rtl::OUString GetInsertObjString() 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() const;
+
+ /** 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);
+
+#if 0
+ /** checks if alignment is possible in the current section
+ */
+ sal_Bool isAlignPossible() const;
+#endif
+
+ /** All objects will be marked.
+ */
+ void SelectAll(const sal_uInt16 _nObjectType);
+
+ /// checks if a selection exists
+ BOOL HasSelection() const;
+
+ void UpdatePropertyBrowserDelayed(OSectionView& _rView);
+
+ 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 getGridSizeCoarse() const { return m_aGridSizeCoarse; }
+ inline Size getGridSizeFine() const { return m_aGridSizeFine; }
+ inline BOOL isGridSnap() const { return m_bGridSnap; }
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ /** 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<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) 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);
+
+ /** 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(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;
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+
+ /** 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::uno::XInterface > >& _rSelection) const;
+
+ /** returns the selected field from the add field dialog
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getSelectedFieldDescriptors();
+
+ /** calculates the zoom factor.
+ @param _eType which kind of zoom is needed
+ */
+ sal_uInt16 getZoomFactor(SvxZoomType _eType) 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..90655077a167
--- /dev/null
+++ b/reportdesign/source/ui/inc/EndMarker.hxx
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_ENDMARKER_HXX
+#define RPTUI_ENDMARKER_HXX
+
+#include "ColorListener.hxx"
+
+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/FixedTextColor.hxx b/reportdesign/source/ui/inc/FixedTextColor.hxx
new file mode 100644
index 000000000000..cbec4e46a0c9
--- /dev/null
+++ b/reportdesign/source/ui/inc/FixedTextColor.hxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_FIXEDTEXTCOLOR_HXX
+#define INCLUDED_FIXEDTEXTCOLOR_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/XControl.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/report/XFixedText.hpp>
+/** === end UNO includes === **/
+
+#include <IReportControllerObserver.hxx>
+
+//#include <boost/noncopyable.hpp>
+#include <vector>
+
+namespace rptui
+{
+ class OReportController;
+
+ class FixedTextColor : public IReportControllerObserver
+ {
+ const OReportController& m_rReportController;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > getVclWindowPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFixedText >& _xComponent) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > getXControl(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFixedText >& _xFixedText) throw(::com::sun::star::uno::RuntimeException);
+
+ void setPropertyTextColor(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >& _xVclWindowPeer, sal_Int32 _nFormatKey);
+
+ // sal_Int32 getTextColor();
+
+ public:
+ FixedTextColor(const OReportController & _aObserver);
+ virtual ~FixedTextColor();
+
+ void notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent );
+ void notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
+ void handle( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
+
+ };
+
+} // namespace rptui
+
+
+#endif
diff --git a/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx b/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx
new file mode 100644
index 000000000000..84119777a160
--- /dev/null
+++ b/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_FORMATTEDFIELDBEAUTIFIER_HXX
+#define INCLUDED_FORMATTEDFIELDBEAUTIFIER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/report/XReportComponent.hpp>
+/** === end UNO includes === **/
+
+//#include <boost/noncopyable.hpp>
+#include <vector>
+#include <IReportControllerObserver.hxx>
+
+namespace rptui
+{
+ class OReportController;
+
+ class FormattedFieldBeautifier : public IReportControllerObserver
+ {
+ const OReportController& m_rReportController;
+ sal_Int32 m_nTextColor;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > getVclWindowPeer(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xComponent) throw(::com::sun::star::uno::RuntimeException);
+
+ void setPlaceholderText( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
+ void setPlaceholderText( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >& _xVclWindowPeer, const ::rtl::OUString& _rText );
+
+ sal_Int32 getTextColor();
+
+ public:
+ FormattedFieldBeautifier(const OReportController & _aObserver);
+ virtual ~FormattedFieldBeautifier();
+
+ void notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent );
+ void notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
+ void handle( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement );
+ };
+
+} // namespace rptui
+
+
+#endif
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
new file mode 100644
index 000000000000..da9825adf349
--- /dev/null
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_FORMULA_HXX
+#define RPTUI_FORMULA_HXX
+
+#include <formula/formula.hxx>
+#include <formula/IFunctionDescription.hxx>
+#include <formula/IControlReferenceHandler.hxx>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/report/meta/XFormulaParser.hpp>
+
+class SvLBoxEntry;
+//============================================================================
+namespace rptui
+{
+//============================================================================
+class FunctionManager;
+class OAddFieldWindow;
+
+//============================================================================
+class FormulaDialog : public formula::FormulaModalDialog,
+ public formula::IFormulaEditorHelper,
+ public formula::IControlReferenceHandler
+{
+ ::boost::shared_ptr< formula::IFunctionManager > m_aFunctionManager;
+ formula::FormEditData* m_pFormulaData;
+ OAddFieldWindow* m_pAddField;
+ ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > m_xRowSet;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFormulaParser> m_xParser;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
+ formula::RefEdit* m_pEdit;
+ String m_sFormula;
+ xub_StrLen m_nStart;
+ xub_StrLen m_nEnd;
+
+ DECL_LINK( OnClickHdl, OAddFieldWindow*);
+public:
+ FormulaDialog( Window* pParent
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xServiceFactory
+ , const ::boost::shared_ptr< formula::IFunctionManager >& _pFunctionMgr
+ , const ::rtl::OUString& _sFormula
+ , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet);
+ virtual ~FormulaDialog();
+
+ // IFormulaEditorHelper
+ virtual void notifyChange();
+ virtual void fill();
+ virtual bool calculateValue(const String& _sExpression,String& _rResult);
+ virtual void doClose(BOOL _bOk);
+ virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc);
+ virtual void showReference(const String& _sFormula);
+ virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked);
+ virtual void setDispatcherLock( BOOL bLock );
+ virtual void setReferenceInput(const formula::FormEditData* _pData);
+ virtual void deleteFormData();
+ virtual void clear();
+ virtual void switchBack();
+ virtual formula::FormEditData* getFormEditData() const;
+ virtual void setCurrentFormula(const String& _sReplacement);
+ virtual void setSelection(xub_StrLen _nStart,xub_StrLen _nEnd);
+ virtual void getSelection(xub_StrLen& _nStart,xub_StrLen& _nEnd) const;
+ virtual String getCurrentFormula() const;
+
+ virtual formula::IFunctionManager* getFunctionManager();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const;
+ virtual ::com::sun::star::table::CellAddress getReferencePosition() const;
+
+ virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList);
+
+ // IControlReferenceHandler
+ virtual void ShowReference(const String& _sRef);
+ virtual void HideReference( BOOL bDoneRefMode = TRUE );
+ virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
+ virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
+
+protected:
+ void HighlightFunctionParas(const String& aFormula);
+};
+
+// =============================================================================
+} // rptui
+// =============================================================================
+
+#endif // RPTUI_FORMULA_HXX
+
diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx
new file mode 100644
index 000000000000..e2a43c163808
--- /dev/null
+++ b/reportdesign/source/ui/inc/FunctionHelper.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_FUNCTIONHELPER_HXX
+#define RPTUI_FUNCTIONHELPER_HXX
+
+#include <formula/IFunctionDescription.hxx>
+#include <com/sun/star/report/meta/XFunctionManager.hpp>
+#include <com/sun/star/report/meta/XFunctionCategory.hpp>
+#include <com/sun/star/report/meta/XFunctionDescription.hpp>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+#include <tools/string.hxx>
+#include <comphelper/stl_types.hxx>
+
+
+namespace rptui
+{
+//============================================================================
+class FunctionCategory;
+class FunctionDescription;
+//============================================================================
+class FunctionManager : public formula::IFunctionManager
+{
+ DECLARE_STL_USTRINGACCESS_MAP( ::boost::shared_ptr< FunctionDescription >, TFunctionsMap);
+ DECLARE_STL_USTRINGACCESS_MAP( ::boost::shared_ptr< FunctionCategory > , TCategoriesMap);
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionManager> m_xMgr;
+ mutable TCategoriesMap m_aCategories;
+ mutable ::std::vector< TCategoriesMap::iterator > m_aCategoryIndex;
+ mutable TFunctionsMap m_aFunctions;
+public:
+ FunctionManager(const ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionManager>& _xMgr);
+ virtual ~FunctionManager();
+ virtual sal_uInt32 getCount() const;
+ virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
+ virtual void fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& _rLastRUFunctions) const;
+ virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString& _sFunctionName) const;
+ virtual sal_Unicode getSingleToken(const EToken _eToken) const;
+
+ ::boost::shared_ptr< FunctionDescription > get(const ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionDescription>& _xFunctionDescription) const;
+};
+//============================================================================
+class FunctionDescription : public formula::IFunctionDescription
+{
+ ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FunctionArgument > m_aParameter;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionDescription> m_xFunctionDescription;
+ const formula::IFunctionCategory* m_pFunctionCategory;
+public:
+ FunctionDescription(const formula::IFunctionCategory* _pFunctionCategory,const ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionDescription>& _xFunctionDescription);
+ virtual ~FunctionDescription(){}
+
+ virtual ::rtl::OUString getFunctionName() const ;
+ virtual const formula::IFunctionCategory* getCategory() const ;
+ virtual ::rtl::OUString getDescription() const ;
+ virtual xub_StrLen getSuppressedArgumentCount() const ;
+ virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const ;
+ virtual void fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const ;
+ virtual void initArgumentInfo() const;
+ virtual ::rtl::OUString getSignature() const ;
+ virtual rtl::OString getHelpId() const ;
+ virtual sal_uInt32 getParameterCount() const ;
+ virtual ::rtl::OUString getParameterName(sal_uInt32 _nPos) const ;
+ virtual ::rtl::OUString getParameterDescription(sal_uInt32 _nPos) const ;
+ virtual bool isParameterOptional(sal_uInt32 _nPos) const ;
+};
+//============================================================================
+class FunctionCategory : public formula::IFunctionCategory
+{
+ mutable ::std::vector< ::boost::shared_ptr< FunctionDescription > > m_aFunctions;
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionCategory> m_xCategory;
+ sal_uInt32 m_nFunctionCount;
+ sal_uInt32 m_nNumber;
+ const FunctionManager* m_pFunctionManager;
+public:
+ FunctionCategory(const FunctionManager* _pFMgr,sal_uInt32 _nPos,const ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFunctionCategory>& _xCategory);
+ virtual ~FunctionCategory() {}
+
+ virtual sal_uInt32 getCount() const;
+ virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
+ virtual sal_uInt32 getNumber() const;
+ virtual const formula::IFunctionManager* getFunctionManager() const;
+ virtual ::rtl::OUString getName() const;
+};
+// =============================================================================
+} // rptui
+// =============================================================================
+
+#endif //RPTUI_FUNCTIONHELPER_HXX
diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx
new file mode 100644
index 000000000000..a03c9d447316
--- /dev/null
+++ b/reportdesign/source/ui/inc/GeometryHandler.hxx
@@ -0,0 +1,321 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_GEOMETRYHANDLER_HXX
+#define RPT_GEOMETRYHANDLER_HXX
+
+#include "sal/config.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "cppuhelper/compbase3.hxx"
+#include "cppuhelper/basemutex.hxx"
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#include "com/sun/star/script/XTypeConverter.hpp"
+#include "com/sun/star/beans/XPropertySet.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/report/XReportComponent.hpp"
+#include "com/sun/star/report/XFunction.hpp"
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <memory>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/listenernotification.hxx>
+#include "metadata.hxx"
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+
+ struct DefaultFunction
+ {
+ com::sun::star::beans::Optional< ::rtl::OUString> m_sInitialFormula;
+ ::rtl::OUString m_sName;
+ ::rtl::OUString m_sSearchString;
+ ::rtl::OUString m_sFormula;
+ ::sal_Bool m_bPreEvaluated;
+ ::sal_Bool m_bDeepTraversing;
+
+ inline ::rtl::OUString getName() const { return m_sName; }
+ } ;
+
+ class OPropertyInfoService;
+ typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction>, ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier> > TFunctionPair;
+ typedef ::std::multimap< ::rtl::OUString,TFunctionPair, ::comphelper::UStringMixLess > TFunctions;
+ typedef ::comphelper::OSimpleListenerContainer < ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::beans::PropertyChangeEvent
+ > PropertyChangeListeners;
+ typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::inspection::XPropertyHandler
+ , ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::lang::XServiceInfo> GeometryHandler_Base;
+
+ class GeometryHandler:
+ private ::cppu::BaseMutex,
+ public GeometryHandler_Base
+ {
+ /** sets the counter function at the data field.
+ * If the counter function doesn't exist it will be created.
+ */
+ void impl_setCounterFunction_throw();
+
+ /** 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;
+
+ /** returns the data field type depending on the data field of the report control
+ *
+ * \param _sDataField if the data field is not empty it will be used as data field, otherwise the data field will be used.
+ * \return the data field type
+ */
+ sal_uInt32 impl_getDataFieldType_throw(const ::rtl::OUString& _sDataField = ::rtl::OUString()) 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 ::std::vector< ::rtl::OUString>& _aEntries
+ ,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 );
+
+ void impl_initFieldList_nothrow( ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rFieldNames ) const;
+
+ /** Creates the function defined by the function template
+ *
+ * \param _sFunctionName the function name
+ * \param _sDataField the data field
+ * \param _aFunction the function template
+ */
+ void impl_createFunction(const ::rtl::OUString& _sFunctionName,const ::rtl::OUString& _sDataField,const DefaultFunction& _aFunction);
+
+ /** check whether the given function name is a countr function.
+ *
+ * \param _sQuotedFunctionName the quoted function name to check
+ * \param _Out_sScope the scope of the function
+ * \return When true it is a counter functions otherwise false.
+ */
+ bool impl_isCounterFunction_throw(const ::rtl::OUString& _sQuotedFunctionName,::rtl::OUString& _Out_sScope) const;
+
+ /** clear the own properties like function and scope and send a notification
+ *
+ * \param _aGuard
+ * \param _sOldFunctionName
+ * \param _sOldScope
+ * \param _nOldDataFieldType
+ */
+ void resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,const ::rtl::OUString& _sOldFunctionName,const ::rtl::OUString& _sOldScope,const sal_uInt32 _nOldDataFieldType);
+
+ /** checks whether the name is a field or a parameter
+ *
+ * \param _sName the name to check
+ * \return true when it is a field or parameter otherwise false
+ */
+ bool impl_isDataField(const ::rtl::OUString& _sName) const;
+
+ /**return all formula in a semicolon seperated list
+ *
+ * \param _rList the localized function names
+ */
+ void impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const;
+
+ /** return all group names in a semicolon seperated list starting with the group where this control is contained in.
+ *
+ * \param _rList fills the list with all scope names.
+ */
+ void impl_fillScopeList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const;
+
+ /** return all supported output formats of the report definition
+ *
+ * \param _rList fills the list with all mime types
+ */
+ void impl_fillMimeTypes_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const;
+
+ /** return the one supported output formats of the report definition
+ *
+ * \param _sMimetype the mimetype
+ */
+ ::rtl::OUString impl_ConvertMimeTypeToUI_nothrow(const ::rtl::OUString& _sMimetype) const;
+
+ /** return the MimeType for the given UI Name
+ *
+ * \param _sUIName the doc ui name
+ */
+ ::rtl::OUString impl_ConvertUIToMimeType_nothrow(const ::rtl::OUString& _sUIName) const;
+
+ /** get the functions supplier for the set scope, default is the surrounding group.
+ *
+ * \param _rsNamePostFix the name post fix which canbe used when the scope as name part is needed
+ * \return the function supplier
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier> fillScope_throw(::rtl::OUString& _rsNamePostFix);
+
+ /** checks if the given function is a default function we know.
+ *
+ * \param _sQuotedFunction the quoted function name
+ * \param _Out_rDataField the data field which is used in the function
+ * \param _xFunctionsSupplier teh function supplier to search or empty if not used
+ * \param _bSet If set to TRUE than the m_sDefaultFunction and m_sScope vars will be set if successful.
+ * \return sal_True with known otherwise sal_False
+ */
+ sal_Bool isDefaultFunction(const ::rtl::OUString& _sQuotedFunction
+ ,::rtl::OUString& _Out_rDataField
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier>& _xFunctionsSupplier = ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunctionsSupplier>()
+ ,bool _bSet = false) const;
+
+ /** checks if the given function is a default function we know.
+ *
+ * \param _xFunction
+ * \param _rDataField
+ * \param _rsDefaultFunctionName
+ * \return
+ */
+ sal_Bool impl_isDefaultFunction_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction>& _xFunction
+ ,::rtl::OUString& _rDataField
+ ,::rtl::OUString& _rsDefaultFunctionName) const;
+
+ /** fills the memeber m_aDefaultFunctions
+ *
+ */
+ void loadDefaultFunctions();
+
+ /** creates a default functionof the _sFunction for the data field _sDataField
+ * The new function will only be created if it didn't exist.
+ *
+ * \param _aGuard Will be cleared, when a new function was created.
+ * \param _sFunction The name of the function.
+ * \param _sDataField The name of the data field.
+ */
+ void createDefaultFunction(::osl::ResettableMutexGuard& _aGuard ,const ::rtl::OUString& _sFunction,const ::rtl::OUString& _sDataField);
+
+ void removeFunction();
+
+ class OBlocker
+ {
+ bool& m_bIn;
+ public:
+ OBlocker(bool& _bIn) : m_bIn(_bIn){ m_bIn = true; }
+ ~OBlocker() { m_bIn = false; }
+ };
+
+
+ // 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);
+
+ 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();
+
+ PropertyChangeListeners m_aPropertyListeners;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aFieldNames;
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aParamNames;
+ TFunctions m_aFunctionNames;
+ ::std::vector< DefaultFunction > m_aDefaultFunctions;
+ DefaultFunction m_aCounterFunction;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::report::XFunction> m_xFunction;
+ ::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;
+ mutable ::rtl::OUString m_sDefaultFunction;
+ mutable ::rtl::OUString m_sScope;
+ sal_uInt32 m_nDataFieldType;
+ mutable bool m_bNewFunction;
+ bool m_bIn;
+ };
+//........................................................................
+} // 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..09fb4f188320
--- /dev/null
+++ b/reportdesign/source/ui/inc/GroupsSorting.hxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_GROUPS_SORTING_HXX
+#define RPTUI_GROUPS_SORTING_HXX
+
+#include <vcl/floatwin.hxx>
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#include <vcl/lstbox.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/field.hxx>
+#include <vcl/button.hxx>
+#include <vcl/toolbox.hxx>
+#include <com/sun/star/report/XGroups.hpp>
+#include <com/sun/star/report/XGroup.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include "GroupProperties.hxx"
+#include <comphelper/propmultiplex.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include <svtools/svmedit.hxx>
+#include <rtl/ref.hxx>
+
+#include <vector>
+
+#include <dbaccess/ToolBoxHelper.hxx>
+
+#include <vcl/ImageListProvider.hxx>
+
+namespace comphelper
+{
+ class OPropertyChangeMultiplexer;
+}
+namespace rptui
+{
+class OFieldExpressionControl;
+class OReportController;
+/*************************************************************************
+|*
+|* Groups and Sorting dialog
+|*
+\************************************************************************/
+
+class OGroupsSortingDialog : public FloatingWindow
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ ,public dbaui::OToolBoxHelper
+ ,public vcl::IImageListProvider
+{
+ friend class OFieldExpressionControl;
+
+ FixedLine m_aFL2;
+ FixedText m_aMove;
+//BTN ImageButton m_aPB_Up;
+//BTN ImageButton m_aPB_Down;
+//BTN ImageButton m_aPB_Delete;
+ ToolBox m_aToolBox;
+
+ 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;
+ sal_Bool m_bReadOnly;
+private:
+ DECL_LINK( OnControlFocusLost, Control* );
+ DECL_LINK( OnControlFocusGot, Control* );
+ DECL_LINK( LBChangeHdl, ListBox* );
+//BTN DECL_LINK( ClickHdl, ImageButton* );
+ DECL_LINK( OnFormatAction, ToolBox* );
+
+ /** 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( );
+
+ /** will be called when the controls need to be resized.
+ @param _rDiff
+ Contains the difference of the old and new toolbox size.
+ */
+ virtual void resizeControls(const Size& _rDiff);
+
+ /** will be called when the image list is needed.
+ @param _eSymbolsSize
+ <svtools/imgdef.hxx>
+ @param _bHiContast
+ <TRUE/> when in high contrast mode.
+ */
+ virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const;
+
+ // ImageListProvider interface
+ virtual ImageList getImageList(vcl::ImageListType) SAL_THROW ((com::sun::star::lang::IllegalArgumentException ));
+
+};
+// =============================================================================
+} // namespace rptui
+// =============================================================================
+#endif // RPTUI_GROUPS_SORTING_HXX
diff --git a/reportdesign/source/ui/inc/IReportControllerObserver.hxx b/reportdesign/source/ui/inc/IReportControllerObserver.hxx
new file mode 100644
index 000000000000..497fe874b3ef
--- /dev/null
+++ b/reportdesign/source/ui/inc/IReportControllerObserver.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_BEAUTIFIER_HXX
+#define INCLUDED_BEAUTIFIER_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+/** === end UNO includes === **/
+
+namespace rptui
+{
+ /* abstract */ class IReportControllerObserver
+ {
+ protected:
+ // IReportControllerObserver(){}
+ virtual ~IReportControllerObserver() {}
+
+ public:
+
+ virtual void notifyPropertyChange( const ::com::sun::star::beans::PropertyChangeEvent& _rEvent ) = 0;
+ virtual void notifyElementInserted( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement ) = 0;
+ virtual void handle( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement ) = 0;
+ };
+
+} // namespace rptui
+
+#endif
+
+
diff --git a/reportdesign/source/ui/inc/InsertFunctions.hxx b/reportdesign/source/ui/inc/InsertFunctions.hxx
new file mode 100644
index 000000000000..b177377fd5fd
--- /dev/null
+++ b/reportdesign/source/ui/inc/InsertFunctions.hxx
@@ -0,0 +1,46 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPT_INSERTFUNCTIONS_HXX_INCLUDED
+#define RPT_INSERTFUNCTIONS_HXX_INCLUDED
+
+#ifndef _EVENT_HXX //autogen
+#include <vcl/event.hxx>
+#endif
+#include <vcl/timer.hxx>
+
+class SdrView;
+class Window;
+class SdrModel;
+class SdrObject;
+namespace rptui
+{
+/************************************************************************/
+// ---------
+} // namespace rptui
+// ---------
+#endif // RPT_INSERTFUNCTIONS_HXX_INCLUDED
+
diff --git a/reportdesign/source/ui/inc/MarkedSection.hxx b/reportdesign/source/ui/inc/MarkedSection.hxx
new file mode 100644
index 000000000000..eb892aee92eb
--- /dev/null
+++ b/reportdesign/source/ui/inc/MarkedSection.hxx
@@ -0,0 +1,60 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPTUI_MARKEDSECTION_HXX
+#define RPTUI_MARKEDSECTION_HXX
+
+#include <boost/shared_ptr.hpp>
+
+namespace rptui
+{
+ class OSectionWindow; // forward declaration
+
+ enum NearSectionAccess
+ {
+ CURRENT = 0,
+ PREVIOUS = -1,
+ POST = 1
+ };
+
+ class IMarkedSection
+ {
+ public:
+ /** returns the section which is currently marked.
+ */
+ virtual ::boost::shared_ptr<OSectionWindow> 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..a9cf2fd9222e
--- /dev/null
+++ b/reportdesign/source/ui/inc/Navigator.hxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_RPTUI_NAVIGATOR_HXX
+#define INCLUDED_RPTUI_NAVIGATOR_HXX
+
+#include <vcl/floatwin.hxx>
+#include "ModuleHelper.hxx"
+#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
+ ,OReportController& _rController);
+ virtual ~ONavigator();
+
+ // window
+ virtual void Resize();
+ virtual void GetFocus();
+ };
+// =============================================================================
+} // 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..fd574ff5fa8b
--- /dev/null
+++ b/reportdesign/source/ui/inc/PageNumber.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_PAGENUMBER_HXX
+#define RPTUI_PAGENUMBER_HXX
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#include <vcl/lstbox.hxx>
+#include <vcl/field.hxx>
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#include <com/sun/star/report/XReportDefinition.hpp>
+
+
+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..080d913d59ab
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportComponentHandler.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef RPT_REPORTCOMPONENTHANDLER_HXX
+#define RPT_REPORTCOMPONENTHANDLER_HXX
+
+#include "sal/config.h"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "cppuhelper/compbase2.hxx"
+#include "cppuhelper/basemutex.hxx"
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+
+#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..6694c81c999b
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -0,0 +1,487 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_REPORTCONTROLLER_HXX
+#define RPTUI_REPORTCONTROLLER_HXX
+
+#include <dbaccess/singledoccontroller.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XRowSet.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/io/XObjectOutputStream.hpp>
+#include <com/sun/star/io/XObjectInputStream.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XReportControlModel.hpp>
+#include <com/sun/star/report/XReportEngine.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/embed/XVisualObject.hpp>
+#include <cppuhelper/implbase5.hxx>
+#include <svtools/transfer.hxx>
+#include <svl/lstner.hxx>
+#include <svx/svdedtv.hxx>
+#include <svx/zoomitem.hxx>
+#include "ModuleHelper.hxx"
+
+#include <comphelper/uno3.hxx>
+#include <comphelper/implementationreference.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertystatecontainer.hxx>
+
+#include "RptDef.hxx"
+#include "DesignView.hxx"
+#include <functional>
+#include <boost/shared_ptr.hpp>
+#include <com/sun/star/util/XModeSelector.hpp>
+#include "ReportControllerObserver.hxx"
+
+class TransferableHelper;
+class TransferableClipboardListener;
+class VclWindowEvent;
+namespace rptui
+{
+ class OGroupsSortingDialog;
+ class OPropertyMediator;
+ class OReportModel;
+ class OSectionView;
+ class OAddFieldWindow;
+ class OSectionWindow;
+
+ typedef ::dbaui::OSingleDocumentController OReportController_BASE;
+ typedef ::cppu::ImplHelper5 < ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::view::XSelectionSupplier
+ , ::com::sun::star::util::XModeSelector
+ , ::com::sun::star::embed::XVisualObject
+ > OReportController_Listener;
+
+ class OReportController : public OReportController_BASE
+ ,public OReportController_Listener
+ ,public SfxListener
+ ,public ::comphelper::OPropertyStateContainer
+ ,public ::comphelper::OPropertyArrayUsageHelper < OReportController_BASE >
+ {
+ private:
+ OModuleClient m_aModuleClient;
+ ::cppu::OInterfaceContainerHelper
+ m_aSelectionListeners;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>
+ m_aCollapsedSections;
+ TransferableDataHelper m_aSystemClipboard; // content of the clipboard
+ TransferableClipboardListener*
+ m_pClipbordNotifier; /// notifier for changes in the clipboard
+ OGroupsSortingDialog* m_pGroupsFloater;
+
+ OXReportControllerObserver* m_pReportControllerObserver;
+
+ ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); }
+
+ ::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;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the report's NumberFormatsSupplier
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xHoldAlive;
+ mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns;
+ ::com::sun::star::awt::Size m_aVisualAreaSize;
+
+ ::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
+ ::rtl::OUString m_sMode; /// the current mode of the controller
+ sal_Int32 m_nSplitPos; /// the position of the splitter
+ sal_Int32 m_nPageNum; /// the page number from the restoreView call
+ sal_Int32 m_nSelectionCount;
+ ::sal_Int64 m_nAspect;
+ sal_Int16 m_nZoomValue;
+ SvxZoomType m_eZoomType;
+ sal_Bool m_bShowRuler;
+ sal_Bool m_bGridVisible;
+ sal_Bool m_bGridUse;
+ sal_Bool m_bShowProperties;
+ sal_Bool m_bGroupFloaterWasVisible;
+ sal_Bool m_bHelplinesMove;
+ bool m_bChartEnabled;
+ bool m_bChartEnabledAsked;
+ bool m_bInGeneratePreview;
+
+ /** 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);
+
+ /** 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();
+
+ /** opens the zoom dialog
+ */
+ void openZoomDialog();
+
+ /** 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);
+ /** shrink a section
+ @param _nUndoStrId the string id of the string which is shown in undo menu
+ @param _nShrinkId ID of what you would like to shrink.
+ */
+ protected:
+ void shrinkSectionBottom(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection);
+ void shrinkSectionTop(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection);
+ public:
+
+ void shrinkSection(USHORT _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId);
+
+ /** 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);
+
+ /** collapse or expand the currently selected section.
+ *
+ * \param _bCollapse collapse if TRUE otherwise expand
+ */
+ void collapseSection(const bool _bCollapse);
+
+ /** fills the member that chart is enabled or not
+ *
+ */
+ void checkChartEnabled();
+
+ /** set the zoom factor at the design view
+ */
+ void impl_zoom_nothrow();
+
+ private:
+ OReportController(OReportController const&);
+ OReportController& operator =(OReportController const&);
+ public:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame();
+
+ // open the help agent of report designer at start time
+ void doOpenHelpAgent();
+
+ /** creates a new default control for the currently set type when the modifier KEY_MOD1 was pressed
+ * \param _aArgs must contain a properyvalue with name "KeyModifier" and value KEY_MOD1 when control should be created.
+ */
+ void createDefaultControl(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aArgs);
+
+ /** fills the state for the feture request.
+ @param _sProperty the property which should be filled in the value
+ @param _rState the state to fill
+ */
+ void impl_fillState_nothrow(const ::rtl::OUString& _sProperty,dbaui::FeatureState& _rState) const;
+ void impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const;
+
+ /** set the property at all selected controls.
+ @return <TRUE/> when the selection is not empty
+ */
+ bool impl_setPropertyAtControls_throw(const sal_uInt16 _nUndoResId
+ ,const ::rtl::OUString& _sProperty
+ ,const ::com::sun::star::uno::Any& _aValue
+ ,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs);
+
+ DECL_LINK( OnInvalidateClipboard, void* );
+ DECL_LINK( OnClipboardChanged, void* );
+ DECL_LINK( OnExecuteReport, void* );
+ DECL_LINK( OnOpenHelpAgent, 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 getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const;
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
+
+ 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* );
+ DECL_LINK( OnCreateHdl, OAddFieldWindow*);
+
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // SfxListener
+ virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint);
+
+ virtual void impl_onModifyChanged();
+
+ // 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);
+
+ // 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);
+ virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) 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 );
+
+ // XTitle
+ virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XModeSelector
+ virtual void SAL_CALL setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException) ;
+ virtual ::rtl::OUString SAL_CALL getMode( ) throw (::com::sun::star::uno::RuntimeException) ;
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException) ;
+ virtual ::sal_Bool SAL_CALL supportsMode( const ::rtl::OUString& aMode ) throw (::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);
+
+
+ /** 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();
+
+ /** returns the number formatter
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getReportNumberFormatter() const;
+
+ /** return the SdrModel of the real model
+ *
+ * \return
+ */
+ ::boost::shared_ptr<rptui::OReportModel> getSdrModel();
+
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; }
+ inline sal_Int16 getZoomValue() const { return m_nZoomValue; }
+ inline void resetZoomType() { m_eZoomType = SVX_ZOOM_PERCENT; }
+
+ // 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)
+ {
+ return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
+ }
+ // comphelper::OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+
+ // cppu::OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getColumns() const;
+ ::rtl::OUString getColumnLabel_throw(const ::rtl::OUString& i_sColumnName) const;
+
+ private:
+ virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager );
+ virtual void impl_initialize( );
+ bool isUiVisible() const;
+ };
+}
+#endif // RPTUI_REPORTCONTROLLER_HXX
+
diff --git a/reportdesign/source/ui/inc/ReportControllerObserver.hxx b/reportdesign/source/ui/inc/ReportControllerObserver.hxx
new file mode 100644
index 000000000000..5f7868c9fa14
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportControllerObserver.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef INCLUDED_REPORTCONTROLLEROBSERVER_HXX
+#define INCLUDED_REPORTCONTROLLEROBSERVER_HXX
+
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <cppuhelper/implbase3.hxx>
+
+#include <memory>
+#include <dllapi.h>
+#include <vector>
+
+// #include <svl/lstner.hxx>
+#include <vcl/svapp.hxx>
+#include <tools/link.hxx>
+
+#include <FormattedFieldBeautifier.hxx>
+#include <FixedTextColor.hxx>
+
+namespace rptui
+{
+ class OReportController;
+ class OXReportControllerObserverImpl;
+
+ //========================================================================
+ class /* REPORTDESIGN_DLLPUBLIC */ OXReportControllerObserver
+ : public ::cppu::WeakImplHelper3< ::com::sun::star::beans::XPropertyChangeListener
+ , ::com::sun::star::container::XContainerListener
+ , ::com::sun::star::util::XModifyListener
+ >
+ /*,public SfxListener*/
+ {
+
+ const ::std::auto_ptr<OXReportControllerObserverImpl> m_pImpl;
+
+ FormattedFieldBeautifier m_aFormattedFieldBeautifier;
+ FixedTextColor m_aFixedTextColor;
+
+ // do not allow copy
+ OXReportControllerObserver(const OXReportControllerObserver&);
+ OXReportControllerObserver& operator=(const OXReportControllerObserver&);
+ virtual ~OXReportControllerObserver(); // UNO Object must have private destructor!
+ public:
+ OXReportControllerObserver(const OReportController& _rController);
+
+// protected:
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException);
+
+ // 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);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
+
+
+ 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 );
+
+ // SfxListener
+ // virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ /**
+ Create an object ob OUndoEnvLock locks the undo possibility
+ As long as in the OUndoEnvLock scope, no undo is possible for manipulated object.
+ */
+ class OEnvLock
+ {
+ OXReportControllerObserver& m_rObserver;
+ public:
+ OEnvLock(OXReportControllerObserver& _rObserver): m_rObserver(_rObserver){m_rObserver.Lock();}
+ ~OEnvLock(){ m_rObserver.UnLock(); }
+ };
+
+ void Lock();
+ void UnLock();
+ sal_Bool IsLocked() const;
+
+ void Clear();
+ private:
+
+ void TogglePropertyListening(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& Element);
+ 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(());
+
+ // void ModeChanged(); // will be called from 'Notify'
+ DECL_LINK(SettingsChanged, VclWindowEvent* );
+ private:
+
+ ::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;
+
+ };
+
+} // namespace rptui
+
+#endif /* INCLUDED_REPORTCONTROLLEROBSERVER_HXX */
+
+
diff --git a/reportdesign/source/ui/inc/ReportDefines.hxx b/reportdesign/source/ui/inc/ReportDefines.hxx
new file mode 100644
index 000000000000..9d207c9c9142
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportDefines.hxx
@@ -0,0 +1,39 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_REPORT_DEFINES_HXX
+#define RPTUI_REPORT_DEFINES_HXX
+
+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..ba65b1b80b9f
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportRuler.hxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_RULER_HXX
+#define RPTUI_RULER_HXX
+
+#include <vcl/window.hxx>
+#include <com/sun/star/report/XSection.hpp>
+
+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..a95fd72b7f40
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportSection.hxx
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef REPORT_REPORTSECTION_HXX
+#define REPORT_REPORTSECTION_HXX
+
+#include <vcl/window.hxx>
+#include "RptPage.hxx"
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <comphelper/propmultiplex.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include "ReportDefines.hxx"
+#include "dlgedfunc.hxx"
+#include <svtools/transfer.hxx>
+#include <rtl/ref.hxx>
+#include <boost/shared_ptr.hpp>
+#include <memory>
+
+namespace rptui
+{
+ class OReportModel;
+ class OReportPage;
+ class OSectionView;
+ class OSectionWindow;
+
+ class OReportSection : public Window
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ , public DropTargetHelper
+ {
+ OReportPage* m_pPage;
+ OSectionView* m_pView;
+ OSectionWindow* 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 Resize();
+
+ // OPropertyChangeListener
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+ public:
+ OReportSection(OSectionWindow* _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);
+
+ void Copy(::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _rAllreadyCopiedObjects,bool _bEraseAnddNoClone);
+
+ /** 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(const sal_uInt16 _nObjectType);
+
+ /** makes the grid visible
+ *
+ * \param _bVisible when <TRUE/> the grid is made visible
+ */
+ void SetGridVisible(BOOL _bVisible);
+
+ inline OSectionWindow* getSectionWindow() const { return m_pParent; }
+ inline OSectionView& getSectionView() 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; }
+
+ 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 );
+
+ /** 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::uno::XInterface > >& _rSelection) const;
+
+ /** creates a default object (custom shape)
+ *
+ * @param _sType
+ */
+ void createDefault(const ::rtl::OUString& _sType);
+
+ /** creates a new default custom shape
+ *
+ * \param _sType
+ * \param _pObj
+ */
+ void createDefault(const ::rtl::OUString& _sType,SdrObject* _pObj);
+ void stopScrollTimer();
+
+ /** deactivate the currect active ole object if any
+ */
+ void deactivateOle();
+
+ /** returns true when an ole object is currently active
+ */
+ bool isUiActive() const;
+ };
+//==================================================================
+} //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..4267bc0ef6e4
--- /dev/null
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -0,0 +1,238 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_REPORT_WINDOW_HXX
+#define RPTUI_REPORT_WINDOW_HXX
+
+#include <com/sun/star/report/XSection.hpp>
+#include "ReportDefines.hxx"
+#include "StartMarker.hxx"
+#include <svtools/ruler.hxx>
+#include <svx/svdedtv.hxx>
+#include <svx/zoomitem.hxx>
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <MarkedSection.hxx>
+#include "ViewsWindow.hxx"
+
+class Splitter;
+
+namespace rptui
+{
+ class ODesignView;
+ class OReportSection;
+ class OScrollWindowHelper;
+ class OSectionView;
+ class OReportModel;
+ class OEndMarker;
+ class OReportPage;
+ class DlgEdFunc;
+ class DlgEdFactory;
+
+ class OReportWindow : public Window, public IMarkedSection
+ {
+ Ruler m_aHRuler;
+ ODesignView* m_pView;
+ OScrollWindowHelper* m_pParent;
+ OViewsWindow m_aViewsWindow;
+ ::std::auto_ptr<DlgEdFactory>
+ m_pObjFac;
+
+ void ImplInitSettings();
+
+ sal_Int32 GetTotalHeight() const;
+ sal_Int32 impl_getRealPixelWidth() 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();
+ // 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());
+ rtl::OUString GetInsertObjString() const;
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed() const;
+
+ /** 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(const sal_uInt16 _nObjectType);
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection() const;
+
+ Point getThumbPos() 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;
+
+ void ScrollChildren(const Point& _aThumbPos);
+
+ void notifySizeChanged();
+
+ /** 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<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) 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;
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+
+ /** 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::uno::XInterface > >& _rSelection) const;
+
+ /** calculates the zoom factor.
+ @param _eType which kind of zoom is needed
+ */
+ sal_uInt16 getZoomFactor(SvxZoomType _eType) 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..d5080e56d28d
--- /dev/null
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_SCROLLHELPER_HXX
+#define RPTUI_SCROLLHELPER_HXX
+
+#include <vcl/scrbar.hxx>
+#include <com/sun/star/report/XSection.hpp>
+#include <comphelper/propmultiplex.hxx>
+#include "ReportDefines.hxx"
+#include <svtools/colorcfg.hxx>
+#include <svx/svdedtv.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include <rtl/ref.hxx>
+#include <boost/shared_ptr.hpp>
+#include <vcl/dockwin.hxx>
+#include <MarkedSection.hxx>
+#include "ReportWindow.hxx"
+
+class SdrView;
+namespace rptui
+{
+ 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
+ Size m_aTotalPixelSize;
+ ODesignView* m_pParent;
+ OReportWindow m_aReportWindow;
+ ::rtl::Reference<comphelper::OPropertyChangeMultiplexer >
+ m_pReportDefintionMultiPlexer; // listener for property changes
+
+ DECL_LINK( ScrollHdl, ScrollBar*);
+ Size ResizeScrollBars();
+ void ImplInitSettings();
+ void impl_initScrollBar( ScrollBar& _rScrollBar ) const;
+
+ 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();
+
+ inline Point getThumbPos() const { return Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; }
+ inline const OReportWindow& getReportWindow() const { return m_aReportWindow; }
+ 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());
+ rtl::OUString GetInsertObjString() const;
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed() const;
+
+ /** 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(const sal_uInt16 _nObjectType);
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection() 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);
+
+ /** 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<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const;
+ ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) 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;
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+
+ /** 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::uno::XInterface > >& _rSelection) const;
+
+ /** calculates the zoom factor.
+ @param _eType which kind of zoom is needed
+ */
+ sal_uInt16 getZoomFactor(SvxZoomType _eType) 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..71d07db7b7a2
--- /dev/null
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_SECTIONVIEW_HXX
+#define _REPORT_SECTIONVIEW_HXX
+
+
+#include <svx/svdview.hxx>
+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* getReportSection() const { return m_pSectionWindow; }
+
+ // switch the marked objects to the given layer.
+ void SetMarkedToLayer( SdrLayerID nLayerNo );
+
+ // return true when only shapes are marked, otherwise false.
+ bool OnlyShapesMarked() const;
+
+ /* returns the common layer id of the marked objects, otherwise -1 will be returned.
+ */
+ short GetLayerIdOfMarkedObjects() const;
+
+ // returns true if objects at Drag & Drop is resize not move
+ bool IsDragResize() const;
+};
+}
+#endif //_REPORT_SECTIONVIEW_HXX
diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx
new file mode 100644
index 000000000000..d9c2fa01d676
--- /dev/null
+++ b/reportdesign/source/ui/inc/SectionWindow.hxx
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_SECTIONWINDOW_HXX
+#define RPTUI_SECTIONWINDOW_HXX
+
+#include <com/sun/star/report/XSection.hpp>
+#include <vcl/window.hxx>
+#include <vcl/split.hxx>
+#include <svtools/colorcfg.hxx>
+#include <comphelper/propmultiplex.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include "UITools.hxx"
+#include "UndoActions.hxx"
+#include "StartMarker.hxx"
+#include "EndMarker.hxx"
+#include "ReportSection.hxx"
+
+#include <list>
+#include <map>
+#include <boost/shared_ptr.hpp>
+
+namespace comphelper
+{
+ class OPropertyChangeMultiplexer;
+}
+namespace rptui
+{
+ class OReportWindow;
+ class ODesignView;
+ class OViewsWindow;
+ class OSectionWindow : public Window
+ , public ::cppu::BaseMutex
+ , public ::comphelper::OPropertyChangeListener
+ {
+ OViewsWindow* m_pParent;
+ OStartMarker m_aStartMarker;
+ OReportSection m_aReportSection;
+ Splitter m_aSplitter;
+ OEndMarker m_aEndMarker;
+
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti;
+ ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti;
+
+ OSectionWindow(OSectionWindow&);
+ void operator =(OSectionWindow&);
+
+ /** set the title of the group header or footer
+ *
+ * \param _xGroup
+ * \param _nResId
+ * \param _pGetSection
+ * \param _pIsSectionOn
+ * @return TRUE when title was set otherwise FALSE
+ */
+ bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OGroupHelper> _pIsSectionOn);
+
+ /** set the title of the (report/page) header or footer
+ *
+ * \param _xGroup
+ * \param _nResId
+ * \param _pGetSection
+ * \param _pIsSectionOn
+ * @return TRUE when title was set otherwise FALSE
+ */
+ bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OReportHelper> _pIsSectionOn);
+ void ImplInitSettings();
+
+ DECL_LINK(Collapsed,OColorListener*);
+ DECL_LINK(StartSplitHdl, Splitter*);
+ DECL_LINK(SplitHdl, Splitter*);
+ DECL_LINK(EndSplitHdl, Splitter*);
+
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ // windows overload
+ virtual void Resize();
+
+ protected:
+ virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& _rEvent) throw( ::com::sun::star::uno::RuntimeException);
+ public:
+ OSectionWindow( OViewsWindow* _pParent
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry);
+ virtual ~OSectionWindow();
+
+ inline OStartMarker& getStartMarker() { return m_aStartMarker; }
+ inline OReportSection& getReportSection() { return m_aReportSection; }
+ inline OEndMarker& getEndMarker() { return m_aEndMarker; }
+ inline OViewsWindow* getViewsWindow() { return m_pParent; }
+
+ void setCollapsed(sal_Bool _bCollapsed);
+
+ /** triggers the property browser with the section
+ @param _pStartMarker
+ */
+ void showProperties();
+
+ /** set the marker as marked or not marked
+ @param _bMark set the new state of the marker
+ */
+ void setMarked(sal_Bool _bMark);
+
+ OViewsWindow* getViewsWindow() const { return m_pParent; }
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+
+ void scrollChildren(long _nThumbPosX);
+ };
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // RPTUI_SECTIONWINDOW_HXX
+
diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx
new file mode 100644
index 000000000000..d1746cc46b11
--- /dev/null
+++ b/reportdesign/source/ui/inc/StartMarker.hxx
@@ -0,0 +1,88 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_STARTMARKER_HXX
+#define RPTUI_STARTMARKER_HXX
+
+#include <osl/interlck.h>
+#include <svtools/ruler.hxx>
+#include "ColorListener.hxx"
+#include <vcl/fixed.hxx>
+
+
+namespace rptui
+{
+ class OSectionWindow;
+ class OStartMarker : public OColorListener
+ {
+
+ Ruler m_aVRuler;
+ FixedText m_aText;
+ FixedImage m_aImage;
+ OSectionWindow* 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_Bool m_bShowRuler;
+
+ void changeImage();
+ void initDefaultNodeImages();
+ void setColor();
+ virtual void ImplInitSettings();
+ OStartMarker(OStartMarker&);
+ void operator =(OStartMarker&);
+ public:
+ OStartMarker(OSectionWindow* _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 getMinHeight() const;
+
+ /** shows or hides the ruler.
+ */
+ void showRuler(sal_Bool _bShow);
+
+ virtual void setCollapsed(sal_Bool _bCollapsed);
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+ };
+}
+#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..d7aa74c240e8
--- /dev/null
+++ b/reportdesign/source/ui/inc/UITools.hxx
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_UITOOLS_HXX
+#define RPTUI_UITOOLS_HXX
+
+#include <com/sun/star/report/XGroup.hpp>
+#include <com/sun/star/report/XReportControlFormat.hpp>
+#include <com/sun/star/report/XShape.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 "ReportSection.hxx"
+#include <rtl/ref.hxx>
+#include <vcl/taskpanelist.hxx>
+#include <comphelper/stl_types.hxx>
+#include <functional>
+
+class SdrPage;
+class SdrObject;
+class SdrUnoObj;
+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,
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& _out_rNewValues
+ );
+
+ /** opens the area dialog for shapes
+ */
+ bool openAreaDialog(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::report::XShape >& _xShape
+ ,const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _xWindow
+ );
+
+ /** opens the formula dialog
+ @param _out_rFormula
+ the formula chosen by the user
+ @precond
+ we're really inspecting a database report (well, a RowSet at least)
+ @return
+ <TRUE/> if and only if the user successfully chose a clause
+ */
+ bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& _xWindow
+ , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
+ );
+
+ /** 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);
+
+
+ const sal_Int16 ISOVER_IGNORE_CUSTOMSHAPES = 1;
+
+ /** 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, sal_Int16 _nIgnoreType=0);
+
+ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj* _pIgnoreList[], int _nIgnoreListLength);
+
+ /** 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 );
+
+ /** ensures that no control overlaps the given one.
+ *
+ * \param pControl the control which should place in the section without overlapping
+ * \param _pReportSection the section
+ * \param _bInsert TRUE whe the control should be inserted, otherwise not.
+ */
+ void correctOverlapping(SdrObject* pControl,OReportSection& _aReportSection,bool _bInsert = true);
+
+ /** returns a Rectangle of a given SdrObject
+ *
+ * \param pControl the SdrObject
+ */
+
+ Rectangle getRectangleFromControl(SdrObject* pControl);
+
+ /** sets the map mode at the window
+ @param _aZoom the zoom scale
+ @param _rWindow where to set the map mode
+ */
+ void setZoomFactor(const Fraction& _aZoom,Window& _rWindow);
+}
+#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..479872b06573
--- /dev/null
+++ b/reportdesign/source/ui/inc/Undo.hxx
@@ -0,0 +1,153 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_UNDO_HXX
+#define RPTUI_UNDO_HXX
+
+#include "UndoActions.hxx"
+#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 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..13b8566933c6
--- /dev/null
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -0,0 +1,361 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_VIEWSWINDOW_HXX
+#define RPTUI_VIEWSWINDOW_HXX
+
+#include <com/sun/star/report/XSection.hpp>
+#include <vcl/window.hxx>
+#include <svtools/colorcfg.hxx>
+#include "ReportDefines.hxx"
+#include "ReportSection.hxx"
+#include <comphelper/propmultiplex.hxx>
+#include "cppuhelper/basemutex.hxx"
+#include <svtools/colorcfg.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <svx/svdedtv.hxx>
+#include <SectionView.hxx>
+#include <unotools/options.hxx>
+#include <list>
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <MarkedSection.hxx>
+#include <SectionWindow.hxx>
+
+class SdrHdl;
+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 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);
+ }
+ }
+ };
+
+ class OViewsWindow : public Window
+ , public utl::ConfigurationListener
+ , public IMarkedSection
+ {
+ typedef ::std::multimap<Rectangle,::std::pair<SdrObject*,OSectionView*>,RectangleLess> TRectangleMap;
+ public:
+ typedef ::std::vector< ::boost::shared_ptr<OSectionWindow> > TSectionsMap;
+
+ struct TReportPairHelper : public ::std::unary_function< TSectionsMap::value_type, OReportSection >
+ {
+ OReportSection& operator() (const TSectionsMap::value_type& lhs) const
+ {
+ return lhs->getReportSection();
+ }
+ };
+ struct TStartMarkerHelper : public ::std::unary_function< TSectionsMap::value_type, OStartMarker >
+ {
+ OStartMarker& operator() (const TSectionsMap::value_type& lhs) const
+ {
+ return lhs->getStartMarker();
+ }
+ };
+ 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);
+ void impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet);
+
+ 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 );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
+ public:
+ OViewsWindow(
+ OReportWindow* _pReportWindow);
+ virtual ~OViewsWindow();
+
+ // windows overload
+ virtual void Resize();
+
+ void resize(const OSectionWindow& _rSectionWindow);
+
+ /** 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<OSectionWindow> getSectionWindow(const USHORT _nPos) const;
+
+ /** turns the grid on or off
+ *
+ * \param _bVisible
+ */
+ void toggleGrid(sal_Bool _bVisible);
+ void setGridSnap(BOOL bOn);
+ void setDragStripes(BOOL bOn);
+
+ /** returns the total accumulated height of all sections until _pSection is reached
+ */
+ sal_Int32 getTotalHeight() const;
+
+ inline bool empty() const { return m_aSections.empty(); }
+ void SetMode( DlgEdMode m_eMode );
+ void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString());
+ rtl::OUString GetInsertObjString() const;
+ /** copies the current selection in this section
+ */
+ void Copy();
+
+ /** returns if paste is allowed
+ *
+ * \return <TRUE/> if paste is allowed
+ */
+ BOOL IsPasteAllowed() const;
+
+ /** 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(const sal_uInt16 _nObjectType);
+
+ /** returns <TRUE/> when a object is marked
+ */
+ BOOL HasSelection() const;
+
+ /** 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<OSectionWindow> getReportSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
+ ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) 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<OSectionWindow> 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);
+
+ /** creates a default object
+ *
+ */
+ void createDefault();
+
+ /** shows or hides the ruler.
+ */
+ void showRuler(sal_Bool _bShow);
+
+ /** 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 OSectionWindow* _pSectionWindow = NULL) const;
+
+ /** calls on every section BrkAction
+ *
+ */
+ void BrkAction();
+ void BegMarkObj(const Point& _aPnt,const OSectionView* _pSection);
+
+ private:
+ void BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView& _rSection);
+ void EndDragObj_removeInvisibleObjects();
+ Point m_aDragDelta;
+ ::std::vector<SdrObject*> m_aBegDragTempList;
+ bool isObjectInMyTempList(SdrObject *);
+ public:
+ void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection);
+ void EndDragObj(BOOL _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt);
+
+ void EndAction();
+ void ForceMarkedToAnotherPage();
+ BOOL IsAction() const;
+ BOOL IsDragObj() const;
+ void handleKey(const KeyCode& _rCode);
+ void stopScrollTimer();
+
+ /** return the section at the given point which is relative to the given section
+ *
+ * \param _pSection the section which is used as reference point
+ * \param _rPnt the point, it will be changed that it is inside the section which will be returned
+ * \return the section
+ */
+ OSectionView* getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt);
+
+ void MovAction(const Point& rPnt,const OSectionView* _pSection,bool _bMove /*= true */, bool _bControlKeySet);
+ // void MovAction2(const Point& rPnt,const OSectionView* _pSection);
+
+ sal_uInt32 getMarkedObjectCount() const;
+
+ /** 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);
+
+ /** zoom the ruler and view windows
+ */
+ void zoom(const Fraction& _aZoom);
+
+ void scrollChildren(const Point& _aThumbPos);
+
+ /** 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::uno::XInterface > >& _rSelection) 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..bc57a83dc45c
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedclip.hxx
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_RPTUICLIP_HXX
+#define _REPORT_RPTUICLIP_HXX
+
+#include <svtools/transfer.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+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..fd5738447cd6
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedfac.hxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_RPTUIFAC_HXX
+#define _REPORT_RPTUIFAC_HXX
+
+
+#include <svx/svdobj.hxx>
+
+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..0c397c106dbb
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgedfunc.hxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _REPORT_RPTUIFUNC_HXX
+#define _REPORT_RPTUIFUNC_HXX
+
+#include <vcl/timer.hxx>
+
+class Timer;
+class MouseEvent;
+class Point;
+class SdrTextObj;
+class SdrObject;
+namespace rptui
+{
+
+class OReportSection;
+class OSectionView;
+
+//============================================================================
+// DlgEdFunc
+//============================================================================
+
+class DlgEdFunc /* : public LinkHdl */
+{
+ DlgEdFunc(const DlgEdFunc&);
+ void operator =(const DlgEdFunc&);
+protected:
+ OReportSection* m_pParent;
+ OSectionView& m_rView;
+ Timer aScrollTimer;
+ Point m_aMDPos;
+ com::sun::star::uno::Reference<com::sun::star::uno::XInterface> m_xOverlappingObj;
+ SdrObject * m_pOverlappingObj;
+ sal_Int32 m_nOverlappedControlColor;
+ sal_Int32 m_nOldColor;
+ bool m_bSelectionMode;
+ bool m_bUiActive;
+ bool m_bShowPropertyBrowser;
+
+ 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);
+ /**
+ returns true, as long as only customshapes in the marked list,
+ custom shapes can drop every where
+ */
+ bool isOnlyCustomShapeMarked();
+
+ /** activate object if it is of type OBJ_OLE2
+ */
+ void activateOle(SdrObject* _pObj);
+
+ void checkTwoCklicks(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);
+ void setOverlappedControlColor(sal_Int32 _nColor);
+ void stopScrollTimer();
+
+ /** deactivate all ole object
+ */
+ void deactivateOle(bool _bSelect = false);
+
+ inline bool isUiActive() const { return m_bUiActive; }
+protected:
+ void colorizeOverlappedObject(SdrObject* _pOverlappedObj);
+ void unColorizeOverlappedObj();
+
+
+};
+
+//============================================================================
+// 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
+{
+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..d335b8f28920
--- /dev/null
+++ b/reportdesign/source/ui/inc/dlgpage.hxx
@@ -0,0 +1,54 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_DLGPAGE_HXX
+#define RPTUI_DLGPAGE_HXX
+
+#include <sfx2/tabdlg.hxx>
+
+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..3cc2a20cc465
--- /dev/null
+++ b/reportdesign/source/ui/inc/metadata.hxx
@@ -0,0 +1,162 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_METADATA_HXX_
+#define RPTUI_METADATA_HXX_
+
+#include "ModuleHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/inspection/XPropertyHandler.hpp>
+/** === 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;
+ rtl::OString getPropertyHelpId(sal_Int32 _nId) const;
+ sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const;
+ 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 ::rtl::OUString getHelpURL( const rtl::OString& _sHelpId );
+ };
+
+ //========================================================================
+ //= 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)
+ //= The ID is used for the view order in the property browser.
+ //========================================================================
+
+ #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_PRESERVEIRI 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_TYPE 21
+ #define PROPERTY_ID_DATAFIELD 22
+ #define PROPERTY_ID_CHARFONTNAME 23
+ #define PROPERTY_ID_PRINTWHENGROUPCHANGE 24
+ #define PROPERTY_ID_DEEPTRAVERSING 25
+ #define PROPERTY_ID_PREEVALUATED 26
+
+ #define PROPERTY_ID_BACKTRANSPARENT 27
+ #define PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT 28
+ #define PROPERTY_ID_BACKCOLOR 29
+ #define PROPERTY_ID_CONTROLBACKGROUND 30
+
+ #define PROPERTY_ID_FORMULALIST 31
+ #define PROPERTY_ID_SCOPE 32
+ #define PROPERTY_ID_RESETPAGENUMBER 33
+ #define PROPERTY_ID_CHARTTYPE 34
+ #define PROPERTY_ID_MASTERFIELDS 35
+ #define PROPERTY_ID_DETAILFIELDS 36
+ #define PROPERTY_ID_PREVIEW_COUNT 37
+ #define PROPERTY_ID_AREA 38
+ #define PROPERTY_ID_MIMETYPE 39
+
+ #define PROPERTY_ID_FONT 40
+ #define PROPERTY_ID_PARAADJUST 41
+ #define PROPERTY_ID_VERTICALALIGN 42
+
+
+//............................................................................
+} // 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..bf64f7687046
--- /dev/null
+++ b/reportdesign/source/ui/inc/propbrw.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _REPORT_PROPBRW_HXX
+#define _REPORT_PROPBRW_HXX
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/inspection/XObjectInspector.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <svl/brdcst.hxx>
+#include <svl/lstner.hxx>
+#include <vcl/dockwin.hxx>
+#include <svx/svdmark.hxx>
+#include "ModuleHelper.hxx"
+
+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::uno::XComponentContext >
+ m_xInspectorContext;
+ ::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;
+ void setCurrentPage(const ::rtl::OUString& _sLastActivePage);
+
+ ::Size getMinimumSize() const;
+private:
+ using Window::Update;
+};
+//==============================================================================
+} // rptui
+//==============================================================================
+#endif // _REPORT_PROPBRW_HXX
diff --git a/reportdesign/source/ui/inc/statusbarcontroller.hxx b/reportdesign/source/ui/inc/statusbarcontroller.hxx
new file mode 100644
index 000000000000..6fffd36cc4df
--- /dev/null
+++ b/reportdesign/source/ui/inc/statusbarcontroller.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_STATUSBARCONTROLLER_HXX
+#define RPTUI_STATUSBARCONTROLLER_HXX
+
+#include <svtools/statusbarcontroller.hxx>
+#include <comphelper/uno3.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <comphelper/implementationreference.hxx>
+
+class SfxStatusBarControl;
+namespace rptui
+{
+ typedef ::comphelper::ImplementationReference<SfxStatusBarControl,::com::sun::star::frame::XStatusbarController> TStatusbarHelper;
+
+ typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XServiceInfo> OStatusbarController_BASE;
+ class OStatusbarController : public ::svt::StatusbarController,
+ public OStatusbarController_BASE
+ {
+ TStatusbarHelper m_pController;
+ sal_uInt16 m_nSlotId;
+ sal_uInt16 m_nId;
+ public:
+ OStatusbarController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+
+ 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);
+
+ private:
+ void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+ // XInterface
+ DECLARE_XINTERFACE( )
+ // 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
+
+ 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);
+
+ // XUpdatable
+ virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // XStatusbarController
+ virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent& aMouseEvent ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL command( const ::com::sun::star::awt::Point& aPos,
+ ::sal_Int32 nCommand,
+ ::sal_Bool bMouseEvent,
+ const ::com::sun::star::uno::Any& aData ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
+ const ::com::sun::star::awt::Rectangle& rOutputRectangle,
+ ::sal_Int32 nItemId, ::sal_Int32 nStyle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL click() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL doubleClick() throw (::com::sun::star::uno::RuntimeException);
+ };
+}
+#endif // DBAUI_STATUSBARCONTROLLER_HXX
+
diff --git a/reportdesign/source/ui/inc/toolboxcontroller.hxx b/reportdesign/source/ui/inc/toolboxcontroller.hxx
new file mode 100644
index 000000000000..447db93fe667
--- /dev/null
+++ b/reportdesign/source/ui/inc/toolboxcontroller.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef RPTUI_TOOLBOXCONTROLLER_HXX
+#define RPTUI_TOOLBOXCONTROLLER_HXX
+
+#include <svtools/toolboxcontroller.hxx>
+#include <comphelper/stl_types.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/frame/XSubToolbarController.hpp>
+#include <cppuhelper/implbase2.hxx>
+#include <comphelper/implementationreference.hxx>
+
+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/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
new file mode 100644
index 000000000000..dcc327060806
--- /dev/null
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -0,0 +1,565 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "DataProviderHandler.hxx"
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/sequence.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/types.hxx>
+#include "uistrings.hrc"
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/syslocale.hxx>
+#include <com/sun/star/inspection/PropertyControlType.hpp>
+#include <com/sun/star/inspection/PropertyLineElement.hpp>
+#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
+#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
+#include <com/sun/star/chart2/XChartTypeContainer.hpp>
+#include <com/sun/star/chart2/XChartType.hpp>
+#include <com/sun/star/chart2/XFormattedString.hpp>
+#include <com/sun/star/chart2/XTitled.hpp>
+#include <com/sun/star/chart2/XTitle.hpp>
+#include <com/sun/star/chart2/data/XDataReceiver.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/inspection/XNumericControl.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
+#include <tools/fldunit.hxx>
+#include "metadata.hxx"
+#include <vcl/svapp.hxx>
+#include <vos/mutex.hxx>
+#include "helpids.hrc"
+#include "uistrings.hrc"
+#include "RptResId.hrc"
+#include "PropertyForward.hxx"
+//........................................................................
+namespace rptui
+{
+//........................................................................
+using namespace ::com::sun::star;
+
+DataProviderHandler::DataProviderHandler(uno::Reference< uno::XComponentContext > const & context)
+ :DataProviderHandler_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);
+ m_xTypeConverter.set(m_xContext->getServiceManager()->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter" )),m_xContext),uno::UNO_QUERY_THROW);
+
+ }catch(uno::Exception)
+ {
+ }
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString SAL_CALL DataProviderHandler::getImplementationName( ) throw(uno::RuntimeException)
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------
+sal_Bool SAL_CALL DataProviderHandler::supportsService( const ::rtl::OUString& ServiceName ) throw(uno::RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_static());
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getSupportedServiceNames( ) throw(uno::RuntimeException)
+{
+ return getSupportedServiceNames_static();
+}
+
+//------------------------------------------------------------------------
+::rtl::OUString DataProviderHandler::getImplementationName_Static( ) throw(uno::RuntimeException)
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.DataProviderHandler"));
+}
+
+//------------------------------------------------------------------------
+uno::Sequence< ::rtl::OUString > DataProviderHandler::getSupportedServiceNames_static( ) throw(uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aSupported(1);
+ aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.inspection.DataProviderHandler"));
+ return aSupported;
+}
+
+//------------------------------------------------------------------------
+uno::Reference< uno::XInterface > SAL_CALL DataProviderHandler::create( const uno::Reference< uno::XComponentContext >& _rxContext )
+{
+ return *(new DataProviderHandler( _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 DataProviderHandler::disposing()
+{
+ ::comphelper::disposeComponent(m_xFormComponentHandler);
+ ::comphelper::disposeComponent( m_xMasterDetails );
+ ::comphelper::disposeComponent(m_xTypeConverter);
+}
+void SAL_CALL DataProviderHandler::addEventListener(const uno::Reference< lang::XEventListener > & xListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->addEventListener(xListener);
+}
+
+void SAL_CALL DataProviderHandler::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removeEventListener(aListener);
+}
+
+// inspection::XPropertyHandler:
+
+/********************************************************************************/
+void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface > & Component) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ try
+ {
+ uno::Reference< container::XNameContainer > xNameCont(Component,uno::UNO_QUERY);
+ const ::rtl::OUString sFormComponent(RTL_CONSTASCII_USTRINGPARAM("FormComponent"));
+ if ( xNameCont->hasByName(sFormComponent) )
+ {
+ uno::Reference<beans::XPropertySet> xProp(xNameCont->getByName(sFormComponent),uno::UNO_QUERY);
+ const ::rtl::OUString sModel(RTL_CONSTASCII_USTRINGPARAM("Model"));
+ if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(sModel) )
+ {
+ m_xChartModel.set(xProp->getPropertyValue(sModel),uno::UNO_QUERY);
+ if ( m_xChartModel.is() )
+ m_xFormComponent = m_xChartModel->getDataProvider();
+ }
+ }
+ m_xDataProvider.set(m_xFormComponent,uno::UNO_QUERY);
+ m_xReportComponent.set( xNameCont->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ReportComponent" ) ) ), uno::UNO_QUERY );
+ if ( m_xDataProvider.is() )
+ {
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ TPropertyNamePair aPropertyMediation;
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_MASTERFIELDS, TPropertyConverter(PROPERTY_MASTERFIELDS,aNoConverter) ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_DETAILFIELDS, TPropertyConverter(PROPERTY_DETAILFIELDS,aNoConverter) ) );
+
+ m_xMasterDetails = new OPropertyMediator( m_xDataProvider.get(), m_xReportComponent.get(), aPropertyMediation,sal_True );
+ }
+
+ //const ::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 DataProviderHandler::getPropertyValue(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Any aPropertyValue;
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_CHARTTYPE:
+ // TODO: We need a possiblity to get the UI of the selected chart type
+ //if( m_xChartModel.is() )
+ //{
+ // uno::Reference< chart2::XDiagram > xDiagram( m_xChartModel->getFirstDiagram() );
+ // if( xDiagram.is() )
+ // {
+ // ::rtl::OUString sChartTypes;
+ // uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
+ // const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
+ // const uno::Reference< chart2::XCoordinateSystem >* pIter = aCooSysSeq.getConstArray();
+ // const uno::Reference< chart2::XCoordinateSystem >* pEnd = pIter + aCooSysSeq.getLength();
+ // for(;pIter != pEnd;++pIter)
+ // {
+ // const uno::Reference< chart2::XChartTypeContainer > xCTCnt( *pIter, uno::UNO_QUERY_THROW );
+ // const uno::Sequence< uno::Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes());
+ // const uno::Reference< chart2::XChartType >* pChartTypeIter = aCTSeq.getConstArray();
+ // const uno::Reference< chart2::XChartType >* pChartTypeEnd = pChartTypeIter + aCTSeq.getLength();
+ // for(;pChartTypeIter != pChartTypeEnd;++pChartTypeIter)
+ // {
+ // sChartTypes += (*pChartTypeIter)->getChartType();
+ // sChartTypes += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(";"));
+ // }
+ // }
+ // aPropertyValue;// <<= sChartTypes;
+ // }
+ //}
+ break;
+ case PROPERTY_ID_PREVIEW_COUNT:
+ aPropertyValue <<= m_xDataProvider->getRowLimit();
+ break;
+ default:
+ aPropertyValue = m_xFormComponentHandler->getPropertyValue( PropertyName );
+ break;
+ }
+ return aPropertyValue;
+}
+
+void SAL_CALL DataProviderHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ uno::Any aPropertyValue;
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_CHARTTYPE:
+ break;
+ case PROPERTY_ID_PREVIEW_COUNT:
+ m_xDataProvider->setPropertyValue(PropertyName,Value);
+ break;
+ default:
+ m_xFormComponentHandler->setPropertyValue(PropertyName, Value);
+ break;
+ }
+}
+// -----------------------------------------------------------------------------
+void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue)
+{
+ uno::Reference<chart2::XTitled> xTitled(m_xChartModel,uno::UNO_QUERY);
+ if ( xTitled.is() )
+ {
+ uno::Reference<chart2::XTitle> xTitle = xTitled->getTitleObject();
+ if ( !xTitle.is() )
+ {
+ xTitle.set(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.Title")),m_xContext),uno::UNO_QUERY);
+ xTitled->setTitleObject(xTitle);
+ }
+ if ( xTitle.is() )
+ {
+ uno::Reference< chart2::XFormattedString> xFormatted(m_xContext->getServiceManager()->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.FormattedString")),m_xContext),uno::UNO_QUERY);
+ ::rtl::OUString sStr;
+ _aValue>>= sStr;
+ xFormatted->setString(sStr);
+ uno::Sequence< uno::Reference< chart2::XFormattedString> > aArgs(1);
+ aArgs[0] = xFormatted;
+ xTitle->setText(aArgs);
+ }
+ } // if ( xTitled.is() )
+}
+
+beans::PropertyState SAL_CALL DataProviderHandler::getPropertyState(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_xFormComponentHandler->getPropertyState(PropertyName);
+}
+
+inspection::LineDescriptor SAL_CALL DataProviderHandler::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_CHARTTYPE:
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_CHARTTYPE_DLG);
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::TextField , sal_True);
+ aOut.HasPrimaryButton = sal_True;
+ break;
+ case PROPERTY_ID_PREVIEW_COUNT:
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::NumericField , sal_False);
+ break;
+ case PROPERTY_ID_MASTERFIELDS:
+ case PROPERTY_ID_DETAILFIELDS:
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::StringListField , sal_False);
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_DLG_LINKFIELDS);
+ 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);
+ }
+ return aOut;
+}
+
+uno::Any SAL_CALL DataProviderHandler::convertToPropertyValue(const ::rtl::OUString & _rPropertyValue, 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(_rPropertyValue);
+ switch(nId)
+ {
+ case PROPERTY_ID_CHARTTYPE:
+ break;
+ case PROPERTY_ID_PREVIEW_COUNT:
+ try
+ {
+ aPropertyValue = m_xTypeConverter->convertTo( _rControlValue, ::getCppuType((const sal_Int32*)0));
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+ }
+ break;
+ case PROPERTY_ID_MASTERFIELDS:
+ case PROPERTY_ID_DETAILFIELDS:
+ break;
+ default:
+ aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(_rPropertyValue, _rControlValue);
+ }
+ return aPropertyValue;
+}
+
+uno::Any SAL_CALL DataProviderHandler::convertToControlValue(const ::rtl::OUString & _rPropertyName, const uno::Any & _rPropertyValue, const uno::Type & ControlValueType) 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(_rPropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_CHARTTYPE:
+ break;
+ case PROPERTY_ID_MASTERFIELDS:
+ case PROPERTY_ID_DETAILFIELDS:
+ case PROPERTY_ID_PREVIEW_COUNT:
+ try
+ {
+ aControlValue = m_xTypeConverter->convertTo( _rPropertyValue, ControlValueType);
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( sal_False, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" );
+ }
+ break;
+ default:
+ aControlValue = m_xFormComponentHandler->convertToControlValue(_rPropertyName, _rPropertyValue, ControlValueType);
+ }
+ return aControlValue;
+}
+
+void SAL_CALL DataProviderHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & Listener) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ m_xFormComponentHandler->addPropertyChangeListener(Listener);
+}
+
+void SAL_CALL DataProviderHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException)
+{
+ m_xFormComponentHandler->removePropertyChangeListener(_rxListener);
+}
+
+uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedProperties() throw (uno::RuntimeException)
+{
+ ::std::vector< beans::Property > aNewProps;
+ if( m_xChartModel.is() )
+ {
+ m_pInfoService->getExcludeProperties( aNewProps, m_xFormComponentHandler );
+ beans::Property aValue;
+ static const ::rtl::OUString s_pProperties[] =
+ {
+ PROPERTY_CHARTTYPE
+ ,PROPERTY_MASTERFIELDS
+ ,PROPERTY_DETAILFIELDS
+ ,PROPERTY_PREVIEW_COUNT
+ //,PROPERTY_TITLE
+ };
+
+ for (size_t nPos = 0; nPos < sizeof(s_pProperties)/sizeof(s_pProperties[0]) ;++nPos )
+ {
+ aValue.Name = s_pProperties[nPos];
+ aNewProps.push_back(aValue);
+ }
+ }
+ return aNewProps.empty() ? uno::Sequence< beans::Property > () : uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getSupersededProperties() throw (uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString > aRet(1);
+ aRet[0] = PROPERTY_TITLE; // have a look at OPropertyInfoService::getExcludeProperties
+ return aRet;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL DataProviderHandler::getActuatingProperties() throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ uno::Sequence< ::rtl::OUString > aSeq(1);
+ aSeq[0] = PROPERTY_TITLE;
+ return ::comphelper::concatSequences(m_xFormComponentHandler->getActuatingProperties(),aSeq);
+}
+
+::sal_Bool SAL_CALL DataProviderHandler::isComposable( const ::rtl::OUString& _rPropertyName ) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ return m_pInfoService->isComposable( _rPropertyName, m_xFormComponentHandler );
+}
+
+inspection::InteractiveSelectionResult SAL_CALL DataProviderHandler::onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, uno::Any & out_Data, const uno::Reference< inspection::XObjectInspectorUI > & _rxInspectorUI) throw (uno::RuntimeException, beans::UnknownPropertyException, lang::NullPointerException)
+{
+ if ( !_rxInspectorUI.is() )
+ throw lang::NullPointerException();
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_CHARTTYPE:
+ if ( impl_dialogChartType_nothrow(aGuard) )
+ eResult = inspection::InteractiveSelectionResult_ObtainedValue;
+ break;
+ case PROPERTY_ID_MASTERFIELDS:
+ case PROPERTY_ID_DETAILFIELDS:
+ if ( impl_dialogLinkedFields_nothrow( aGuard ) )
+ eResult = inspection::InteractiveSelectionResult_Success;
+ break;
+ default:
+ eResult = m_xFormComponentHandler->onInteractivePropertySelection(PropertyName, Primary, out_Data, _rxInspectorUI);
+ }
+
+ return eResult;
+}
+
+void SAL_CALL DataProviderHandler::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)
+{
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ if ( ActuatingPropertyName == PROPERTY_COMMAND )
+ {
+ if ( NewValue != OldValue )
+ {
+ uno::Reference< report::XReportDefinition> xReport = m_xReportComponent->getSection()->getReportDefinition();
+ bool bDoEnableMasterDetailFields = xReport.is() && xReport->getCommand().getLength() && m_xDataProvider->getCommand().getLength();
+ InspectorUI->enablePropertyUIElements( PROPERTY_DETAILFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
+ InspectorUI->enablePropertyUIElements( PROPERTY_MASTERFIELDS, inspection::PropertyLineElement::PrimaryButton, bDoEnableMasterDetailFields );
+
+ sal_Bool bModified = xReport->isModified();
+ // this fills the chart again
+ ::comphelper::NamedValueCollection aArgs;
+ aArgs.put( "CellRangeRepresentation", uno::makeAny( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "all" ) ) ) );
+ aArgs.put( "HasCategories", uno::makeAny( sal_True ) );
+ aArgs.put( "FirstCellAsLabel", uno::makeAny( sal_True ) );
+ aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
+ uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xChartModel,uno::UNO_QUERY_THROW);
+ xReceiver->setArguments( aArgs.getPropertyValues() );
+ if ( !bModified )
+ xReport->setModified(sal_False);
+ } // if ( NewValue != OldValue )
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
+ } // if ( ActuatingPropertyName == PROPERTY_COMMAND )
+ else if ( ActuatingPropertyName == PROPERTY_TITLE )
+ {
+ if ( NewValue != OldValue )
+ impl_updateChartTitle_throw(NewValue);
+ }
+ else
+ {
+ const sal_Int32 nId = m_pInfoService->getPropertyId(ActuatingPropertyName);
+ switch(nId)
+ {
+
+ case PROPERTY_ID_MASTERFIELDS:
+ break;
+ case PROPERTY_ID_DETAILFIELDS:
+ break;
+ default:
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit);
+ }
+ }
+}
+
+::sal_Bool SAL_CALL DataProviderHandler::suspend(::sal_Bool Suspend) throw (uno::RuntimeException)
+{
+ return m_xFormComponentHandler->suspend(Suspend);
+}
+bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
+{
+ uno::Sequence<uno::Any> aSeq(6);
+ beans::PropertyValue aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
+ aParam.Value <<= m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
+ aSeq[0] <<= aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Detail"));
+ aParam.Value <<= m_xDataProvider;
+ aSeq[1] <<= aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Master"));
+ aParam.Value <<= m_xReportComponent->getSection()->getReportDefinition();
+ aSeq[2] <<= aParam;
+
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Explanation"));
+ aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_EXPLANATION)));
+ aSeq[3] <<= aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DetailLabel"));
+ aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_DETAILLABEL)));
+ aSeq[4] <<= aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterLabel"));
+ aParam.Value <<= ::rtl::OUString(String(ModuleRes(RID_STR_MASTERLABEL)));
+ aSeq[5] <<= aParam;
+
+ uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+ m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.form.ui.MasterDetailLinkDialog")),aSeq
+ , m_xContext), uno::UNO_QUERY);
+
+ _rClearBeforeDialog.clear();
+ return ( xDialog->execute() != 0 );
+}
+// -----------------------------------------------------------------------------
+bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
+{
+ uno::Sequence<uno::Any> aSeq(2);
+ beans::PropertyValue aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
+ aParam.Value <<= m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow")));
+ aSeq[0] <<= aParam;
+ aParam.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ChartModel"));
+ aParam.Value <<= m_xChartModel;
+ aSeq[1] <<= aParam;
+
+ uno::Reference< ui::dialogs::XExecutableDialog > xDialog(
+ m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.ChartTypeDialog")),aSeq
+ , m_xContext), uno::UNO_QUERY);
+
+ _rClearBeforeDialog.clear();
+ return ( xDialog->execute() != 0 );
+}
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx
new file mode 100644
index 000000000000..48d8c74e0c01
--- /dev/null
+++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx
@@ -0,0 +1,284 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "DefaultInspection.hxx"
+#include <comphelper/sequence.hxx>
+#include <com/sun/star/ucb/AlreadyInitializedException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#ifndef _REPORT_DLGRESID_HRC
+#include <RptResId.hrc>
+#endif
+#include "ModuleHelper.hxx"
+#ifndef RTPUI_REPORTDESIGN_HELPID_HRC
+#include "helpids.hrc"
+#endif
+#include <cppuhelper/implbase1.hxx>
+#include <osl/diagnose.h>
+#include <rtl/ustrbuf.hxx>
+#include <tools/debug.hxx>
+#include "metadata.hxx"
+#include <tools/urlobj.hxx>
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+ //------------------------------------------------------------------------
+ ::rtl::OUString HelpIdUrl::getHelpURL( const rtl::OString& sHelpId )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 );
+ DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" );
+ aBuffer.appendAscii( INET_HID_SCHEME );
+ aBuffer.append( aTmp.getStr() );
+ 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[] = {
+
+ { "com.sun.star.report.inspection.ReportComponentHandler"},
+ { "com.sun.star.form.inspection.EditPropertyHandler"},
+ { "com.sun.star.report.inspection.DataProviderHandler"},
+ { "com.sun.star.report.inspection.GeometryHandler"}
+
+ // generic virtual edit properties
+
+ };
+
+ 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;
+ rtl::OString helpId;
+ } aCategories[] = {
+ { "General", RID_STR_PROPPAGE_DEFAULT, HID_RPT_PROPDLG_TAB_GENERAL },
+ { "Data", RID_STR_PROPPAGE_DATA, HID_RPT_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..c02683a97452
--- /dev/null
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -0,0 +1,2246 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "GeometryHandler.hxx"
+
+#include <comphelper/sequence.hxx>
+#include <comphelper/types.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/mimeconfighelper.hxx>
+
+#include "uistrings.hrc"
+#include "reportformula.hxx"
+
+#include <unotools/textsearch.hxx>
+#include <unotools/configmgr.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/syslocale.hxx>
+#include <tools/diagnose_ex.h>
+#include <tools/StringListResource.hxx>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include "com/sun/star/inspection/StringRepresentation.hpp"
+#include <com/sun/star/inspection/PropertyLineElement.hpp>
+#include <com/sun/star/inspection/PropertyControlType.hpp>
+#include <com/sun/star/inspection/XStringListControl.hpp>
+#include <com/sun/star/report/Function.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/sdb/SQLContext.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/util/SearchOptions.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/inspection/XNumericControl.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+
+#include <vcl/msgbox.hxx>
+#include <vcl/waitobj.hxx>
+#include <tools/fldunit.hxx>
+#include <vcl/stdtext.hxx>
+
+#include "ModuleHelper.hxx"
+#include "RptResId.hrc"
+#include "RptDef.hxx"
+#include "UITools.hxx"
+
+#include <connectivity/dbexception.hxx>
+#include <connectivity/dbconversion.hxx>
+#include <connectivity/dbtools.hxx>
+
+#include <boost/bind.hpp>
+#include <tools/string.hxx>
+#include "metadata.hxx"
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+
+#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/xlnwtit.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlnstit.hxx>
+#include <svx/xlnedit.hxx>
+#include <svx/xlnstwit.hxx>
+#include <svx/xlnedwit.hxx>
+#include <svx/xlnstcit.hxx>
+#include <svx/xlnedcit.hxx>
+#include <svx/xlndsit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/svxids.hrc>
+
+#define ITEMID_COLOR_TABLE SID_COLOR_TABLE
+#define ITEMID_DASH_LIST SID_DASH_LIST
+#define ITEMID_LINEEND_LIST SID_LINEEND_LIST
+#include <svx/drawitem.hxx>
+#define ITEMID_BRUSH SID_ATTR_BRUSH
+#include <editeng/brshitem.hxx>
+#include <sfx2/docfilt.hxx>
+
+#include "dlgpage.hxx"
+#include "helpids.hrc"
+#include <toolkit/helper/convert.hxx>
+
+#define DATA_OR_FORMULA 0
+#define FUNCTION 1
+#define COUNTER 2
+#define USER_DEF_FUNCTION 3
+#define UNDEF_DATA 4
+
+//........................................................................
+namespace rptui
+{
+//........................................................................
+using namespace ::com::sun::star;
+//using namespace formula;
+
+// 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;
+ }
+};
+
+// -----------------------------------------------------------------------------
+::rtl::OUString lcl_getQuotedFunctionName(const ::rtl::OUString& _sFunction)
+{
+ ::rtl::OUString sQuotedFunctionName(RTL_CONSTASCII_USTRINGPARAM("["));
+ sQuotedFunctionName += _sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));
+ return sQuotedFunctionName;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString lcl_getQuotedFunctionName(const uno::Reference< report::XFunction>& _xFunction)
+{
+ return lcl_getQuotedFunctionName(_xFunction->getName());
+}
+// -----------------------------------------------------------------------------
+void lcl_collectFunctionNames(const uno::Reference< report::XFunctions>& _xFunctions,TFunctions& _rFunctionNames)
+{
+ uno::Reference< report::XFunctionsSupplier> xParent(_xFunctions->getParent(),uno::UNO_QUERY_THROW);
+ 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);
+ _rFunctionNames.insert(TFunctions::value_type(lcl_getQuotedFunctionName(xFunction),TFunctionPair(xFunction,xParent)));
+ }
+}
+// -----------------------------------------------------------------------------
+void lcl_collectFunctionNames(const uno::Reference< report::XSection>& _xSection,TFunctions& _rFunctionNames)
+{
+ const uno::Reference< report::XReportDefinition> xReportDefinition = _xSection->getReportDefinition();
+ const 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_THROW);
+ 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;
+ const sal_Int32 nLen = sName.getLength();
+ if ( nLen )
+ {
+ ReportFormula aFormula( sName );
+ _rControlValue <<= aFormula.getUndecoratedContent();
+ }
+}
+// -----------------------------------------------------------------------------
+bool GeometryHandler::impl_isDataField(const ::rtl::OUString& _sName) const
+{
+ const ::rtl::OUString* pEnd = m_aFieldNames.getConstArray() + m_aFieldNames.getLength();
+ bool bIsField = ( ::std::find( m_aFieldNames.getConstArray(), pEnd, _sName ) != pEnd );
+
+ if ( !bIsField )
+ {
+ pEnd = m_aParamNames.getConstArray() + m_aParamNames.getLength();
+ bIsField = ( ::std::find( m_aParamNames.getConstArray(), pEnd, _sName ) != pEnd );
+ }
+ return bIsField;
+}
+// -----------------------------------------------------------------------------
+::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;
+
+ aParser = ReportFormula( impl_isDataField(sName) ? ReportFormula::Field : ReportFormula::Expression, sName );
+ return aParser.getCompleteFormula();
+}
+DBG_NAME(rpt_GeometryHandler)
+GeometryHandler::GeometryHandler(uno::Reference< uno::XComponentContext > const & context) :
+ GeometryHandler_Base(m_aMutex)
+ ,m_aPropertyListeners( m_aMutex )
+ ,m_xContext(context)
+ ,m_pInfoService(new OPropertyInfoService())
+ ,m_nDataFieldType(0)
+ ,m_bIn(false)
+{
+ DBG_CTOR(rpt_GeometryHandler,NULL);
+ try
+ {
+ const 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);
+ loadDefaultFunctions();
+ }
+ catch(const uno::Exception&)
+ {
+ }
+}
+// -----------------------------------------------------------------------------
+GeometryHandler::~GeometryHandler()
+{
+ DBG_DTOR(rpt_GeometryHandler,NULL);
+}
+//------------------------------------------------------------------------
+::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()
+{
+ try
+ {
+ ::comphelper::disposeComponent(m_xFormComponentHandler);
+ ::comphelper::disposeComponent(m_xTypeConverter);
+ if ( m_xReportComponent.is() && m_xReportComponent->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) )
+ m_xReportComponent->removePropertyChangeListener(PROPERTY_DATAFIELD,static_cast< beans::XPropertyChangeListener* >( this ));
+
+ m_xReportComponent.clear();
+ m_xRowSet.clear();
+ m_aPropertyListeners.clear();
+ }
+ catch(uno::Exception&)
+ {}
+}
+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 );
+ m_sScope = m_sDefaultFunction = ::rtl::OUString();
+ m_bNewFunction = false;
+ m_nDataFieldType = 0;
+ m_xFunction.clear();
+ m_aFunctionNames.clear();
+ try
+ {
+ if ( m_xReportComponent.is() && m_xReportComponent->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) )
+ m_xReportComponent->removePropertyChangeListener(PROPERTY_DATAFIELD,static_cast< beans::XPropertyChangeListener* >( this ));
+
+ const 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 ) )
+ {
+ const 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 );
+
+ m_aParamNames = getParameterNames( m_xRowSet );
+ impl_initFieldList_nothrow(m_aFieldNames);
+ if ( m_xReportComponent->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) )
+ m_xReportComponent->addPropertyChangeListener(PROPERTY_DATAFIELD,static_cast< beans::XPropertyChangeListener* >( this ));
+ }
+
+ const 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;
+ 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:
+ aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName );
+ lcl_convertFormulaTo(aPropertyValue,aPropertyValue);
+ if ( PROPERTY_ID_DATAFIELD == nId )
+ {
+ ::rtl::OUString sDataField;
+ aPropertyValue >>= sDataField;
+ switch(m_nDataFieldType)
+ {
+ case DATA_OR_FORMULA:
+ break;
+ case FUNCTION:
+ if ( isDefaultFunction(sDataField,sDataField) )
+ aPropertyValue <<= sDataField;
+ else if ( !sDataField.getLength() )
+ aPropertyValue = uno::Any();
+ break;
+ case COUNTER:
+ case USER_DEF_FUNCTION:
+ aPropertyValue = uno::Any();
+ break;
+ }
+
+ }
+ break;
+ case PROPERTY_ID_TYPE:
+ {
+ const sal_uInt32 nOldDataFieldType = m_nDataFieldType;
+ m_nDataFieldType = impl_getDataFieldType_throw();
+ if ( UNDEF_DATA == m_nDataFieldType )
+ m_nDataFieldType = nOldDataFieldType;
+ aPropertyValue <<= m_nDataFieldType;
+ }
+ break;
+ case PROPERTY_ID_FORMULALIST:
+ case PROPERTY_ID_SCOPE:
+ {
+ uno::Any aDataField = m_xReportComponent->getPropertyValue( PROPERTY_DATAFIELD );
+ lcl_convertFormulaTo(aDataField,aDataField);
+ ::rtl::OUString sDataField;
+ aDataField >>= sDataField;
+ switch(m_nDataFieldType)
+ {
+ case DATA_OR_FORMULA:
+ break;
+ case FUNCTION:
+ if ( isDefaultFunction(sDataField,sDataField,uno::Reference< report::XFunctionsSupplier>(),true) )
+ aPropertyValue <<= (PROPERTY_ID_FORMULALIST == nId ? m_sDefaultFunction : m_sScope);
+ break;
+ case USER_DEF_FUNCTION:
+ if ( sDataField.getLength() && PROPERTY_ID_FORMULALIST == nId )
+ aPropertyValue = aDataField;
+ break;
+ case COUNTER:
+ if ( PROPERTY_ID_SCOPE == nId && impl_isCounterFunction_throw(sDataField,m_sScope) )
+ aPropertyValue <<= m_sScope;
+ break;
+ }
+
+ }
+ break;
+ case PROPERTY_ID_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ {
+ aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName );
+ sal_Int32 nColor = COL_TRANSPARENT;
+ if ( (aPropertyValue >>= nColor) && static_cast<sal_Int32>(COL_TRANSPARENT) == nColor )
+ aPropertyValue.clear();
+ }
+ break;
+ case PROPERTY_ID_MIMETYPE:
+ {
+ ::rtl::OUString sValue;
+ m_xReportComponent->getPropertyValue( PropertyName ) >>= sValue;
+ aPropertyValue <<= impl_ConvertMimeTypeToUI_nothrow(sValue);
+ }
+ break;
+ default:
+ aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName );
+ break;
+ }
+ return aPropertyValue;
+}
+
+void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & PropertyName, const uno::Any & Value) throw (uno::RuntimeException, beans::UnknownPropertyException)
+{
+ ::osl::ResettableMutexGuard 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:
+ break;
+ case PROPERTY_ID_DATAFIELD:
+ {
+ OBlocker aBlocker(m_bIn);
+ m_xReportComponent->setPropertyValue(PropertyName, aNewValue);
+ bHandled = true;
+ const ::rtl::OUString sOldFunctionName = m_sDefaultFunction;
+ const ::rtl::OUString sOldScope = m_sScope;
+
+ uno::Any aPropertyValue;
+ lcl_convertFormulaTo(Value,aPropertyValue);
+ ::rtl::OUString sDataField;
+ aPropertyValue >>= sDataField;
+
+ m_sScope = m_sDefaultFunction = ::rtl::OUString();
+ m_xFunction.clear();
+ const sal_uInt32 nOldDataFieldType = m_nDataFieldType;
+ if ( sDataField.getLength() )
+ {
+ if ( isDefaultFunction(sDataField,sDataField,uno::Reference< report::XFunctionsSupplier>(),true) )
+ m_nDataFieldType = FUNCTION;
+ else if ( m_aFunctionNames.find(sDataField) != m_aFunctionNames.end() )
+ m_nDataFieldType = USER_DEF_FUNCTION;
+ }
+
+ resetOwnProperties(aGuard,sOldFunctionName,sOldScope,nOldDataFieldType);
+ }
+ break;
+ case PROPERTY_ID_TYPE:
+ {
+ bHandled = true;
+ Value >>= m_nDataFieldType;
+
+ const ::rtl::OUString sOldFunctionName = m_sDefaultFunction;
+ const ::rtl::OUString sOldScope = m_sScope;
+ m_sDefaultFunction = m_sScope = ::rtl::OUString();
+
+ if ( m_nDataFieldType == COUNTER )
+ {
+ impl_setCounterFunction_throw();
+ }
+ else
+ {
+ if ( m_bNewFunction )
+ removeFunction();
+ m_xFunction.clear();
+ OBlocker aBlocker(m_bIn);
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(::rtl::OUString()));
+ }
+ resetOwnProperties(aGuard,sOldFunctionName,sOldScope,m_nDataFieldType);
+ }
+ break;
+ case PROPERTY_ID_FORMULALIST:
+ {
+ bHandled = true;
+ ::rtl::OUString sFunction;
+ if ( !(Value >>= sFunction) || !sFunction.getLength() )
+ {
+ if ( m_nDataFieldType == FUNCTION )
+ {
+ m_sDefaultFunction = ::rtl::OUString();
+ if ( m_bNewFunction )
+ removeFunction();
+ m_xFunction.clear();
+
+ beans::PropertyChangeEvent aEvent;
+ aEvent.PropertyName = PROPERTY_SCOPE;
+ aEvent.OldValue <<= m_sScope;
+ m_sScope = ::rtl::OUString();
+ aEvent.NewValue <<= m_sScope;
+ aGuard.clear();
+ m_aPropertyListeners.notify( aEvent, &beans::XPropertyChangeListener::propertyChange );
+ }
+ else if ( m_nDataFieldType == USER_DEF_FUNCTION )
+ {
+ OBlocker aBlocker(m_bIn);
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(::rtl::OUString()));
+ }
+ }
+ else if ( m_nDataFieldType == USER_DEF_FUNCTION )
+ {
+ ::rtl::OUString sDataField;
+ OBlocker aBlocker(m_bIn);
+ const sal_uInt32 nNewDataType = impl_getDataFieldType_throw(sFunction);
+ if ( nNewDataType != UNDEF_DATA && nNewDataType != m_nDataFieldType )
+ {
+ const ::rtl::OUString sOldFunctionName = m_sDefaultFunction;
+ const ::rtl::OUString sOldScope = m_sScope;
+ m_sScope = m_sDefaultFunction = ::rtl::OUString();
+ m_xFunction.clear();
+ if ( nNewDataType == COUNTER )
+ impl_isCounterFunction_throw(sFunction,m_sScope);
+ else
+ {
+ ::rtl::OUString sNamePostFix;
+ const uno::Reference< report::XFunctionsSupplier> xFunctionsSupplier = fillScope_throw(sNamePostFix);
+ isDefaultFunction(sFunction,sDataField,xFunctionsSupplier,true);
+ }
+ const sal_uInt32 nOldDataFieldType = m_nDataFieldType;
+ m_nDataFieldType = nNewDataType;
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(impl_convertToFormula( uno::makeAny(sFunction))));
+ resetOwnProperties(aGuard,sOldFunctionName,sOldScope,nOldDataFieldType);
+ }
+ else
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(impl_convertToFormula( uno::makeAny(sFunction))));
+ }
+ else if ( m_nDataFieldType == FUNCTION )
+ {
+ uno::Any aPropertyValue = m_xReportComponent->getPropertyValue(PROPERTY_DATAFIELD);
+ lcl_convertFormulaTo(aPropertyValue,aPropertyValue);
+ ::rtl::OUString sDataField;
+ aPropertyValue >>= sDataField;
+ if ( m_nDataFieldType == FUNCTION && (!isDefaultFunction(sDataField,sDataField) || m_sDefaultFunction != sFunction) )
+ {
+ if ( m_bNewFunction )
+ removeFunction();
+ // function currently does not exist
+ createDefaultFunction(aGuard,sFunction,sDataField);
+ m_sDefaultFunction = sFunction;
+ }
+ }
+ }
+
+ break;
+ case PROPERTY_ID_SCOPE:
+ if ( !(Value >>= m_sScope) )
+ m_sScope = ::rtl::OUString();
+ else
+ {
+ if ( m_bNewFunction )
+ removeFunction();
+ if ( m_nDataFieldType == COUNTER )
+ impl_setCounterFunction_throw();
+ else
+ {
+ OSL_ENSURE(m_xFunction.is(),"Where is my function gone!");
+
+ ::rtl::OUString sNamePostFix;
+ const uno::Reference< report::XFunctionsSupplier> xFunctionsSupplier = fillScope_throw(sNamePostFix);
+
+ ::rtl::OUString sQuotedFunctionName(lcl_getQuotedFunctionName(m_xFunction));
+ if ( isDefaultFunction(sQuotedFunctionName,sQuotedFunctionName,xFunctionsSupplier,true) )
+ m_bNewFunction = false;
+ else
+ {
+ ::rtl::OUString sDefaultFunctionName;
+ ::rtl::OUString sDataField;
+ OSL_VERIFY( impl_isDefaultFunction_nothrow(m_xFunction,sDataField,sDefaultFunctionName) );
+ m_sDefaultFunction = sDefaultFunctionName;
+ createDefaultFunction(aGuard,m_sDefaultFunction,sDataField);
+ }
+ }
+ }
+ bHandled = true;
+ break;
+ case PROPERTY_ID_POSITIONX:
+ case PROPERTY_ID_POSITIONY:
+ case PROPERTY_ID_HEIGHT:
+ case PROPERTY_ID_WIDTH:
+ {
+ const 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_FONT:
+ {
+ const 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;
+ case PROPERTY_ID_MIMETYPE:
+ {
+ ::rtl::OUString sValue;
+ Value >>= sValue;
+ aNewValue <<= impl_ConvertUIToMimeType_nothrow(sValue);
+ }
+ 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
+ )
+{
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(_nResId),aList);
+
+ implCreateListLikeControl(_rxControlFactory,out_Descriptor,aList,_bReadOnlyControl,_bTrueIfListBoxFalseIfComboBox);
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::implCreateListLikeControl(
+ const uno::Reference< inspection::XPropertyControlFactory >& _rxControlFactory
+ ,inspection::LineDescriptor & out_Descriptor
+ ,const ::std::vector< ::rtl::OUString>& _aEntries
+ ,sal_Bool _bReadOnlyControl
+ ,sal_Bool _bTrueIfListBoxFalseIfComboBox
+ )
+{
+ const uno::Reference< inspection::XStringListControl > xListControl(
+ _rxControlFactory->createPropertyControl(
+ _bTrueIfListBoxFalseIfComboBox ? inspection::PropertyControlType::ListBox : inspection::PropertyControlType::ComboBox, _bReadOnlyControl
+ ),
+ uno::UNO_QUERY_THROW
+ );
+
+ out_Descriptor.Control = xListControl.get();
+ ::std::for_each( _aEntries.begin(), _aEntries.end(),::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl,_1 ));
+}
+// -----------------------------------------------------------------------------
+
+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_FORMULALIST:
+ {
+ ::std::vector< ::rtl::OUString > aList;
+ impl_fillFormulaList_nothrow(aList);
+ implCreateListLikeControl(_xControlFactory,aOut,aList,sal_False,sal_True);
+ }
+ break;
+ case PROPERTY_ID_SCOPE:
+ {
+ ::std::vector< ::rtl::OUString > aList;
+ impl_fillScopeList_nothrow(aList);
+ implCreateListLikeControl(_xControlFactory,aOut,aList,sal_False,sal_True);
+ }
+ break;
+ case PROPERTY_ID_MIMETYPE:
+ {
+ ::std::vector< ::rtl::OUString > aList;
+ impl_fillMimeTypes_nothrow(aList);
+ implCreateListLikeControl(_xControlFactory,aOut,aList,sal_False,sal_True);
+ }
+ break;
+ case PROPERTY_ID_TYPE:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_TYPE_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:
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA);
+ aOut.HasPrimaryButton = sal_True;
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField , sal_False);
+ break;
+ case PROPERTY_ID_CONDITIONALPRINTEXPRESSION:
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA);
+ aOut.HasPrimaryButton = sal_True;
+ aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField , sal_False);
+ break;
+ case PROPERTY_ID_DATAFIELD:
+ {
+ uno::Reference< inspection::XStringListControl > xListControl(
+ _xControlFactory->createPropertyControl(
+ m_nDataFieldType == DATA_OR_FORMULA ? inspection::PropertyControlType::ComboBox : inspection::PropertyControlType::ListBox, sal_False
+ ),
+ uno::UNO_QUERY_THROW
+ );
+
+ if ( m_nDataFieldType == DATA_OR_FORMULA )
+ {
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA);
+ aOut.HasPrimaryButton = sal_True;
+ }
+
+ aOut.Control = xListControl.get();
+ if ( m_nDataFieldType == USER_DEF_FUNCTION )
+ {
+ // add function names
+ ::std::for_each( m_aFunctionNames.begin(), m_aFunctionNames.end(),
+ ::std::compose1(
+ ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl,_1 ),
+ ::std::select1st<TFunctions::value_type>()));
+ }
+ else
+ {
+ ::std::for_each( m_aFieldNames.getConstArray(), m_aFieldNames.getConstArray() + m_aFieldNames.getLength(),
+ ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl, _1 ) );
+ ::std::for_each( m_aParamNames.getConstArray(), m_aParamNames.getConstArray() + m_aParamNames.getLength(),
+ ::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_FONT:
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_RPT_PROP_DLG_FONT_TYPE);
+ aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True );
+ aOut.HasPrimaryButton = sal_True;
+ break;
+ case PROPERTY_ID_AREA:
+ aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_RPT_PROP_DLG_AREA);
+ aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True );
+ aOut.HasPrimaryButton = sal_True;
+ break;
+ case PROPERTY_ID_VERTICALALIGN:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_VERTICAL_ALIGN_CONST,sal_False,sal_True);
+ break;
+ case PROPERTY_ID_PARAADJUST:
+ implCreateListLikeControl(_xControlFactory,aOut,RID_STR_PARAADJUST_CONST,sal_False,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->setValueUnit( util::MeasureUnit::MM_100TH );
+ xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0));
+ if ( nDisplayUnit != -1 )
+ xNumericControl->setDisplayUnit( nDisplayUnit );
+ uno::Reference< report::XReportComponent> xComp(m_xReportComponent,uno::UNO_QUERY);
+ if ( xComp.is() && xComp->getSection().is() )
+ {
+ 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)));
+ 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 )
+ {
+ const 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 ));
+ }
+ }
+ }
+ 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 )
+{
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(_nResId),aList);
+ uno::Sequence< ::rtl::OUString > aSeq(aList.size());
+ ::std::copy( aList.begin(), aList.end(), aSeq.getArray() );
+
+ 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_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ if ( !_rControlValue.hasValue() )
+ {
+ aPropertyValue <<= static_cast<sal_Int32>(COL_TRANSPARENT);
+ break;
+ }
+ // run through
+
+ 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_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ if ( aPropertyValue.hasValue() )
+ {
+ 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;
+
+ const 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:
+ return uno::makeAny( impl_convertToFormula( _rControlValue ) );
+ case PROPERTY_ID_DATAFIELD:
+ {
+ ::rtl::OUString sDataField;
+ _rControlValue >>= sDataField;
+ if ( isDefaultFunction(sDataField,sDataField) )
+ {
+ OSL_ENSURE(m_xFunction.is(),"No function set!");
+ aPropertyValue <<= impl_convertToFormula( uno::makeAny(lcl_getQuotedFunctionName(m_xFunction)) );
+ }
+ else
+ aPropertyValue <<= impl_convertToFormula( _rControlValue );
+ }
+ break;
+ case PROPERTY_ID_POSITIONX:
+ {
+ aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue);
+ sal_Int32 nPosX = 0;
+ aPropertyValue >>= nPosX;
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ if ( xSourceReportComponent->getSection().is() )
+ nPosX += getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ aPropertyValue <<= nPosX;
+ }
+ break;
+ case PROPERTY_ID_FONT:
+ aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(PROPERTY_FONT, _rControlValue);
+ break;
+ case PROPERTY_ID_SCOPE:
+ case PROPERTY_ID_FORMULALIST:
+ case PROPERTY_ID_AREA:
+ aPropertyValue = _rControlValue;
+ break;
+ case PROPERTY_ID_TYPE:
+ {
+ ::rtl::OUString sValue;
+ _rControlValue >>= sValue;
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_TYPE_CONST),aList);
+ ::std::vector< ::rtl::OUString >::iterator aFind = ::std::find(aList.begin(),aList.end(),sValue);
+ if ( aFind != aList.end() )
+ aPropertyValue <<= static_cast<sal_uInt32>(aFind - aList.begin());
+ }
+ break;
+ case PROPERTY_ID_MIMETYPE:
+ aPropertyValue = _rControlValue;
+ break;
+ case PROPERTY_ID_VERTICALALIGN:
+ {
+ ::rtl::OUString sValue;
+ _rControlValue >>= sValue;
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_VERTICAL_ALIGN_CONST),aList);
+ ::std::vector< ::rtl::OUString >::iterator aFind = ::std::find(aList.begin(),aList.end(),sValue);
+ if ( aFind != aList.end() )
+ aPropertyValue <<= static_cast<style::VerticalAlignment>(aFind - aList.begin());
+ }
+ break;
+ case PROPERTY_ID_PARAADJUST:
+ {
+ ::rtl::OUString sValue;
+ _rControlValue >>= sValue;
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_PARAADJUST_CONST),aList);
+ ::std::vector< ::rtl::OUString >::iterator aFind = ::std::find(aList.begin(),aList.end(),sValue);
+ if ( aFind != aList.end() )
+ aPropertyValue <<= static_cast<sal_Int16>(aFind - aList.begin());
+ }
+ break;
+ 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;
+
+ uno::Any aPropertyValue(_rPropertyValue);
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ const sal_Int32 nId = m_pInfoService->getPropertyId(PropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_AREA:
+ break;
+ case PROPERTY_ID_FORCENEWPAGE:
+ case PROPERTY_ID_NEWROWORCOL:
+ aControlValue = getConstantValue(sal_True,RID_STR_FORCENEWPAGE_CONST,aPropertyValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ForceNewPage")),PropertyName);
+ break;
+ case PROPERTY_ID_GROUPKEEPTOGETHER:
+ aControlValue = getConstantValue(sal_True,RID_STR_GROUPKEEPTOGETHER_CONST,aPropertyValue,::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,aPropertyValue,::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,aPropertyValue,::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_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ if ( _rControlValueType.getTypeClass() == uno::TypeClass_STRING )
+ {
+ const uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::create( m_xContext,m_xTypeConverter );
+ aControlValue <<= xConversionHelper->convertToControlValue( aPropertyValue );
+ }
+ else
+ {
+ try
+ {
+ aControlValue = m_xTypeConverter->convertTo( aPropertyValue, _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:
+ lcl_convertFormulaTo(aPropertyValue,aControlValue);
+ break;
+ case PROPERTY_ID_DATAFIELD:
+ {
+ ::rtl::OUString sValue;
+ aControlValue >>= sValue;
+ if ( isDefaultFunction(sValue,sValue) )
+ aControlValue <<= sValue;
+ else
+ lcl_convertFormulaTo(aPropertyValue,aControlValue);
+ }
+ break;
+ case PROPERTY_ID_FONT:
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PROPERTY_FONT, aPropertyValue, _rControlValueType);
+ break;
+ case PROPERTY_ID_POSITIONX:
+ {
+ sal_Int32 nPosX = 0;
+ aPropertyValue >>= nPosX;
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ if ( xSourceReportComponent->getSection().is() )
+ nPosX -= getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN);
+ aPropertyValue <<= nPosX;
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, aPropertyValue, _rControlValueType);
+ }
+ break;
+ case PROPERTY_ID_FORMULALIST:
+ aControlValue <<= m_sDefaultFunction;
+ break;
+ case PROPERTY_ID_SCOPE:
+ aControlValue <<= m_sScope;
+ break;
+ case PROPERTY_ID_MIMETYPE:
+ aControlValue = aPropertyValue;
+ break;
+ case PROPERTY_ID_TYPE:
+ {
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_TYPE_CONST),aList);
+ if ( m_nDataFieldType < aList.size() )
+ aControlValue <<= aList[m_nDataFieldType];
+ }
+ break;
+ case PROPERTY_ID_VERTICALALIGN:
+ {
+ style::VerticalAlignment nParagraphVertAlign = style::VerticalAlignment_TOP;
+ aPropertyValue >>= nParagraphVertAlign;
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_VERTICAL_ALIGN_CONST),aList);
+ if ( static_cast<sal_Int16>(nParagraphVertAlign) < static_cast<sal_Int16>(aList.size()) )
+ aControlValue <<= aList[nParagraphVertAlign];
+ }
+ break;
+ case PROPERTY_ID_PARAADJUST:
+ {
+ sal_Int16 nParagraphAdjust = style::ParagraphAdjust_LEFT;
+ aPropertyValue >>= nParagraphAdjust;
+ ::std::vector< ::rtl::OUString > aList;
+ tools::StringListResource aRes(ModuleRes(RID_STR_PARAADJUST_CONST),aList);
+ if ( nParagraphAdjust < static_cast<sal_Int16>(aList.size()) )
+ aControlValue <<= aList[nParagraphAdjust];
+ }
+ break;
+ case PROPERTY_ID_BACKCOLOR:
+ case PROPERTY_ID_CONTROLBACKGROUND:
+ {
+ sal_Int32 nColor = COL_TRANSPARENT;
+ if ( (aPropertyValue >>= nColor) && static_cast<sal_Int32>(COL_TRANSPARENT) == nColor )
+ aPropertyValue.clear();
+ }
+ // run through
+ default:
+ aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, aPropertyValue, _rControlValueType);
+ }
+ return aControlValue;
+}
+void SAL_CALL GeometryHandler::addPropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_aPropertyListeners.addListener( _rxListener );
+ m_xFormComponentHandler->addPropertyChangeListener(_rxListener);
+}
+
+void SAL_CALL GeometryHandler::removePropertyChangeListener(const uno::Reference< beans::XPropertyChangeListener > & _rxListener) throw (uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_aPropertyListeners.removeListener( _rxListener );
+ 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_KEEPTOGETHER
+ ,PROPERTY_CANGROW
+ ,PROPERTY_CANSHRINK
+ ,PROPERTY_REPEATSECTION
+ ,PROPERTY_PRINTREPEATEDVALUES
+ ,PROPERTY_CONDITIONALPRINTEXPRESSION
+ ,PROPERTY_STARTNEWCOLUMN
+ ,PROPERTY_RESETPAGENUMBER
+ ,PROPERTY_PRINTWHENGROUPCHANGE
+ ,PROPERTY_VISIBLE
+ ,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_FONT
+ ,PROPERTY_BACKCOLOR
+ ,PROPERTY_BACKTRANSPARENT
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ ,PROPERTY_LABEL
+ ,PROPERTY_MIMETYPE
+ ,PROPERTY_VERTICALALIGN
+ ,PROPERTY_PARAADJUST
+ };
+ const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo();
+ const 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 )
+ {
+ // special case for controls which contain a data field
+ if ( PROPERTY_DATAFIELD == pIncludeProperties[i] )
+ {
+ beans::Property aValue;
+ aValue.Name = PROPERTY_FORMULALIST;
+ aNewProps.push_back(aValue);
+ aValue.Name = PROPERTY_SCOPE;
+ aNewProps.push_back(aValue);
+ aValue.Name = PROPERTY_TYPE;
+ aNewProps.push_back(aValue);
+ }
+ aNewProps.push_back(*pFind);
+ }
+ } // for (size_t i = 0; i < sizeof(pIncludeProperties)/sizeof(pIncludeProperties[0]) ;++i )
+
+ // special property for shapes
+// if ( uno::Reference< report::XShape>(m_xReportComponent,uno::UNO_QUERY).is() )
+// {
+// beans::Property aValue;
+// aValue.Name = PROPERTY_AREA;
+// aNewProps.push_back(aValue);
+// }
+ // re-enable when the remaining issues of #i88727# are fixed
+
+ 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;
+ const 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 );
+
+ uno::Sequence< ::rtl::OUString > aSeq(5);
+ aSeq[0] = PROPERTY_BACKTRANSPARENT;
+ aSeq[1] = PROPERTY_CONTROLBACKGROUNDTRANSPARENT;
+ aSeq[2] = PROPERTY_FORMULALIST;
+ aSeq[3] = PROPERTY_TYPE;
+ aSeq[4] = PROPERTY_DATAFIELD;
+
+ return ::comphelper::concatSequences(m_xFormComponentHandler->getActuatingProperties(),aSeq);
+}
+
+::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_FONT) )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ const uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ const 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;
+ }
+ else if ( PropertyName.equalsAscii(PROPERTY_FORMULA)
+ || PropertyName.equalsAscii(PROPERTY_INITIALFORMULA)
+ || PropertyName.equalsAscii(PROPERTY_DATAFIELD)
+ || PropertyName.equalsAscii(PROPERTY_CONDITIONALPRINTEXPRESSION))
+ {
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+
+ ::rtl::OUString sFormula;
+ m_xReportComponent->getPropertyValue(PropertyName) >>= sFormula;
+ const uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ uno::Reference< uno::XComponentContext > xContext = m_xContext;
+ uno::Reference< beans::XPropertySet > xRowSet( m_xRowSet,uno::UNO_QUERY);
+ aGuard.clear();
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ if ( rptui::openDialogFormula_nothrow( sFormula, xContext,xInspectorWindow,xRowSet ) )
+ {
+ _rData <<= sFormula;
+ eResult = inspection::InteractiveSelectionResult_ObtainedValue;
+ }
+ return eResult;
+ }
+ else if ( PropertyName.equalsAscii(PROPERTY_AREA) )
+ {
+ ::osl::ClearableMutexGuard aGuard( m_aMutex );
+
+ inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled;
+ const uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ const uno::Reference< report::XShape> xShape(m_xReportComponent,uno::UNO_QUERY);
+ aGuard.clear();
+
+ if ( rptui::openAreaDialog( xShape, xInspectorWindow) )
+ {
+ eResult = inspection::InteractiveSelectionResult_ObtainedValue;
+ beans::PropertyChangeEvent aScopeEvent;
+ aScopeEvent.PropertyName = PROPERTY_FILLCOLOR;
+ // aScopeEvent.OldValue <<= _nOldDataFieldType;
+ aScopeEvent.NewValue <<= xShape->getPropertyValue(PROPERTY_FILLCOLOR);
+ m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange );
+ }
+ 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 _bFirstTimeInit) throw (uno::RuntimeException, lang::NullPointerException)
+{
+ if ( !_rxInspectorUI.is() )
+ throw lang::NullPointerException();
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ const sal_Int32 nId = m_pInfoService->getPropertyId(ActuatingPropertyName);
+ switch(nId)
+ {
+ case PROPERTY_ID_TYPE:
+ {
+ sal_uInt32 nNewVal = 0;
+ NewValue >>= nNewVal;
+ switch(nNewVal)
+ {
+ case DATA_OR_FORMULA:
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_DATAFIELD);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_True);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,sal_False);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,sal_False);
+ OSL_ENSURE(m_sDefaultFunction.getLength() == 0,"Why is the m_sDefaultFunction set?");
+ OSL_ENSURE(m_sScope.getLength() == 0,"Why is the m_sScope set?");
+ break;
+ case FUNCTION:
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_DATAFIELD);
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_FORMULALIST);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_True);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,m_sDefaultFunction.getLength() != 0);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,m_sScope.getLength() != 0);
+ break;
+ case USER_DEF_FUNCTION:
+ _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_False);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,sal_True);
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_FORMULALIST);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,sal_False);
+ break;
+ case COUNTER:
+ _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_False);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,sal_False);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,sal_True);
+ break;
+ }
+ }
+ break;
+ case PROPERTY_ID_DATAFIELD:
+ {
+ sal_Bool bEnable = (m_nDataFieldType != DATA_OR_FORMULA && m_nDataFieldType != COUNTER );
+ if ( bEnable )
+ {
+ ::rtl::OUString sValue;
+ m_xReportComponent->getPropertyValue( PROPERTY_DATAFIELD ) >>= sValue;
+ bEnable = sValue.getLength() != 0;
+ }
+ _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,bEnable);
+ if ( bEnable )
+ {
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_DATAFIELD);
+ _rxInspectorUI->rebuildPropertyUI(PROPERTY_FORMULALIST);
+ } // if ( bEnable )
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, _rxInspectorUI, _bFirstTimeInit);
+ }
+ break;
+ case PROPERTY_ID_FORMULALIST:
+ {
+ _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,m_nDataFieldType == FUNCTION || m_nDataFieldType == COUNTER);
+ }
+ break;
+ case PROPERTY_ID_BACKTRANSPARENT:
+ case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT:
+ {
+ sal_Bool bValue = sal_False;
+ NewValue >>= bValue;
+ bValue = !bValue;
+ _rxInspectorUI->enablePropertyUI(PROPERTY_BACKCOLOR,bValue);
+ _rxInspectorUI->enablePropertyUI(PROPERTY_CONTROLBACKGROUND,bValue);
+ }
+ break;
+ default:
+ m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, _rxInspectorUI, _bFirstTimeInit);
+ break;
+ }
+}
+
+::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 String aGcc3WorkaroundTemporary( ModuleRes(RID_STR_FILTER));
+ const ::rtl::OUString sPropertyUIName( aGcc3WorkaroundTemporary );
+ // 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)
+{
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY);
+ const 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));
+
+ const sal_Int32 nCount = xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount ; ++i)
+ {
+ const uno::Reference< report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY);
+ if ( xReportComponent.is() && xReportComponent != xSourceReportComponent )
+ {
+ const ::Rectangle aBoundRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize()));
+ const ::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);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const
+{
+ if ( m_nDataFieldType == FUNCTION )
+ ::std::transform(m_aDefaultFunctions.begin(),m_aDefaultFunctions.end(),::std::back_inserter(_out_rList),::boost::bind( &DefaultFunction::getName, _1 ));
+ else if ( m_nDataFieldType == USER_DEF_FUNCTION )
+ ::std::transform(m_aFunctionNames.begin(),m_aFunctionNames.end(),::std::back_inserter(_out_rList),::std::select1st<TFunctions::value_type>());
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString GeometryHandler::impl_ConvertUIToMimeType_nothrow(const ::rtl::OUString& _sUIName) const
+{
+ ::std::vector< ::rtl::OUString > aList;
+ impl_fillMimeTypes_nothrow(aList);
+ ::rtl::OUString sRet;
+ ::std::vector< ::rtl::OUString >::const_iterator aFind = ::std::find(aList.begin(),aList.end(),_sUIName);
+ if ( aFind != aList.end() )
+ {
+ const sal_Size nPos = aFind - aList.begin();
+ const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY);
+ if ( xReportDefinition.is() )
+ {
+ const uno::Sequence< ::rtl::OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() );
+ sRet = aMimeTypes[nPos];
+ }
+ } // if ( aFind != aList.end() )
+ return sRet;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString GeometryHandler::impl_ConvertMimeTypeToUI_nothrow(const ::rtl::OUString& _sMimetype) const
+{
+ uno::Reference<lang::XMultiServiceFactory> xServiceFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
+ ::comphelper::MimeConfigurationHelper aMimeHelper(xServiceFactory);
+ ::rtl::OUString sRet;
+ const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aMimeHelper.GetDocServiceNameFromMediaType(_sMimetype) );
+ if ( pFilter )
+ sRet = pFilter->GetUIName();
+ if ( !sRet.getLength() )
+ sRet = _sMimetype;
+ return sRet;
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::impl_fillMimeTypes_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const
+{
+ try
+ {
+ const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY);
+ if ( xReportDefinition.is() )
+ {
+ uno::Sequence< ::rtl::OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() );
+ const ::rtl::OUString* pIter = aMimeTypes.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aMimeTypes.getLength();
+ for(;pIter != pEnd; ++pIter)
+ {
+ const ::rtl::OUString sDocName( impl_ConvertMimeTypeToUI_nothrow(*pIter) );
+ if ( sDocName.getLength() )
+ _out_rList.push_back(sDocName);
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::impl_fillScopeList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const
+{
+ try
+ {
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY_THROW);
+ const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY_THROW);
+
+ const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+ const 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;
+
+ const String sGroup = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ for (sal_Int32 i = 0 ; i <= nPos ; ++i)
+ {
+ xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
+ String sGroupName = sGroup;
+ sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
+ _out_rList.push_back(sGroupName);
+ }
+ _out_rList.push_back(xReportDefinition->getName());
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(::rtl::OUString& _rsNamePostFix)
+{
+ uno::Reference< report::XFunctionsSupplier> xReturn;
+
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY_THROW);
+ const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY_THROW);
+ const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+ if ( !m_sScope.getLength() )
+ {
+ const uno::Reference< report::XGroup> xGroup(xSection->getGroup(),uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ _rsNamePostFix = xGroup->getExpression();
+ sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix);
+ m_sScope = sGroupName;
+ xReturn = xGroup.get();
+ }
+ else if ( xSection == xReportDefinition->getDetail() )
+ {
+ const uno::Reference< report::XGroups> xGroups = xReportDefinition->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+ if ( nCount )
+ {
+ const uno::Reference< report::XGroup> xGroup2(xGroups->getByIndex(nCount - 1),uno::UNO_QUERY_THROW);
+ String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ _rsNamePostFix = xGroup2->getExpression();
+ sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix);
+ m_sScope = sGroupName;
+ xReturn = xGroup2.get();
+ }
+ }
+ if ( !m_sScope.getLength() )
+ {
+ xReturn = xReportDefinition.get();
+ _rsNamePostFix = m_sScope = xReportDefinition->getName();
+ }
+ }
+ else if ( m_sScope == xReportDefinition->getName() )
+ {
+ xReturn = xReportDefinition.get();
+ _rsNamePostFix = m_sScope;
+ }
+ else
+ {
+ uno::Reference< report::XGroups> xGroups = xReportDefinition->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+
+ for (sal_Int32 i = 0 ; i < nCount; ++i)
+ {
+ const uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
+ String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
+ if ( m_sScope == ::rtl::OUString(sGroupName) )
+ {
+ _rsNamePostFix = xGroup->getExpression();
+ xReturn = xGroup.get();
+ break;
+ }
+ }
+
+ }
+ OSL_ENSURE(xReturn.is(),"Why don't we have a functionssupplier here!");
+
+ return xReturn;
+}
+// -----------------------------------------------------------------------------
+sal_Bool GeometryHandler::isDefaultFunction( const ::rtl::OUString& _sQuotedFunction
+ ,::rtl::OUString& _rDataField
+ ,const uno::Reference< report::XFunctionsSupplier>& _xFunctionsSupplier
+ ,bool _bSet) const
+{
+ sal_Bool bDefaultFunction = sal_False;
+ try
+ {
+ const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY_THROW);
+ const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY_THROW);
+ const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition();
+
+ ::std::pair<TFunctions::const_iterator,TFunctions::const_iterator> aFind = m_aFunctionNames.equal_range(_sQuotedFunction);
+ while ( aFind.first != aFind.second )
+ {
+ if ( !_xFunctionsSupplier.is() || _xFunctionsSupplier == aFind.first->second.second )
+ {
+ const beans::Optional< ::rtl::OUString> aInitalFormula = aFind.first->second.first->getInitialFormula();
+ if ( aInitalFormula.IsPresent )
+ {
+ ::rtl::OUString sDefaultFunctionName;
+ bDefaultFunction = impl_isDefaultFunction_nothrow(aFind.first->second.first,_rDataField,sDefaultFunctionName);
+ if ( bDefaultFunction )
+ {
+ m_xFunction = aFind.first->second.first;
+ if ( _bSet )
+ {
+ m_sDefaultFunction = sDefaultFunctionName;
+ uno::Reference< report::XGroup> xGroup(aFind.first->second.second,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
+ m_sScope = sGroupName;
+ }
+ else
+ m_sScope = xReportDefinition->getName();
+ }
+ }
+ break;
+ }
+ }
+ ++(aFind.first);
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+ return bDefaultFunction;
+}
+// -----------------------------------------------------------------------------
+sal_Bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< report::XFunction>& _xFunction
+ ,::rtl::OUString& _rDataField
+ ,::rtl::OUString& _rsDefaultFunctionName) const
+{
+ sal_Bool bDefaultFunction = sal_False;
+ try
+ {
+ const String sFormula( _xFunction->getFormula() );
+ util::SearchOptions aSearchOptions;
+ aSearchOptions.algorithmType = util::SearchAlgorithms_REGEXP;
+ aSearchOptions.searchFlag = 0x00000100;
+ ::std::vector< DefaultFunction >::const_iterator aIter = m_aDefaultFunctions.begin();
+ ::std::vector< DefaultFunction >::const_iterator aDeEnd = m_aDefaultFunctions.end();
+ for (; aIter != aDeEnd; ++aIter)
+ {
+ aSearchOptions.searchString = aIter->m_sSearchString;
+ utl::TextSearch aTextSearch(aSearchOptions);
+ xub_StrLen start = 0;
+ xub_StrLen end = sFormula.Len();
+ if ( aTextSearch.SearchFrwrd(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // default function found
+ {
+ aSearchOptions.searchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]"));
+ utl::TextSearch aDataSearch(aSearchOptions);
+ aDataSearch.SearchFrwrd(sFormula,&start,&end );
+ ++start;
+ _rDataField = sFormula.Copy(start,end-start-1);
+ _rsDefaultFunctionName = aIter->m_sName;
+ break;
+ }
+ }
+
+ bDefaultFunction = aIter != aDeEnd;
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+ return bDefaultFunction;
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::loadDefaultFunctions()
+{
+ if ( m_aDefaultFunctions.empty() )
+ {
+ m_aCounterFunction.m_bPreEvaluated = sal_False;
+ m_aCounterFunction.m_bDeepTraversing = sal_False;
+ m_aCounterFunction.m_sName = String(ModuleRes(RID_STR_F_COUNTER));
+ m_aCounterFunction.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%FunctionName] + 1"));
+ m_aCounterFunction.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:\\[[:alpha:]+([:space:]*[:alnum:]*)*\\][:space:]*\\+[:space:]*[:digit:]*"));
+ m_aCounterFunction.m_sInitialFormula.IsPresent = sal_True;
+ m_aCounterFunction.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:1"));
+
+ DefaultFunction aDefault;
+ aDefault.m_bDeepTraversing = sal_False;
+
+ //aDefault.m_sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Counter"));
+ //aDefault.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%FunctionName] + 1"));
+ //aDefault.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:\\[[:alpha:]+[:alnum:]*\\][:space:]*\\+[:space:]*1"));
+ //aDefault.m_sInitialFormula.IsPresent = sal_True;
+ //aDefault.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:1"));
+ //m_aDefaultFunctions.push_back(aDefault);
+
+ aDefault.m_bPreEvaluated = sal_True;
+
+ aDefault.m_sName = String(ModuleRes(RID_STR_F_ACCUMULATION));
+ aDefault.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%Column] + [%FunctionName]"));
+ aDefault.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:\\[[:alpha:]+([:space:]*[:alnum:]*)*\\][:space:]*\\+[:space:]*\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]"));
+ aDefault.m_sInitialFormula.IsPresent = sal_True;
+ aDefault.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%Column]"));
+ m_aDefaultFunctions.push_back(aDefault);
+
+ aDefault.m_sName = String(ModuleRes(RID_STR_F_MINIMUM));
+ aDefault.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:IF([%Column] < [%FunctionName];[%Column];[%FunctionName])"));
+ aDefault.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:IF\\((\\[[:alpha:]+([:space:]*[:alnum:]*)*\\])[:space:]*<[:space:]*(\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]);[:space:]*\\1[:space:]*;[:space:]*\\3[:space:]*\\)"));
+ aDefault.m_sInitialFormula.IsPresent = sal_True;
+ aDefault.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%Column]"));
+ m_aDefaultFunctions.push_back(aDefault);
+
+ aDefault.m_sName = String(ModuleRes(RID_STR_F_MAXIMUM));
+ aDefault.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:IF([%Column] > [%FunctionName];[%Column];[%FunctionName])"));
+ aDefault.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:IF\\((\\[[:alpha:]+([:space:]*[:alnum:]*)*\\])[:space:]*>[:space:]*(\\[[:alpha:]+([:space:]*[:alnum:]*)*\\]);[:space:]*\\1[:space:]*;[:space:]*\\3[:space:]*\\)"));
+ aDefault.m_sInitialFormula.IsPresent = sal_True;
+ aDefault.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%Column]"));
+ m_aDefaultFunctions.push_back(aDefault);
+ }
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::createDefaultFunction(::osl::ResettableMutexGuard& _aGuard ,const ::rtl::OUString& _sFunction,const ::rtl::OUString& _sDataField)
+{
+ try
+ {
+ ::rtl::OUString sNamePostFix;
+ const uno::Reference< report::XFunctionsSupplier> xFunctionsSupplier = fillScope_throw(sNamePostFix);
+
+ ::std::vector< DefaultFunction >::const_iterator aIter = m_aDefaultFunctions.begin();
+ ::std::vector< DefaultFunction >::const_iterator aDeEnd = m_aDefaultFunctions.end();
+ for (; aIter != aDeEnd; ++aIter)
+ {
+ if ( aIter->m_sName == _sFunction )
+ {
+ const ::rtl::OUString sFunctionName( _sFunction + _sDataField + sNamePostFix);
+ const ::rtl::OUString sQuotedFunctionName(lcl_getQuotedFunctionName(sFunctionName));
+
+ beans::PropertyChangeEvent aEvent;
+ aEvent.PropertyName = PROPERTY_SCOPE;
+ aEvent.OldValue <<= m_sScope;
+
+ ::std::pair<TFunctions::const_iterator,TFunctions::const_iterator> aFind = m_aFunctionNames.equal_range(sQuotedFunctionName);
+ while ( aFind.first != aFind.second )
+ {
+ if ( xFunctionsSupplier == aFind.first->second.second )
+ {
+ m_xFunction = aFind.first->second.first;
+ ::rtl::OUString sTemp;
+ isDefaultFunction(sQuotedFunctionName,sTemp,uno::Reference< report::XFunctionsSupplier>(),true); // implicitly sets the m_sScope
+ break;
+ }
+ ++(aFind.first);
+ }
+ if ( aFind.first == aFind.second )
+ impl_createFunction(sFunctionName,_sDataField,*aIter);
+
+ OBlocker aBlocker(m_bIn);
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny( impl_convertToFormula( uno::makeAny(sQuotedFunctionName) )));
+ aEvent.NewValue <<= m_sScope;
+ _aGuard.clear();
+ m_aPropertyListeners.notify( aEvent, &beans::XPropertyChangeListener::propertyChange );
+ break;
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught!");
+ }
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::removeFunction()
+{
+ if ( m_xFunction.is() )
+ {
+ const ::rtl::OUString sQuotedFunctionName(lcl_getQuotedFunctionName(m_xFunction));
+ ::std::pair<TFunctions::iterator,TFunctions::iterator> aFind = m_aFunctionNames.equal_range(sQuotedFunctionName);
+ while ( aFind.first != aFind.second )
+ {
+ if ( aFind.first->second.first == m_xFunction )
+ {
+ uno::Reference< report::XFunctions> xFunctions = aFind.first->second.second->getFunctions();
+ xFunctions->removeByIndex(xFunctions->getCount() - 1 ); /// TODO: insert new method in XFunctions: removeFunction(xfunction)
+ m_aFunctionNames.erase(aFind.first);
+ m_bNewFunction = false;
+ break;
+ }
+ ++(aFind.first);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,const ::rtl::OUString& _sOldFunctionName,const ::rtl::OUString& _sOldScope,const sal_uInt32 _nOldDataFieldType)
+{
+ const ::rtl::OUString sNewFunction = m_sDefaultFunction;
+ const ::rtl::OUString sNewScope = m_sScope;
+ const sal_uInt32 nNewDataFieldType = m_nDataFieldType;
+ _aGuard.clear();
+ if ( _nOldDataFieldType != nNewDataFieldType )
+ {
+ beans::PropertyChangeEvent aScopeEvent;
+ aScopeEvent.PropertyName = PROPERTY_TYPE;
+ aScopeEvent.OldValue <<= _nOldDataFieldType;
+ aScopeEvent.NewValue <<= nNewDataFieldType;
+ m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange );
+ }
+ if ( _sOldFunctionName != sNewFunction )
+ {
+ beans::PropertyChangeEvent aFormulaEvent;
+ aFormulaEvent.PropertyName = PROPERTY_FORMULALIST;
+ aFormulaEvent.OldValue <<= _sOldFunctionName;
+ aFormulaEvent.NewValue <<= sNewFunction;
+
+ m_aPropertyListeners.notify( aFormulaEvent, &beans::XPropertyChangeListener::propertyChange );
+ }
+ if ( _sOldScope != sNewScope )
+ {
+ beans::PropertyChangeEvent aScopeEvent;
+ aScopeEvent.PropertyName = PROPERTY_SCOPE;
+ aScopeEvent.OldValue <<= _sOldScope;
+ aScopeEvent.NewValue <<= sNewScope;
+ m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange );
+ }
+
+ _aGuard.reset();
+}
+//------------------------------------------------------------------------
+void GeometryHandler::impl_initFieldList_nothrow( uno::Sequence< ::rtl::OUString >& _rFieldNames ) const
+{
+ _rFieldNames.realloc(0);
+ try
+ {
+ uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY);
+ Window* pInspectorWindow = VCLUnoHelper::GetWindow( xInspectorWindow );
+ WaitObject aWaitCursor( pInspectorWindow );
+
+ uno::Reference< sdbc::XPreparedStatement > xStatement;
+
+ // get the form of the control we're inspecting
+ uno::Reference< beans::XPropertySet > xFormSet( m_xRowSet, uno::UNO_QUERY );
+ if ( !xFormSet.is() )
+ return;
+
+ ::rtl::OUString sObjectName;
+ OSL_VERIFY( xFormSet->getPropertyValue( PROPERTY_COMMAND ) >>= sObjectName );
+ // when there is no command we don't need to ask for columns
+ uno::Reference<sdbc::XConnection> xCon(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection"))) ,uno::UNO_QUERY);
+ if ( sObjectName.getLength() && xCon.is() )
+ {
+ sal_Int32 nObjectType = sdb::CommandType::COMMAND;
+ OSL_VERIFY( xFormSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nObjectType );
+
+ _rFieldNames = ::dbtools::getFieldNamesByCommandDescriptor( xCon, nObjectType, sObjectName );
+ }
+ }
+ catch (uno::Exception&)
+ {
+ DBG_ERROR( "GeometryHandler::impl_initFieldList_nothrow: caught an exception!" );
+ }
+}
+// -----------------------------------------------------------------------------
+bool GeometryHandler::impl_isCounterFunction_throw(const ::rtl::OUString& _sQuotedFunctionName,::rtl::OUString& _Out_sScope) const
+{
+ ::std::pair<TFunctions::const_iterator,TFunctions::const_iterator> aFind = m_aFunctionNames.equal_range(_sQuotedFunctionName);
+ while ( aFind.first != aFind.second )
+ {
+ const beans::Optional< ::rtl::OUString> aInitalFormula = aFind.first->second.first->getInitialFormula();
+ if ( aInitalFormula.IsPresent )
+ {
+ const String sFormula( aFind.first->second.first->getFormula() );
+ util::SearchOptions aSearchOptions;
+ aSearchOptions.algorithmType = util::SearchAlgorithms_REGEXP;
+ aSearchOptions.searchFlag = 0x00000100;
+ aSearchOptions.searchString = m_aCounterFunction.m_sSearchString;
+ utl::TextSearch aTextSearch(aSearchOptions);
+ xub_StrLen start = 0;
+ xub_StrLen end = sFormula.Len();
+ if ( aTextSearch.SearchFrwrd(sFormula,&start,&end) && start == 0 && end == sFormula.Len()) // counter function found
+ {
+ const uno::Reference< report::XGroup > xGroup(aFind.first->second.second,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP));
+ sGroupName.SearchAndReplaceAscii("%1",xGroup->getExpression());
+ _Out_sScope = sGroupName;
+ }
+ else
+ _Out_sScope = uno::Reference< report::XReportDefinition >(aFind.first->second.second,uno::UNO_QUERY_THROW)->getName();
+ break;
+ }
+ }
+ ++(aFind.first);
+ }
+ return aFind.first != aFind.second;
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::impl_createFunction(const ::rtl::OUString& _sFunctionName,const ::rtl::OUString& _sDataField,const DefaultFunction& _aFunction)
+{
+ if ( m_bNewFunction )
+ removeFunction();
+
+ const ::rtl::OUString sQuotedFunctionName(lcl_getQuotedFunctionName(_sFunctionName));
+ m_xFunction.set(report::Function::create(m_xContext));
+ m_xFunction->setName( _sFunctionName );
+
+ const String sPlaceHolder1(RTL_CONSTASCII_USTRINGPARAM("%Column"));
+ const String sPlaceHolder2(RTL_CONSTASCII_USTRINGPARAM("%FunctionName"));
+ String sFormula(_aFunction.m_sFormula);
+ sFormula.SearchAndReplaceAll(sPlaceHolder1,_sDataField);
+ sFormula.SearchAndReplaceAll(sPlaceHolder2,_sFunctionName);
+
+ m_xFunction->setFormula(sFormula);
+ m_xFunction->setPreEvaluated(_aFunction.m_bPreEvaluated);
+ m_xFunction->setDeepTraversing(_aFunction.m_bDeepTraversing);
+ if ( _aFunction.m_sInitialFormula.IsPresent )
+ {
+ beans::Optional< ::rtl::OUString> aInitialFormula = _aFunction.m_sInitialFormula;
+ String sInitialFormula = aInitialFormula.Value;
+ sInitialFormula.SearchAndReplaceAll(sPlaceHolder1,_sDataField);
+ sInitialFormula.SearchAndReplaceAll(sPlaceHolder2,_sFunctionName);
+ aInitialFormula.Value = sInitialFormula;
+ m_xFunction->setInitialFormula( aInitialFormula );
+ }
+ ::rtl::OUString sNamePostFix;
+ const uno::Reference< report::XFunctionsSupplier> xFunctionsSupplier = fillScope_throw(sNamePostFix);
+ const uno::Reference< container::XIndexContainer> xFunctions(xFunctionsSupplier->getFunctions(),uno::UNO_QUERY_THROW);
+ xFunctions->insertByIndex(xFunctions->getCount(),uno::makeAny(m_xFunction));
+ m_aFunctionNames.insert(TFunctions::value_type(sQuotedFunctionName,TFunctionPair(m_xFunction,xFunctionsSupplier)));
+ m_bNewFunction = true;
+}
+// -----------------------------------------------------------------------------
+void GeometryHandler::impl_setCounterFunction_throw()
+{
+ ::rtl::OUString sNamePostFix;
+ fillScope_throw(sNamePostFix);
+ ::rtl::OUString sFunctionName = m_aCounterFunction.m_sName;
+ sFunctionName += sNamePostFix;
+ const ::rtl::OUString sQuotedFunctionName = lcl_getQuotedFunctionName(sFunctionName);
+ ::rtl::OUString sScope;
+ if ( !(sFunctionName.getLength() && m_aFunctionNames.find(sQuotedFunctionName) != m_aFunctionNames.end() && impl_isCounterFunction_throw(sQuotedFunctionName,sScope)) )
+ impl_createFunction(sFunctionName,::rtl::OUString(),m_aCounterFunction);
+
+ OBlocker aBlocker(m_bIn);
+ m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(impl_convertToFormula( uno::makeAny(sQuotedFunctionName))));
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 GeometryHandler::impl_getDataFieldType_throw(const ::rtl::OUString& _sDataField) const
+{
+ sal_uInt32 nDataFieldType = UNDEF_DATA;
+ ::rtl::OUString sDataField;
+ if ( _sDataField.getLength() )
+ sDataField = _sDataField;
+ else
+ {
+ uno::Any aDataField( m_xReportComponent->getPropertyValue( PROPERTY_DATAFIELD ) );
+ lcl_convertFormulaTo(aDataField,aDataField);
+ aDataField >>= sDataField;
+ }
+
+ if ( sDataField.getLength() )
+ {
+ if ( impl_isDataField(sDataField) )
+ nDataFieldType = DATA_OR_FORMULA;
+ else if ( isDefaultFunction(sDataField,sDataField) )
+ nDataFieldType = FUNCTION;
+ else if ( m_aFunctionNames.find(sDataField) != m_aFunctionNames.end() )
+ {
+ nDataFieldType = USER_DEF_FUNCTION;
+ ::rtl::OUString sScope;
+ if ( impl_isCounterFunction_throw(sDataField,sScope) )
+ nDataFieldType = COUNTER;
+ }
+ else
+ nDataFieldType = DATA_OR_FORMULA;
+ }
+ return nDataFieldType;
+}
+// -----------------------------------------------------------------------------
+// XEventListener
+void SAL_CALL GeometryHandler::disposing(const lang::EventObject& ) throw( uno::RuntimeException )
+{
+}
+// XPropertyChangeListener
+void SAL_CALL GeometryHandler::propertyChange(const beans::PropertyChangeEvent& /*evt*/) throw(uno::RuntimeException)
+{
+ ::osl::ResettableMutexGuard aGuard( m_aMutex );
+ if ( !m_bIn )
+ {
+ const sal_uInt32 nOldDataFieldType = m_nDataFieldType;
+ const ::rtl::OUString sOldFunctionName = m_sDefaultFunction;
+ const ::rtl::OUString sOldScope = m_sScope;
+ m_sDefaultFunction = m_sScope = ::rtl::OUString();
+ m_nDataFieldType = impl_getDataFieldType_throw();
+ if ( UNDEF_DATA == m_nDataFieldType )
+ m_nDataFieldType = nOldDataFieldType;
+ uno::Any aDataField = m_xReportComponent->getPropertyValue( PROPERTY_DATAFIELD );
+ lcl_convertFormulaTo(aDataField,aDataField);
+ ::rtl::OUString sDataField;
+ aDataField >>= sDataField;
+ switch(m_nDataFieldType)
+ {
+ case FUNCTION:
+ isDefaultFunction(sDataField,sDataField,uno::Reference< report::XFunctionsSupplier>(),true);
+ break;
+ case COUNTER:
+ impl_isCounterFunction_throw(sDataField,m_sScope);
+ break;
+ default:
+ ;
+ }
+
+ resetOwnProperties(aGuard,sOldFunctionName,sOldScope,nOldDataFieldType);
+ }
+}
+//........................................................................
+} // namespace rptui
+//........................................................................
+
diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
new file mode 100644
index 000000000000..d992206b6f54
--- /dev/null
+++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
@@ -0,0 +1,232 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ReportComponentHandler.hxx"
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <comphelper/sequence.hxx>
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#include <comphelper/types.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/syslocale.hxx>
+#include <com/sun/star/inspection/PropertyControlType.hpp>
+#include <com/sun/star/report/XReportDefinition.hpp>
+#include <com/sun/star/report/XSection.hpp>
+#include <com/sun/star/inspection/XNumericControl.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/util/MeasureUnit.hpp>
+#include <tools/fldunit.hxx>
+#include "metadata.hxx"
+
+//........................................................................
+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);
+ const ::rtl::OUString sFormComponent(RTL_CONSTASCII_USTRINGPARAM("FormComponent"));
+ if ( xNameCont->hasByName(sFormComponent) )
+ xNameCont->getByName(sFormComponent) >>= m_xFormComponent;
+ const ::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..5d496ee26d83
--- /dev/null
+++ b/reportdesign/source/ui/inspection/inspection.src
@@ -0,0 +1,394 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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 [ en-US ] = "General" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPPAGE_DATA
+{
+ Text [ en-US ] = "Data" ;
+ Text [ x-comment ] = " ";
+};
+Resource RID_STR_BOOL
+{
+ String 1
+ {
+ Text [ en-US ] = "No" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Yes" ;
+ };
+};
+String RID_STR_FORCENEWPAGE
+{
+ Text [ en-US ] = "Force New Page" ;
+};
+Resource RID_STR_FORCENEWPAGE_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "None" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Before Section" ;
+ };
+ String 3
+ {
+ Text [ en-US ] = "After Section" ;
+ };
+ String 4
+ {
+ Text [ en-US ] = "Before & After Section" ;
+ };
+};
+String RID_STR_NEWROWORCOL
+{
+ Text [ en-US ] = "New Row Or Column" ;
+};
+String RID_STR_KEEPTOGETHER
+{
+ Text [ en-US ] = "Keep Together" ;
+};
+Resource RID_STR_KEEPTOGETHER_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "No" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Whole Group" ;
+ };
+ String 3
+ {
+ Text [ en-US ] = "With First Detail" ;
+ };
+};
+String RID_STR_CANGROW
+{
+ Text [ en-US ] = "Can Grow" ;
+};
+String RID_STR_CANSHRINK
+{
+ Text [ en-US ] = "Can Shrink" ;
+};
+String RID_STR_REPEATSECTION
+{
+ Text [ en-US ] = "Repeat Section" ;
+};
+String RID_STR_PRINTREPEATEDVALUES
+{
+ Text [ en-US ] = "Print repeated values" ;
+};
+String RID_STR_CONDITIONALPRINTEXPRESSION
+{
+ Text [ en-US ] = "Conditional Print Expression" ;
+};
+String RID_STR_STARTNEWCOLUMN
+{
+ Text [ en-US ] = "Start new column" ;
+};
+String RID_STR_STARTNEWPAGE
+{
+ Text [ en-US ] = "Start new page" ;
+};
+String RID_STR_RESETPAGENUMBER
+{
+ Text [ en-US ] = "Reset page number" ;
+};
+String RID_STR_CHARTTYPE
+{
+ Text [ en-US ] = "Chart type" ;
+};
+String RID_STR_PRINTWHENGROUPCHANGE
+{
+ Text [ en-US ] = "Print When Group Change" ;
+};
+String RID_STR_VISIBLE
+{
+ Text [ en-US ] = "Visible" ;
+};
+String RID_STR_GROUPKEEPTOGETHER
+{
+ Text [ en-US ] = "Group keep together" ;
+};
+Resource RID_STR_GROUPKEEPTOGETHER_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "Per Page" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Per Column" ;
+ };
+};
+Resource RID_STR_SECTIONPAGEBREAK_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "None" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Section" ;
+ };
+ String 3
+ {
+ Text [ en-US ] = "Automatic" ;
+ };
+};
+String RID_STR_PAGEHEADEROPTION
+{
+ Text [ en-US ] = "Page header" ;
+};
+String RID_STR_PAGEFOOTEROPTION
+{
+ Text [ en-US ] = "Page footer" ;
+};
+Resource RID_STR_REPORTPRINTOPTION_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "All Pages" ;
+ };
+ String 2
+ {
+ Text [ en-US ] = "Not With Report Header" ;
+ };
+ String 3
+ {
+ Text [ en-US ] = "Not With Report Footer" ;
+ };
+ String 4
+ {
+ Text [ en-US ] = "Not With Report Header/Footer" ;
+ };
+};
+String RID_STR_DEEPTRAVERSING
+{
+ Text [ en-US ] = "Deep traversing" ;
+};
+String RID_STR_PREEVALUATED
+{
+ Text [ en-US ] = "Pre evaluation" ;
+};
+String RID_STR_POSITIONX
+{
+ Text [ en-US ] = "Position X";
+};
+String RID_STR_POSITIONY
+{
+ Text [ en-US ] = "Position Y";
+};
+String RID_STR_WIDTH
+{
+ Text [ en-US ] = "Width";
+};
+String RID_STR_HEIGHT
+{
+ Text [ en-US ] = "Height";
+};
+String RID_STR_INITIALFORMULA
+{
+ Text [ en-US ] = "Initial value" ;
+};
+String RID_STR_PRESERVEIRI
+{
+ Text [ en-US ] = "Preserve as Link" ;
+};
+String RID_STR_FORMULA
+{
+ Text [ en-US ] = "Formula" ;
+};
+String RID_STR_DATAFIELD
+{
+ Text [ en-US ] = "Data field" ;
+};
+String RID_STR_FONT
+{
+ Text [ en-US ] = "Font" ;
+};
+String RID_STR_BACKCOLOR
+{
+ Text [ en-US ] = "Background color";
+};
+String RID_STR_BACKTRANSPARENT
+{
+ Text [ en-US ] = "Background Transparent";
+};
+String RID_STR_CONTROLBACKGROUNDTRANSPARENT
+{
+ Text [ en-US ] = "Background Transparent";
+};
+String RID_STR_OVERLAP_OTHER_CONTROL
+{
+ Text [ en-US ] = "This operation is not allowed. The control overlaps with another one.";
+};
+String RID_STR_ILLEGAL_POSITION
+{
+ Text [ en-US ] = "This position can not be set. It is invalid.";
+};
+String RID_STR_SCOPE_GROUP
+{
+ Text [ en-US ] = "Group: %1";
+};
+String RID_STR_FORMULALIST
+{
+ Text [ en-US ] = "Function";
+};
+String RID_STR_SCOPE
+{
+ Text [ en-US ] = "Scope";
+};
+String RID_STR_TYPE
+{
+ Text [ en-US ] = "Data Field Type";
+};
+Resource RID_STR_TYPE_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "Field or Formula";
+ };
+ String 2
+ {
+ Text [ en-US ] = "Function";
+ };
+ String 3
+ {
+ Text [ en-US ] = "Counter";
+ };
+ String 4
+ {
+ Text [ en-US ] = "User defined Function";
+ };
+};
+String RID_STR_MASTERFIELDS
+{
+ Text [ en-US ] = "Link master fields" ;
+};
+String RID_STR_DETAILFIELDS
+{
+ Text [ en-US ] = "Link slave fields" ;
+};
+String RID_STR_EXPLANATION
+{
+ Text [ en-US ] = "Charts can be used to display detailed data about the current record of the report. To do this, you can specify which columns in the chart match which columns in the report.";
+};
+String RID_STR_DETAILLABEL
+{
+ Text [ en-US ] = "Chart" ;
+};
+String RID_STR_MASTERLABEL
+{
+ Text [ en-US ] = "Report" ;
+};
+
+String RID_STR_PREVIEW_COUNT
+{
+ Text [ en-US ] = "Preview Row(s)" ;
+};
+String RID_STR_AREA
+{
+ Text [ en-US ] = "Area" ;
+};
+String RID_STR_MIMETYPE
+{
+ Text [ en-US ] = "Report Output Format" ;
+};
+String RID_STR_VERTICALALIGN
+{
+ Text [ en-US ] = "Vert. Alignment" ;
+};
+Resource RID_STR_VERTICAL_ALIGN_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "Top";
+ };
+ String 2
+ {
+ Text [ en-US ] = "Middle";
+ };
+ String 3
+ {
+ Text [ en-US ] = "Bottom";
+ };
+};
+String RID_STR_PARAADJUST
+{
+ Text [ en-US ] = "Horz. Alignment" ;
+};
+Resource RID_STR_PARAADJUST_CONST
+{
+ String 1
+ {
+ Text [ en-US ] = "Left";
+ };
+ String 2
+ {
+ Text [ en-US ] = "Right";
+ };
+ String 3
+ {
+ Text [ en-US ] = "Block";
+ };
+ String 4
+ {
+ Text [ en-US ] = "Center";
+ };
+};
+String RID_STR_F_COUNTER
+{
+ Text [ en-US ] = "Counter" ;
+};
+String RID_STR_F_ACCUMULATION
+{
+ Text [ en-US ] = "Accumulation" ;
+};
+String RID_STR_F_MINIMUM
+{
+ Text [ en-US ] = "Minimum" ;
+};
+String RID_STR_F_MAXIMUM
+{
+ Text [ en-US ] = "Maximum" ;
+};
+
diff --git a/reportdesign/source/ui/inspection/makefile.mk b/reportdesign/source/ui/inspection/makefile.mk
new file mode 100644
index 000000000000..cd2c6e9e52cd
--- /dev/null
+++ b/reportdesign/source/ui/inspection/makefile.mk
@@ -0,0 +1,53 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=ui_inspection
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES=\
+ $(SLO)$/DefaultInspection.obj \
+ $(SLO)$/ReportComponentHandler.obj \
+ $(SLO)$/GeometryHandler.obj \
+ $(SLO)$/DataProviderHandler.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..2c98d134196e
--- /dev/null
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -0,0 +1,339 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "metadata.hxx"
+#include <svtools/localresaccess.hxx>
+#include "com/sun/star/inspection/XPropertyHandler.hpp"
+#include <tools/debug.hxx>
+#include <cppuhelper/extract.hxx>
+#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;
+ rtl::OString sHelpId;
+ sal_Int32 nId;
+ sal_uInt16 nPos;
+ sal_uInt32 nUIFlags;
+
+ OPropertyInfoImpl(
+ const ::rtl::OUString& rName,
+ sal_Int32 _nId,
+ const String& aTranslation,
+ sal_uInt16 nPosId,
+ const rtl::OString& _sHelpId,
+ sal_uInt32 _nUIFlags);
+ };
+
+ //------------------------------------------------------------------------
+ OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId,
+ const String& aString, sal_uInt16 nP, const rtl::OString& sHid, sal_uInt32 _nUIFlags)
+ :sName(_rName)
+ ,sTranslation(aString)
+ ,sHelpId(sHid)
+ ,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_RPT_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( FONT, 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( TYPE, TYPE, TYPE, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_2( DATAFIELD, DATAFIELD, DATAFIELD, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_2( FORMULALIST, FORMULALIST, FORMULALIST, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_2( SCOPE, SCOPE, SCOPE, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_1( PRESERVEIRI, PRESERVEIRI, PRESERVEIRI, COMPOSEABLE )
+ ,DEF_INFO_1( BACKCOLOR, BACKCOLOR, BACKCOLOR, COMPOSEABLE )
+ ,DEF_INFO_1( CONTROLBACKGROUND, BACKCOLOR, BACKCOLOR, COMPOSEABLE )
+ ,DEF_INFO_1( BACKTRANSPARENT, BACKTRANSPARENT, BACKTRANSPARENT, COMPOSEABLE )
+ ,DEF_INFO_1( CONTROLBACKGROUNDTRANSPARENT, CONTROLBACKGROUNDTRANSPARENT
+ ,CONTROLBACKGROUNDTRANSPARENT, COMPOSEABLE )
+ ,DEF_INFO_1( CHARTTYPE, CHARTTYPE, CHARTTYPE, COMPOSEABLE )
+ ,DEF_INFO_1( PREVIEW_COUNT, PREVIEW_COUNT, PREVIEW_COUNT, COMPOSEABLE )
+ ,DEF_INFO_2( MASTERFIELDS, MASTERFIELDS, MASTERFIELDS, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_2( DETAILFIELDS, DETAILFIELDS, DETAILFIELDS, COMPOSEABLE,DATA_PROPERTY)
+ ,DEF_INFO_1( AREA, AREA, AREA, COMPOSEABLE )
+ ,DEF_INFO_2( MIMETYPE, MIMETYPE, MIMETYPE, COMPOSEABLE,DATA_PROPERTY )
+ ,DEF_INFO_1( PARAADJUST, PARAADJUST, PARAADJUST, COMPOSEABLE )
+ ,DEF_INFO_1( VERTICALALIGN, VERTICALALIGN, VERTICALALIGN, 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::getPropertyTranslation(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->sTranslation : String();
+ }
+
+ //------------------------------------------------------------------------
+ rtl::OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->sHelpId : rtl::OString();
+ }
+
+ //------------------------------------------------------------------------
+ sal_uInt32 OPropertyInfoService::getPropertyUIFlags(sal_Int32 _nId) const
+ {
+ const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
+ return (pInfo) ? pInfo->nUIFlags : 0;
+ }
+
+ //------------------------------------------------------------------------
+ const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(const String& _rName)
+ {
+ // intialisierung
+ if(!s_pPropertyInfos)
+ getPropertyInfo();
+ OPropertyInfoImpl aSearch(_rName, 0L, String(), 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();
+ static const ::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")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")), // comment this out if you want to have title feature for charts
+ PROPERTY_MAXTEXTLEN,
+ PROPERTY_EFFECTIVEDEFAULT,
+ PROPERTY_EFFECTIVEMAX,
+ PROPERTY_EFFECTIVEMIN,
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HideInactiveSelection")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SubmitAction")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputRequired")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VerticalAlign")),
+ PROPERTY_ALIGN,
+ PROPERTY_EMPTY_IS_NULL,
+ PROPERTY_FILTERPROPOSAL
+ ,PROPERTY_POSITIONX
+ ,PROPERTY_POSITIONY
+ ,PROPERTY_WIDTH
+ ,PROPERTY_HEIGHT
+ ,PROPERTY_FONT
+ ,PROPERTY_LABEL
+ ,PROPERTY_LINECOLOR
+ ,PROPERTY_BORDER
+ ,PROPERTY_BORDERCOLOR
+ ,PROPERTY_BACKTRANSPARENT
+ ,PROPERTY_CONTROLBACKGROUND
+ ,PROPERTY_BACKGROUNDCOLOR
+ ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT
+ ,PROPERTY_FORMULALIST
+ ,PROPERTY_SCOPE
+ ,PROPERTY_TYPE
+ ,PROPERTY_DATASOURCENAME
+ ,PROPERTY_VERTICALALIGN
+ };
+
+ 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..2a53a5937095
--- /dev/null
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ColorListener.hxx"
+#include <svl/smplhint.hxx>
+#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).getColor();
+ 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).getColor();
+ 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;
+ Invalidate();
+}
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx
new file mode 100644
index 000000000000..791251e0424a
--- /dev/null
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -0,0 +1,257 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#include "precompiled_reportdesign.hxx"
+#include "FunctionHelper.hxx"
+#include <tools/debug.hxx>
+
+// =============================================================================
+namespace rptui
+{
+// =============================================================================
+ using namespace ::com::sun::star;
+
+FunctionManager::FunctionManager(const uno::Reference< report::meta::XFunctionManager>& _xMgr)
+: m_xMgr(_xMgr)
+{
+}
+FunctionManager::~FunctionManager()
+{
+}
+sal_Unicode FunctionManager::getSingleToken(const formula::IFunctionManager::EToken _eToken) const
+{
+ switch(_eToken)
+ {
+ case eOk:
+ return sal_Unicode('(');
+ case eClose:
+ return sal_Unicode(')');
+ case eSep:
+ return sal_Unicode(';');
+ case eArrayOpen:
+ return sal_Unicode('{');
+ case eArrayClose:
+ return sal_Unicode('}');
+ } // switch(_eToken)
+ return 0;
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 FunctionManager::getCount() const
+{
+ return m_xMgr->getCount();
+}
+// -----------------------------------------------------------------------------
+const formula::IFunctionCategory* FunctionManager::getCategory(sal_uInt32 _nPos) const
+{
+ if ( _nPos >= m_aCategoryIndex.size() )
+ {
+ uno::Reference< report::meta::XFunctionCategory> xCategory = m_xMgr->getCategory(_nPos);
+ ::boost::shared_ptr< FunctionCategory > pCategory(new FunctionCategory(this,_nPos + 1,xCategory));
+ m_aCategoryIndex.push_back( m_aCategories.insert(TCategoriesMap::value_type(xCategory->getName(),pCategory)).first );
+ }
+ return m_aCategoryIndex[_nPos]->second.get();
+}
+// -----------------------------------------------------------------------------
+const formula::IFunctionDescription* FunctionManager::getFunctionByName(const ::rtl::OUString& _sFunctionName) const
+{
+ const formula::IFunctionDescription* pDesc = NULL;
+ try
+ {
+ pDesc = get(m_xMgr->getFunctionByName(_sFunctionName)).get();
+ }
+ catch(uno::Exception&)
+ {
+ }
+ return pDesc;
+}
+// -----------------------------------------------------------------------------
+void FunctionManager::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& /*_rLastRUFunctions*/) const
+{
+ //const sal_uInt32 nCount = getCount();
+ //for(sal_uInt32 i = 0 ; i < nCount ; ++i)
+ //{
+ // const formula::IFunctionCategory* pCategory = getCategory(
+ //}
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr< FunctionDescription > FunctionManager::get(const uno::Reference< report::meta::XFunctionDescription>& _xFunctionDescription) const
+{
+ ::boost::shared_ptr< FunctionDescription > pDesc;
+ if ( _xFunctionDescription.is() )
+ {
+ const ::rtl::OUString sFunctionName = _xFunctionDescription->getName();
+ TFunctionsMap::const_iterator aFunctionFind = m_aFunctions.find(sFunctionName);
+ if ( aFunctionFind == m_aFunctions.end() )
+ {
+ const uno::Reference< report::meta::XFunctionCategory> xCategory = _xFunctionDescription->getCategory();
+ const ::rtl::OUString sCategoryName = xCategory->getName();
+ TCategoriesMap::iterator aCategoryFind = m_aCategories.find(sCategoryName);
+ if ( aCategoryFind == m_aCategories.end() )
+ {
+ aCategoryFind = m_aCategories.insert(TCategoriesMap::value_type(sCategoryName,::boost::shared_ptr< FunctionCategory > (new FunctionCategory(this,xCategory->getNumber() + 1,xCategory)))).first;
+ m_aCategoryIndex.push_back( aCategoryFind );
+ }
+ aFunctionFind = m_aFunctions.insert(TFunctionsMap::value_type(sFunctionName,::boost::shared_ptr<FunctionDescription>(new FunctionDescription(aCategoryFind->second.get(),_xFunctionDescription)))).first;
+ } // if ( aFind == m_aFunctions.end() )
+ pDesc = aFunctionFind->second;
+ } // if ( _xFunctionDescription.is() )
+ return pDesc;
+}
+// -----------------------------------------------------------------------------
+FunctionCategory::FunctionCategory(const FunctionManager* _pFMgr,sal_uInt32 _nPos,const uno::Reference< report::meta::XFunctionCategory>& _xCategory)
+: m_xCategory(_xCategory)
+,m_nFunctionCount(_xCategory->getCount())
+, m_nNumber(_nPos)
+,m_pFunctionManager(_pFMgr)
+{
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 FunctionCategory::getCount() const
+{
+ return m_nFunctionCount;
+}
+// -----------------------------------------------------------------------------
+const formula::IFunctionDescription* FunctionCategory::getFunction(sal_uInt32 _nPos) const
+{
+ if ( _nPos >= m_aFunctions.size() && _nPos < m_nFunctionCount )
+ {
+ uno::Reference< report::meta::XFunctionDescription> xFunctionDescription = m_xCategory->getFunction(_nPos);
+ ::boost::shared_ptr< FunctionDescription > pFunction = m_pFunctionManager->get(xFunctionDescription);
+ m_aFunctions.push_back( pFunction );
+ }
+ return m_aFunctions[_nPos].get();
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 FunctionCategory::getNumber() const
+{
+ return m_nNumber;
+}
+// -----------------------------------------------------------------------------
+const formula::IFunctionManager* FunctionCategory::getFunctionManager() const
+{
+ return m_pFunctionManager;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionCategory::getName() const
+{
+ return m_xCategory->getName();
+}
+// -----------------------------------------------------------------------------
+FunctionDescription::FunctionDescription(const formula::IFunctionCategory* _pFunctionCategory,const uno::Reference< report::meta::XFunctionDescription>& _xFunctionDescription)
+: m_xFunctionDescription(_xFunctionDescription)
+, m_pFunctionCategory(_pFunctionCategory)
+{
+ m_aParameter = m_xFunctionDescription->getArguments();
+}
+::rtl::OUString FunctionDescription::getFunctionName() const
+{
+ return m_xFunctionDescription->getName();
+}
+// -----------------------------------------------------------------------------
+const formula::IFunctionCategory* FunctionDescription::getCategory() const
+{
+ return m_pFunctionCategory;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionDescription::getDescription() const
+{
+ return m_xFunctionDescription->getDescription();
+}
+// -----------------------------------------------------------------------------
+xub_StrLen FunctionDescription::getSuppressedArgumentCount() const
+{
+ return static_cast<xub_StrLen>(m_aParameter.getLength());
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionDescription::getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const
+{
+ ::rtl::OUString sFormula;
+ try
+ {
+ const ::rtl::OUString *pArguments = _aArguments.empty() ? 0 : &_aArguments[0];
+ sFormula = m_xFunctionDescription->createFormula(uno::Sequence< ::rtl::OUString >(pArguments, _aArguments.size()));
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_ERROR("Exception caught!");
+ }
+ return sFormula;
+}
+// -----------------------------------------------------------------------------
+void FunctionDescription::fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const
+{
+ const sal_Int32 nCount = m_aParameter.getLength();
+ for(USHORT i = 0;i < nCount; ++i)
+ {
+ _rArguments.push_back(i);
+ }
+}
+// -----------------------------------------------------------------------------
+void FunctionDescription::initArgumentInfo() const
+{
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionDescription::getSignature() const
+{
+ return m_xFunctionDescription->getSignature();
+}
+// -----------------------------------------------------------------------------
+rtl::OString FunctionDescription::getHelpId() const
+{
+ return rtl::OString();
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 FunctionDescription::getParameterCount() const
+{
+ return m_aParameter.getLength();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionDescription::getParameterName(sal_uInt32 _nPos) const
+{
+ if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) )
+ return m_aParameter[_nPos].Name;
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString FunctionDescription::getParameterDescription(sal_uInt32 _nPos) const
+{
+ if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) )
+ return m_aParameter[_nPos].Description;
+ return ::rtl::OUString();
+}
+// -----------------------------------------------------------------------------
+bool FunctionDescription::isParameterOptional(sal_uInt32 _nPos) const
+{
+ if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) )
+ return m_aParameter[_nPos].IsOptional;
+ return false;
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
new file mode 100644
index 000000000000..209017ed062e
--- /dev/null
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -0,0 +1,1084 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+
+#include <toolkit/helper/convert.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include "SectionView.hxx"
+#include "UITools.hxx"
+#include "Formula.hxx"
+#include "FunctionHelper.hxx"
+#include "reportformula.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <tools/string.hxx>
+
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <com/sun/star/lang/NullPointerException.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <svx/svdpool.hxx>
+
+#include <editeng/charscaleitem.hxx>
+#include <svx/algitem.hxx>
+#include <svx/svdpagv.hxx>
+#include <svx/xtable.hxx> // XColorTable
+#include <editeng/brshitem.hxx>
+#include <editeng/fontitem.hxx>
+#include <editeng/emphitem.hxx>
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/crsditem.hxx>
+#include <editeng/cntritem.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/escpitem.hxx>
+#include <editeng/prszitem.hxx>
+#include <editeng/wrlmitem.hxx>
+#include <editeng/cmapitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/blnkitem.hxx>
+#include <editeng/flstitem.hxx>
+#include <editeng/akrnitem.hxx>
+#include <editeng/colritem.hxx>
+#include <svx/drawitem.hxx>
+#include <editeng/twolinesitem.hxx>
+#include <editeng/charreliefitem.hxx>
+#include <editeng/charrotateitem.hxx>
+#include <editeng/charhiddenitem.hxx>
+#include <svx/xgrscit.hxx>
+#include <svx/svditer.hxx>
+#include <svx/xtable.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/svdview.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/unoprov.hxx>
+
+#include <unotools/pathoptions.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+
+#include <comphelper/propmultiplex.hxx>
+#include <comphelper/namedvaluecollection.hxx>
+
+#include <connectivity/dbexception.hxx>
+#include <connectivity/dbconversion.hxx>
+#include <connectivity/dbtools.hxx>
+
+#include <com/sun/star/report/XGroups.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/report/Function.hpp>
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#include <com/sun/star/sdb/SQLContext.hpp>
+#include <i18npool/mslangid.hxx>
+#include "dlgpage.hxx"
+#include <vcl/msgbox.hxx>
+#include "rptui_slotid.hrc"
+#include "uistrings.hrc"
+#include "RptObject.hxx"
+#include "ModuleHelper.hxx"
+#include "RptDef.hxx"
+#include "RptResId.hrc"
+#include "ReportDefinition.hxx"
+#include "RptModel.hxx"
+
+#define ITEMID_FONT 10
+#define ITEMID_FONTHEIGHT 11
+#define ITEMID_LANGUAGE 12
+
+#define ITEMID_POSTURE 13
+#define ITEMID_WEIGHT 14
+#define ITEMID_SHADOWED 15
+#define ITEMID_WORDLINEMODE 16
+#define ITEMID_CONTOUR 17
+#define ITEMID_CROSSEDOUT 18
+#define ITEMID_UNDERLINE 19
+
+#define ITEMID_COLOR 20
+#define ITEMID_KERNING 21
+#define ITEMID_CASEMAP 22
+
+#define ITEMID_ESCAPEMENT 23
+#define ITEMID_FONTLIST 24
+#define ITEMID_AUTOKERN 25
+#define ITEMID_COLOR_TABLE 26
+#define ITEMID_BLINK 27
+#define ITEMID_EMPHASISMARK 28
+#define ITEMID_TWOLINES 29
+#define ITEMID_CHARROTATE 30
+#define ITEMID_CHARSCALE_W 31
+#define ITEMID_CHARRELIEF 32
+#define ITEMID_CHARHIDDEN 33
+#define ITEMID_BRUSH 34
+#define ITEMID_HORJUSTIFY 35
+#define ITEMID_VERJUSTIFY 36
+#define ITEMID_FONT_ASIAN 37
+#define ITEMID_FONTHEIGHT_ASIAN 38
+#define ITEMID_LANGUAGE_ASIAN 39
+#define ITEMID_POSTURE_ASIAN 40
+#define ITEMID_WEIGHT_ASIAN 41
+#define ITEMID_FONT_COMPLEX 42
+#define ITEMID_FONTHEIGHT_COMPLEX 43
+#define ITEMID_LANGUAGE_COMPLEX 44
+#define ITEMID_POSTURE_COMPLEX 45
+#define ITEMID_WEIGHT_COMPLEX 46
+
+#define WESTERN 0
+#define ASIAN 1
+#define COMPLEX 2
+
+namespace rptui
+{
+using namespace ::com::sun::star;
+using namespace formula;
+// -----------------------------------------------------------------------------
+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);
+ pRet->addProperty(PROPERTY_BACKCOLOR);
+ }
+ }
+ return pRet;
+}
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ // -------------------------------------------------------------------------
+ Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont ,USHORT _nWichFont)
+ {
+ if ( !_rxReportControlFormat.is() )
+ throw uno::RuntimeException();
+
+ switch(_nWichFont)
+ {
+ case WESTERN:
+ _out_rControlFont = _rxReportControlFormat->getFontDescriptor();
+ break;
+ case ASIAN:
+ _out_rControlFont = _rxReportControlFormat->getFontDescriptorAsian();
+ break;
+ case COMPLEX:
+ _out_rControlFont = _rxReportControlFormat->getFontDescriptorComplex();
+ break;
+
+ }
+
+ Font aDefaultFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont();
+ return VCLUnoHelper::CreateFont( _out_rControlFont, aDefaultFont );
+ }
+
+ // -------------------------------------------------------------------------
+ Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,USHORT _nWhich )
+ {
+ awt::FontDescriptor aAwtFont;
+ return lcl_getReportControlFont( _rxReportControlFormat, aAwtFont, _nWhich );
+ }
+ // -------------------------------------------------------------------------
+ const Font lcl_setFont(const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ SfxItemSet& _rItemSet,USHORT _nWhich,USHORT _nFont, USHORT _nFontHeight,USHORT _nLanguage,USHORT _nPosture, USHORT _nWeight)
+ {
+ // fill it
+ awt::FontDescriptor aControlFont;
+ const Font aFont( lcl_getReportControlFont( _rxReportControlFormat, aControlFont,_nWhich ) );
+
+ SvxFontItem aFontItem(_nFont);
+ aFontItem.PutValue( uno::makeAny( aControlFont ) );
+ _rItemSet.Put(aFontItem);
+
+ _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetHeight()), MAP_POINT, MAP_TWIP).Height(),100,_nFontHeight));
+ lang::Locale aLocale;
+ switch(_nWhich)
+ {
+ default:
+ aLocale = _rxReportControlFormat->getCharLocale();
+ break;
+ case ASIAN:
+ aLocale = _rxReportControlFormat->getCharLocaleAsian();
+ break;
+ case COMPLEX:
+ aLocale = _rxReportControlFormat->getCharLocaleComplex();
+ break;
+ } // switch(_nWhich)
+
+ _rItemSet.Put(SvxLanguageItem(MsLangId::convertLocaleToLanguageWithFallback(aLocale),_nLanguage));
+
+ _rItemSet.Put(SvxPostureItem(aFont.GetItalic(),_nPosture));
+ _rItemSet.Put(SvxWeightItem(aFont.GetWeight(),_nWeight));
+ return aFont;
+ }
+
+ void lcl_fillShapeToItems( const uno::Reference<report::XShape >& _xShape,SfxItemSet& _rItemSet )
+ {
+ uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
+ SvxUnoPropertyMapProvider aMap;
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
+ PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
+ while( aIt != aPropVector.end() )
+ {
+ if ( xInfo->hasPropertyByName(aIt->sName) )
+ {
+ const SfxPoolItem* pItem = _rItemSet.GetItem(aIt->nWID);
+ if ( pItem )
+ {
+ ::std::auto_ptr<SfxPoolItem> pClone(pItem->Clone());
+ pClone->PutValue(_xShape->getPropertyValue(aIt->sName), aIt->nMemberId);
+ _rItemSet.Put(*pClone, aIt->nWID);
+ }
+ } // if ( xInfo->hasPropertyByName(sPropertyName) )
+ ++aIt;
+ }
+ }
+
+ void lcl_fillItemsToShape( const uno::Reference<report::XShape >& _xShape,const SfxItemSet& _rItemSet )
+ {
+ const uno::Reference< beans::XPropertySetInfo> xInfo = _xShape->getPropertySetInfo();
+ SvxUnoPropertyMapProvider aMap;
+ const SfxItemPropertyMap* pPropertyMap = aMap.GetPropertySet(SVXMAP_CUSTOMSHAPE, SdrObject::GetGlobalDrawObjectItemPool())->getPropertyMap();
+ PropertyEntryVector_t aPropVector = pPropertyMap->getPropertyEntries();
+ PropertyEntryVector_t::const_iterator aIt = aPropVector.begin();
+ while( aIt != aPropVector.end() )
+ {
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState(aIt->nWID) && xInfo->hasPropertyByName(aIt->sName) )
+ {
+ const beans::Property aProp = xInfo->getPropertyByName( aIt->sName );
+ if ( ( aIt->nFlags & beans::PropertyAttribute::READONLY ) != beans::PropertyAttribute::READONLY )
+ {
+ const SfxPoolItem* pItem = _rItemSet.GetItem(aIt->nWID);
+ if ( pItem )
+ {
+ uno::Any aValue;
+ pItem->QueryValue(aValue,aIt->nMemberId);
+ try
+ {
+ _xShape->setPropertyValue(aIt->sName, aValue);
+ }
+ catch(uno::Exception&)
+ { // shapes have a bug so we ignore this one.
+ }
+ } // if ( pItem )
+ }
+ }
+ ++aIt;
+ } // while ( pPropertyMap->pName )
+ }
+ // -------------------------------------------------------------------------
+ void lcl_CharPropertiesToItems( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
+ SfxItemSet& _rItemSet )
+ {
+ if ( !_rxReportControlFormat.is() )
+ throw lang::NullPointerException();
+
+ uno::Reference< beans::XPropertySet > xSet(_rxReportControlFormat,uno::UNO_QUERY_THROW);
+
+ // fill it
+ const Font aFont( lcl_setFont(_rxReportControlFormat, _rItemSet,WESTERN,ITEMID_FONT,ITEMID_FONTHEIGHT,ITEMID_LANGUAGE,ITEMID_POSTURE,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(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(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));
+
+ SvxHorJustifyItem aHorJustifyItem(ITEMID_HORJUSTIFY);
+ aHorJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_PARAADJUST),MID_HORJUST_ADJUST);
+ _rItemSet.Put(aHorJustifyItem);
+ //_rItemSet.Put(SfxInt32Item(ITEMID_DEGREES,_rxReportControlFormat->getCharRotation()));
+ SvxVerJustifyItem aVerJustifyItem(ITEMID_VERJUSTIFY);
+ aVerJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_VERTICALALIGN),MID_HORJUST_ADJUST);
+ _rItemSet.Put(aVerJustifyItem);
+ //_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));
+
+ lcl_setFont(_rxReportControlFormat, _rItemSet,ASIAN,ITEMID_FONT_ASIAN,ITEMID_FONTHEIGHT_ASIAN,ITEMID_LANGUAGE_ASIAN,ITEMID_POSTURE_ASIAN,ITEMID_WEIGHT_ASIAN );
+ lcl_setFont(_rxReportControlFormat, _rItemSet,COMPLEX,ITEMID_FONT_COMPLEX,ITEMID_FONTHEIGHT_COMPLEX,ITEMID_LANGUAGE_COMPLEX,ITEMID_POSTURE_COMPLEX,ITEMID_WEIGHT_COMPLEX );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_pushBack( uno::Sequence< beans::NamedValue >& _out_rProperties, const ::rtl::OUString& _sName, const uno::Any& _rValue )
+ {
+ sal_Int32 nLen( _out_rProperties.getLength() );
+ _out_rProperties.realloc( nLen + 1 );
+ _out_rProperties[ nLen ] = beans::NamedValue( _sName, _rValue );
+ }
+
+ // -------------------------------------------------------------------------
+ void lcl_initAwtFont( const Font& _rOriginalFont, const SfxItemSet& _rItemSet, awt::FontDescriptor& _out_rAwtFont,
+ USHORT _nFont, USHORT _nFontHeight,USHORT _nPosture, USHORT _nWeight)
+ {
+ Font aNewFont( _rOriginalFont );
+ const SfxPoolItem* pItem( NULL );
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFont,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_FONT,sal_True,&pItem) && pItem->ISA(SvxFontItem))
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFontHeight,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( _nPosture,sal_True,&pItem) && pItem->ISA(SvxPostureItem))
+ {
+ const SvxPostureItem* pFontItem = static_cast<const SvxPostureItem*>(pItem);
+ aNewFont.SetItalic(pFontItem->GetPosture());
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nWeight,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_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->GetLineStyle());
+ }
+ 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 Font& _rOriginalControlFontAsian,const Font& _rOriginalControlFontComplex, 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,ITEMID_FONT,ITEMID_FONTHEIGHT,ITEMID_POSTURE, ITEMID_WEIGHT);
+ lcl_pushBack( _out_rProperties, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Font")), uno::makeAny( aAwtFont ) );
+ lcl_initAwtFont( _rOriginalControlFontAsian, _rItemSet, aAwtFont,ITEMID_FONT_ASIAN,ITEMID_FONTHEIGHT_ASIAN,ITEMID_POSTURE_ASIAN, ITEMID_WEIGHT_ASIAN);
+ lcl_pushBack( _out_rProperties, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FontAsian")), uno::makeAny( aAwtFont ) );
+ lcl_initAwtFont( _rOriginalControlFontComplex, _rItemSet, aAwtFont,ITEMID_FONT_COMPLEX,ITEMID_FONTHEIGHT_COMPLEX,ITEMID_POSTURE_COMPLEX, ITEMID_WEIGHT_COMPLEX);
+ lcl_pushBack( _out_rProperties, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FontComplex")), 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, PROPERTY_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, PROPERTY_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, PROPERTY_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);
+ uno::Any aValue;
+ pJustifyItem->QueryValue(aValue,MID_HORJUST_ADJUST);
+ lcl_pushBack( _out_rProperties, PROPERTY_PARAADJUST, aValue );
+ }
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_VERJUSTIFY,sal_True,&pItem) && pItem->ISA(SvxVerJustifyItem))
+ {
+ const SvxVerJustifyItem* pJustifyItem = static_cast<const SvxVerJustifyItem*>(pItem);
+ uno::Any aValue;
+ pJustifyItem->QueryValue(aValue,MID_HORJUST_ADJUST);
+ lcl_pushBack( _out_rProperties, PROPERTY_VERTICALALIGN, aValue );
+ }
+ 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, PROPERTY_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, PROPERTY_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, PROPERTY_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, PROPERTY_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, PROPERTY_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, PROPERTY_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, PROPERTY_CHARCOMBINEISON, uno::makeAny( pFontItem->GetValue() ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_CHARCOMBINEPREFIX, uno::makeAny( ::rtl::OUString( pFontItem->GetStartBracket() ) ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_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, PROPERTY_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, PROPERTY_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, PROPERTY_CHARCASEMAP, uno::makeAny( pFontItem->GetValue() ) );
+ } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem))
+ struct Items {
+ USHORT nWhich;
+ ::rtl::OUString sPropertyName;
+ };
+ const Items pItems[] = { {ITEMID_LANGUAGE,PROPERTY_CHARLOCALE}
+ ,{ITEMID_LANGUAGE_ASIAN,PROPERTY_CHARLOCALEASIAN}
+ ,{ITEMID_LANGUAGE_COMPLEX,PROPERTY_CHARLOCALECOMPLEX}
+ };
+ for(size_t k = 0; k < sizeof(pItems)/sizeof(pItems[0]);++k)
+ {
+ if ( SFX_ITEM_SET == _rItemSet.GetItemState( pItems[k].nWhich,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, pItems[k].sPropertyName, uno::makeAny( aCharLocale ) );
+ } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_LANGUAGE,sal_True,&pItem) && pItem->ISA(SvxLanguageItem))
+ }
+ 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, PROPERTY_CHARESCAPEMENT, uno::makeAny( pFontItem->GetEsc() ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_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_FONTHEIGHT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_LANGUAGE, 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_COLOR, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_KERNING, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CASEMAP, 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_SCALEWIDTH, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE },
+ //{ SID_ATTR_BRUSH_CHAR, SFX_ITEM_POOLABLE },
+ { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE },
+ { SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE },
+ { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE },
+
+ // Asian
+ { SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE },
+ // Complex
+ { SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE },
+ { SID_ATTR_CHAR_CTL_WEIGHT, 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 SvxFontHeightItem(240,100,ITEMID_FONTHEIGHT),
+ new SvxLanguageItem(LANGUAGE_GERMAN,ITEMID_LANGUAGE),
+ 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 SvxColorItem(ITEMID_COLOR),
+ new SvxKerningItem(0,ITEMID_KERNING),
+ new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED,ITEMID_CASEMAP),
+ 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 SvxCharScaleWidthItem(100,ITEMID_CHARSCALE_W),
+ new SvxCharReliefItem(RELIEF_NONE,ITEMID_CHARRELIEF),
+ new SvxCharHiddenItem(FALSE,ITEMID_CHARHIDDEN),
+ new SvxBrushItem(ITEMID_BRUSH),
+ new SvxHorJustifyItem(ITEMID_HORJUSTIFY),
+ new SvxVerJustifyItem(ITEMID_VERJUSTIFY),
+// Asian
+ new SvxFontItem(ITEMID_FONT_ASIAN),
+ new SvxFontHeightItem(240,100,ITEMID_FONTHEIGHT_ASIAN),
+ new SvxLanguageItem(LANGUAGE_GERMAN,ITEMID_LANGUAGE_ASIAN),
+ new SvxPostureItem(ITALIC_NONE,ITEMID_POSTURE_ASIAN),
+ new SvxWeightItem(WEIGHT_NORMAL,ITEMID_WEIGHT_ASIAN),
+// Complex
+ new SvxFontItem(ITEMID_FONT_COMPLEX),
+ new SvxFontHeightItem(240,100,ITEMID_FONTHEIGHT_COMPLEX),
+ new SvxLanguageItem(LANGUAGE_GERMAN,ITEMID_LANGUAGE_COMPLEX),
+ new SvxPostureItem(ITALIC_NONE,ITEMID_POSTURE_COMPLEX),
+ new SvxWeightItem(WEIGHT_NORMAL,ITEMID_WEIGHT_COMPLEX)
+
+ };
+
+ OSL_ASSERT((sizeof(pDefaults)/sizeof(pDefaults[0])) == (sizeof(aItemInfos)/sizeof(aItemInfos[0])));
+
+ static USHORT pRanges[] =
+ {
+ ITEMID_FONT,ITEMID_WEIGHT_COMPLEX,
+ 0
+ };
+
+ SfxItemPool* pPool( new SfxItemPool(String::CreateFromAscii("ReportCharProperties"), ITEMID_FONT,ITEMID_WEIGHT_COMPLEX, aItemInfos, pDefaults) );
+ // not needed for font height pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); // ripped, don't understand why
+ pPool->FreezeIdRanges(); // the same
+ bool bSuccess = false;
+ try
+ {
+ ::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,WESTERN ),
+ lcl_getReportControlFont( _rxReportControlFormat,ASIAN ),
+ lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg.GetOutputItemSet(), _out_rNewValues );
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ SfxItemPool::Free(pPool);
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+ delete pDefaults[i];
+
+ return bSuccess;
+}
+// -----------------------------------------------------------------------------
+bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::Reference< awt::XWindow>& _rxParentWindow )
+{
+ OSL_PRECOND( _xShape.is() && _rxParentWindow.is(), "openAreaDialog: invalid parameters!" );
+ if ( !_xShape.is() || !_rxParentWindow.is() )
+ return false;
+
+ ::boost::shared_ptr<rptui::OReportModel> pModel = ::reportdesign::OReportDefinition::getSdrModel(_xShape->getSection()->getReportDefinition());
+
+ Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow );
+
+ //static USHORT pRanges[] =
+ //{
+ // XATTR_START,XATTR_END,
+ // 0
+ //};
+
+ bool bSuccess = false;
+ try
+ {
+ SfxItemPool& rItemPool = pModel->GetItemPool();
+ ::std::auto_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, rItemPool.GetFirstWhich(),rItemPool.GetLastWhich() ) );
+
+ lcl_fillShapeToItems(_xShape,*pDescriptor);
+
+ { // want the dialog to be destroyed before our set
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ ::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get() ));
+ // #i74099# by default, the dialog deletes the current color table if a different one is loaded
+ // (see SwDrawShell::ExecDrawDlg)
+ const SvxColorTableItem* pColorItem = static_cast<const SvxColorTableItem*>( pDescriptor->GetItem(SID_COLOR_TABLE) );
+ if (pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+ pDialog->DontDeleteColorTable();
+ bSuccess = ( RET_OK == pDialog->Execute() );
+ if ( bSuccess )
+ {
+ lcl_fillItemsToShape(_xShape,*pDialog->GetOutputItemSet());
+ }
+ }
+
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ 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 );
+ } // if ( aSettings.get( "Font" ) >>= aAwtFont )
+ if ( aSettings.get( "FontAsian" ) >>= aAwtFont )
+ {
+ ::rtl::OUString sTemp = aAwtFont.Name;
+ aAwtFont.Name = ::rtl::OUString(); // hack to
+ _rxReportControlFormat->setFontDescriptorAsian( aAwtFont );
+ _rxReportControlFormat->setCharFontNameAsian( sTemp );
+ } // if ( aSettings.get( "Font" ) >>= aAwtFont )
+ if ( aSettings.get( "FontComplex" ) >>= aAwtFont )
+ {
+ ::rtl::OUString sTemp = aAwtFont.Name;
+ aAwtFont.Name = ::rtl::OUString(); // hack to
+ _rxReportControlFormat->setFontDescriptorComplex( aAwtFont );
+ _rxReportControlFormat->setCharFontNameComplex( sTemp );
+ }
+
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARSHADOWED, _rxReportControlFormat, &report::XReportControlFormat::setCharShadowed );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCONTOURED, _rxReportControlFormat, &report::XReportControlFormat::setCharContoured );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARUNDERLINECOLOR, _rxReportControlFormat, &report::XReportControlFormat::setCharUnderlineColor );
+ lcl_applyFontAttribute( aSettings, PROPERTY_PARAADJUST, _rxReportControlFormat, &report::XReportControlFormat::setParaAdjust );
+ lcl_applyFontAttribute( aSettings, PROPERTY_VERTICALALIGN, _rxReportControlFormat, &report::XReportControlFormat::setVerticalAlign );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARRELIEF, _rxReportControlFormat, &report::XReportControlFormat::setCharRelief );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARHIDDEN, _rxReportControlFormat, &report::XReportControlFormat::setCharHidden );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARAUTOKERNING, _rxReportControlFormat, &report::XReportControlFormat::setCharAutoKerning );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CONTROLBACKGROUND, _rxReportControlFormat, &report::XReportControlFormat::setControlBackground );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARFLASH, _rxReportControlFormat, &report::XReportControlFormat::setCharFlash );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHAREMPHASIS, _rxReportControlFormat, &report::XReportControlFormat::setCharEmphasis );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCOMBINEISON, _rxReportControlFormat, &report::XReportControlFormat::setCharCombineIsOn );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCOMBINEPREFIX, _rxReportControlFormat, &report::XReportControlFormat::setCharCombinePrefix );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCOMBINESUFFIX, _rxReportControlFormat, &report::XReportControlFormat::setCharCombineSuffix );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCOLOR, _rxReportControlFormat, &report::XReportControlFormat::setCharColor );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARKERNING, _rxReportControlFormat, &report::XReportControlFormat::setCharKerning );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARCASEMAP, _rxReportControlFormat, &report::XReportControlFormat::setCharCaseMap );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARLOCALE, _rxReportControlFormat, &report::XReportControlFormat::setCharLocale );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARESCAPEMENT, _rxReportControlFormat, &report::XReportControlFormat::setCharEscapement );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARESCAPEMENTHEIGHT, _rxReportControlFormat, &report::XReportControlFormat::setCharEscapementHeight );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARLOCALEASIAN, _rxReportControlFormat, &report::XReportControlFormat::setCharLocaleAsian );
+ lcl_applyFontAttribute( aSettings, PROPERTY_CHARLOCALECOMPLEX, _rxReportControlFormat, &report::XReportControlFormat::setCharLocaleComplex );
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+// -----------------------------------------------------------------------------
+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, sal_Int16 _nIgnoreType)
+{
+ 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 )
+ {
+ if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
+ {
+ continue;
+ }
+
+ OUnoObject* pObj = dynamic_cast<OUnoObject*>(pObjIter);
+ if (pObj != NULL)
+ {
+
+ Rectangle aRect = _rRect.GetIntersection(pObjIter->GetLastBoundRect());
+ if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) )
+ pOverlappedObj = pObjIter;
+ }
+ }
+ }
+ return pOverlappedObj;
+}
+// -----------------------------------------------------------------------------
+bool checkArrayForOccurance(SdrObject* _pObjToCheck, SdrUnoObj* _pIgnore[], int _nListLength)
+{
+ for(int i=0;i<_nListLength;i++)
+ {
+ SdrObject *pIgnore = _pIgnore[i];
+ if (pIgnore == _pObjToCheck)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _bAllObjects, SdrUnoObj * _pIgnoreList[], int _nIgnoreListLength)
+{
+ SdrObject* pOverlappedObj = NULL;
+ SdrObjListIter aIter(_rPage,IM_DEEPNOGROUPS);
+ SdrObject* pObjIter = NULL;
+
+ while( !pOverlappedObj && (pObjIter = aIter.Next()) != NULL )
+ {
+ if (checkArrayForOccurance(pObjIter, _pIgnoreList, _nIgnoreListLength))
+ {
+ continue;
+ }
+
+ if ( (_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;
+}
+// -----------------------------------------------------------------------------
+Rectangle getRectangleFromControl(SdrObject* _pControl)
+{
+ if (_pControl)
+ {
+ uno::Reference< report::XReportComponent > xComponent( _pControl->getUnoShape(), uno::UNO_QUERY);
+ if (xComponent.is())
+ {
+ Rectangle aRect(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize()));
+ aRect.setHeight(aRect.getHeight() + 1);
+ aRect.setWidth(aRect.getWidth() + 1);
+ return aRect;
+ }
+ }
+ return Rectangle();
+}
+// -----------------------------------------------------------------------------
+// check overlapping
+void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,bool _bInsert)
+{
+ OSectionView& rSectionView = _aReportSection.getSectionView();
+ 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);
+ Rectangle aRect = getRectangleFromControl(_pControl);
+
+ bool bOverlapping = true;
+ while ( bOverlapping )
+ {
+ SdrObject* pOverlappedObj = isOver(aRect,*_aReportSection.getPage(),rSectionView,true, _pControl);
+ bOverlapping = pOverlappedObj != NULL;
+ if ( bOverlapping )
+ {
+ const Rectangle& aLogicRect = pOverlappedObj->GetLogicRect();
+ aRect.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aRect.Top());
+ xComponent->setPositionY(aRect.Top());
+ }
+ }
+ if ( !bOverlapping && _bInsert ) // now insert objects
+ rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK);
+}
+// -----------------------------------------------------------------------------
+void setZoomFactor(const Fraction& _aZoom,Window& _rWindow)
+{
+ MapMode aMapMode( _rWindow.GetMapMode() );
+ aMapMode.SetScaleX(_aZoom);
+ aMapMode.SetScaleY(_aZoom);
+ _rWindow.SetMapMode(aMapMode);
+}
+// -----------------------------------------------------------------------------
+bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula
+ , const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext
+ , const uno::Reference< awt::XWindow>& _xInspectorWindow
+ , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
+ )
+{
+ OSL_PRECOND( _xInspectorWindow.is(), "openDialogFormula_nothrow: invalid parameters!" );
+ if ( !_xInspectorWindow.is() )
+ return false;
+ // _out_rFormula = ::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 = _xContext->getServiceManager();
+ xServiceFactory.set(xFactory,uno::UNO_QUERY);
+ Window* pParent = VCLUnoHelper::GetWindow( _xInspectorWindow );
+
+ uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.pentaho.SOFunctionManager")),_xContext),uno::UNO_QUERY);
+ if ( xMgr.is() )
+ {
+ ::boost::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) );
+ ReportFormula aFormula( _in_out_rFormula );
+ FormulaDialog aDlg(pParent,xServiceFactory,pFormulaManager,aFormula.getUndecoratedContent(),_xRowSet);
+ bSuccess = aDlg.Execute() == RET_OK;
+ if ( bSuccess )
+ {
+ String sFormula = aDlg.getCurrentFormula();
+ xub_StrLen nIndex = 0;
+ if ( sFormula.GetChar(0) == '=' )
+ nIndex = 1;
+ _in_out_rFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFormula.Copy(nIndex);
+ }
+ }
+ }
+ 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;
+}
+// -----------------------------------------------------------------------------
+} // namespace rptui
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/Undo.cxx
new file mode 100644
index 000000000000..d944dc2aee20
--- /dev/null
+++ b/reportdesign/source/ui/misc/Undo.cxx
@@ -0,0 +1,416 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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
+#include <dbaccess/IController.hxx>
+#include <com/sun/star/report/XSection.hpp>
+#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 );
+DBG_NAME(rpt_OSectionUndo)
+//----------------------------------------------------------------------------
+OSectionUndo::OSectionUndo(OReportModel& _rMod
+ ,sal_uInt16 _nSlot
+ ,Action _eAction
+ ,USHORT nCommentID)
+: OCommentUndoAction(_rMod,nCommentID)
+,m_eAction(_eAction)
+,m_nSlot(_nSlot)
+,m_bInserted(false)
+{
+ DBG_CTOR(rpt_OSectionUndo,NULL);
+}
+// -----------------------------------------------------------------------------
+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!");
+ }
+ }
+ }
+ DBG_DTOR(rpt_OSectionUndo,NULL);
+}
+// -----------------------------------------------------------------------------
+void OSectionUndo::collectControls(const uno::Reference< report::XSection >& _xSection)
+{
+ 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()
+{
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReRemove();
+ break;
+
+ case Removed:
+ implReInsert();
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OSectionUndo::Undo: caught an exception!" );
+ }
+}
+//----------------------------------------------------------------------------
+void OSectionUndo::Redo()
+{
+ try
+ {
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReInsert();
+ break;
+
+ case Removed:
+ implReRemove();
+ break;
+ }
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "OSectionUndo::Redo: caught an exception!" );
+ }
+}
+//----------------------------------------------------------------------------
+TYPEINIT1( OReportSectionUndo, OSectionUndo );
+//----------------------------------------------------------------------------
+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( 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()
+{
+ switch ( m_eAction )
+ {
+ case Inserted:
+ implReRemove();
+ break;
+
+ case Removed:
+ implReInsert();
+ break;
+ }
+
+}
+//----------------------------------------------------------------------------
+void OGroupUndo::Redo()
+{
+ 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..b12bafdc7760
--- /dev/null
+++ b/reportdesign/source/ui/misc/makefile.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=uimisc
+
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+# .INCLUDE : $(PRJ)$/util$/dll.pmk
+
+# --- Files -------------------------------------
+
+# ... resource files ............................
+
+# ... object files ............................
+
+EXCEPTIONSFILES= \
+ $(SLO)$/Undo.obj \
+ $(SLO)$/ColorListener.obj \
+ $(SLO)$/UITools.obj \
+ $(SLO)$/rptuiservices.obj \
+ $(SLO)$/toolboxcontroller.obj \
+ $(SLO)$/statusbarcontroller.obj \
+ $(SLO)$/FunctionHelper.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..312abfbddd5f
--- /dev/null
+++ b/reportdesign/source/ui/misc/rptuiservices.cxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include <cppuhelper/factory.hxx>
+#include <osl/diagnose.h>
+#include <cppuhelper/implementationentry.hxx>
+#include "ReportController.hxx"
+#include "toolboxcontroller.hxx"
+#include "statusbarcontroller.hxx"
+#include "DefaultInspection.hxx"
+#include "ReportComponentHandler.hxx"
+#include "GeometryHandler.hxx"
+#include "DataProviderHandler.hxx"
+
+/********************************************************************************************/
+
+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 },
+ { &OStatusbarController::create, &OStatusbarController::getImplementationName_Static, &OStatusbarController::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 },
+ { &DataProviderHandler::create, &DataProviderHandler::getImplementationName_Static, &DataProviderHandler::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);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ char const ** envTypeName, uno_Environment **)
+{
+ *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx
new file mode 100644
index 000000000000..ce34ebadf775
--- /dev/null
+++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_reportdesign.hxx"
+#include "statusbarcontroller.hxx"
+
+#include <svx/zoomsliderctrl.hxx>
+#include <svx/zoomctrl.hxx>
+#include <svx/svxids.hrc>
+#include <svx/zoomitem.hxx>
+#include <svx/zoomslideritem.hxx>
+
+#include <vcl/svapp.hxx>
+#include <vcl/status.hxx>
+#include <vos/mutex.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+namespace rptui
+{
+ using namespace svt;
+ using namespace com::sun::star::uno;
+ using namespace com::sun::star::beans;
+ using namespace com::sun::star::lang;
+ using namespace ::com::sun::star::frame;
+ using namespace ::com::sun::star::util;
+
+::rtl::OUString SAL_CALL OStatusbarController::getImplementationName() throw( RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+//------------------------------------------------------------------------------
+::rtl::OUString OStatusbarController::getImplementationName_Static() throw( RuntimeException )
+{
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.comp.StatusbarController"));
+}
+//------------------------------------------------------------------------------
+Sequence< ::rtl::OUString> OStatusbarController::getSupportedServiceNames_Static(void) throw( RuntimeException )
+{
+ Sequence< ::rtl::OUString> aSupported(1);
+ aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StatusbarController"));
+ return aSupported;
+}
+// -----------------------------------------------------------------------------
+::sal_Bool SAL_CALL OStatusbarController::supportsService( const ::rtl::OUString& ServiceName ) throw (RuntimeException)
+{
+ return ::comphelper::existsValue(ServiceName,getSupportedServiceNames_Static());
+}
+//-------------------------------------------------------------------------
+Sequence< ::rtl::OUString> SAL_CALL OStatusbarController::getSupportedServiceNames() throw(RuntimeException)
+{
+ return getSupportedServiceNames_Static();
+}
+// -------------------------------------------------------------------------
+Reference< XInterface > OStatusbarController::create(Reference< XComponentContext > const & xContext)
+{
+ return *(new OStatusbarController(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY)));
+}
+IMPLEMENT_FORWARD_XINTERFACE2(OStatusbarController, ::svt::StatusbarController,OStatusbarController_BASE)
+
+OStatusbarController::OStatusbarController(const Reference< XMultiServiceFactory >& _rxORB)
+: m_nSlotId(0)
+,m_nId(1)
+{
+ m_xServiceManager = _rxORB;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException)
+{
+ StatusbarController::initialize(_rArguments);
+ vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ StatusBar* pStatusBar = static_cast<StatusBar*>(VCLUnoHelper::GetWindow(m_xParentWindow));
+ if ( pStatusBar )
+ {
+ const USHORT nCount = pStatusBar->GetItemCount();
+ for (USHORT nPos = 0; nPos < nCount; ++nPos)
+ {
+ const USHORT nItemId = pStatusBar->GetItemId(nPos);
+ if ( pStatusBar->GetItemCommand(nItemId) == String(m_aCommandURL) )
+ {
+ m_nId = nItemId;
+ break;
+ }
+ }
+ if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
+ {
+ m_pController = TStatusbarHelper::createFromQuery(new SvxZoomSliderControl(m_nSlotId = SID_ATTR_ZOOMSLIDER,m_nId,*pStatusBar));
+ } // if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
+ else if ( m_aCommandURL.equalsAscii(".uno:Zoom") )
+ {
+ m_pController = TStatusbarHelper::createFromQuery(new SvxZoomStatusBarControl(m_nSlotId = SID_ATTR_ZOOM,m_nId,*pStatusBar));
+ }
+
+ if ( m_pController.is() )
+ {
+ m_pController->initialize(_rArguments);
+ m_pController->update();
+ }
+
+ addStatusListener(m_aCommandURL);
+ update();
+ }
+}
+// XStatusListener
+void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEvent)throw ( RuntimeException )
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard(m_aMutex);
+
+ if ( m_pController.is() )
+ {
+ if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
+ {
+ Sequence< PropertyValue > aSeq;
+ if ( (_aEvent.State >>= aSeq) && aSeq.getLength() == 2 )
+ {
+ SvxZoomSliderItem aZoomSlider(100,20,400);
+ aZoomSlider.PutValue(_aEvent.State);
+ static_cast<SvxZoomSliderControl*>(m_pController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoomSlider);
+ }
+ } // if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") )
+ else if ( m_aCommandURL.equalsAscii(".uno:Zoom") )
+ {
+ Sequence< PropertyValue > aSeq;
+ if ( (_aEvent.State >>= aSeq) && aSeq.getLength() == 3 )
+ {
+ SvxZoomItem aZoom;
+ aZoom.PutValue(_aEvent.State);
+ static_cast<SvxZoomStatusBarControl*>(m_pController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoom);
+ }
+ }
+ }
+}
+
+// XStatusbarController
+::sal_Bool SAL_CALL OStatusbarController::mouseButtonDown(const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_pController.is() && m_pController.getRef()->mouseButtonDown(_aEvent);
+}
+
+::sal_Bool SAL_CALL OStatusbarController::mouseMove( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_pController.is() && m_pController.getRef()->mouseMove(_aEvent);
+}
+
+::sal_Bool SAL_CALL OStatusbarController::mouseButtonUp( const ::com::sun::star::awt::MouseEvent& _aEvent)throw (::com::sun::star::uno::RuntimeException)
+{
+ return m_pController.is() && m_pController.getRef()->mouseButtonUp(_aEvent);
+}
+
+void SAL_CALL OStatusbarController::command(
+ const ::com::sun::star::awt::Point& aPos,
+ ::sal_Int32 nCommand,
+ ::sal_Bool bMouseEvent,
+ const ::com::sun::star::uno::Any& aData )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pController.is() )
+ m_pController.getRef()->command( aPos, nCommand, bMouseEvent, aData );
+}
+
+void SAL_CALL OStatusbarController::paint(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
+ const ::com::sun::star::awt::Rectangle& rOutputRectangle,
+ ::sal_Int32 nItemId,
+ ::sal_Int32 nStyle )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pController.is() )
+ m_pController.getRef()->paint( xGraphics, rOutputRectangle, nItemId, nStyle );
+}
+
+void SAL_CALL OStatusbarController::click() throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pController.is() )
+ m_pController.getRef()->click();
+}
+
+void SAL_CALL OStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
+{
+ if ( m_pController.is() )
+ m_pController.getRef()->doubleClick();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OStatusbarController::update() throw ( RuntimeException )
+{
+ ::svt::StatusbarController::update();
+ Reference< XUpdatable > xUp(m_pController.getRef(),UNO_QUERY);
+ if ( xUp.is() )
+ xUp->update();
+}
+// -----------------------------------------------------------------------------
+// XComponent
+void SAL_CALL OStatusbarController::dispose() throw (::com::sun::star::uno::RuntimeException)
+{
+ Reference< XComponent > xComp( m_pController.getRef(), UNO_QUERY );
+ ::comphelper::disposeComponent(xComp);
+ m_pController.dispose();
+ svt::StatusbarController::dispose();
+}
+// =============================================================================
+} // rptui
+// =============================================================================
diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx
new file mode 100644
index 000000000000..cf5561ba4758
--- /dev/null
+++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx
@@ -0,0 +1,360 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "toolboxcontroller.hxx"
+#include <com/sun/star/ui/ImageType.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/menu.hxx>
+#include <com/sun/star/ui/XUIConfigurationManager.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
+#include <com/sun/star/ui/XImageManager.hpp>
+#include <com/sun/star/ui/ImageType.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/util/Color.hpp>
+#include <vcl/svapp.hxx>
+#include <vcl/toolbox.hxx>
+#include <svtools/miscopt.hxx>
+#include <unotools/moduleoptions.hxx>
+#include <svtools/menuoptions.hxx>
+#include <vos/mutex.hxx>
+#include <svx/svxids.hrc>
+#define ITEMID_COLOR 1
+#define ITEMID_BRUSH 2
+#define ITEMID_FONT 3
+#define ITEMID_FONTHEIGHT 4
+#include <editeng/fontitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <svx/tbcontrl.hxx>
+#include <editeng/colritem.hxx>
+#include <svx/tbxcustomshapes.hxx>
+
+#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)));
+}
+// -----------------------------------------------------------------------------
+DBG_NAME(rpt_OToolboxController)
+OToolboxController::OToolboxController(const Reference< XMultiServiceFactory >& _rxORB)
+ : m_pToolbarController(NULL)
+ ,m_nToolBoxId(1)
+ ,m_nSlotId(0)
+{
+ DBG_CTOR(rpt_OToolboxController,NULL);
+ osl_incrementInterlockedCount(&m_refCount);
+ m_xServiceManager = _rxORB;
+ osl_decrementInterlockedCount(&m_refCount);
+
+}
+// -----------------------------------------------------------------------------
+OToolboxController::~OToolboxController()
+{
+ DBG_DTOR(rpt_OToolboxController,NULL);
+}
+// -----------------------------------------------------------------------------
+// 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: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;
+ ::Color aGcc3WorkaroundTemporary( nColor);
+ SvxColorItem aColorItem(aGcc3WorkaroundTemporary,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_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_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..339e136c2fec
--- /dev/null
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -0,0 +1,787 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "DesignView.hxx"
+#include <tools/debug.hxx>
+#include "ReportController.hxx"
+#include <comphelper/types.hxx>
+#include <unotools/syslocale.hxx>
+#include <unotools/viewoptions.hxx>
+#include "RptDef.hxx"
+#include "UITools.hxx"
+#include "RptObject.hxx"
+#include "propbrw.hxx"
+#include <toolkit/helper/convert.hxx>
+#include "helpids.hrc"
+#include "SectionView.hxx"
+#include "ReportSection.hxx"
+#include "rptui_slotid.hrc"
+#include <svx/svxids.hrc>
+#include "AddField.hxx"
+#include "ScrollHelper.hxx"
+#include "Navigator.hxx"
+#include "SectionWindow.hxx"
+#include "RptResId.hrc"
+#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
+#define START_SIZE_TASKPANE 30
+#define COLSET_ID 1
+#define REPORT_ID 2
+#define TASKPANE_ID 3
+
+class OTaskWindow : public Window
+{
+ PropBrw* m_pPropWin;
+public:
+ OTaskWindow(Window* _pParent) : Window(_pParent),m_pPropWin(NULL){}
+
+ inline void setPropertyBrowser(PropBrw* _pPropWin)
+ {
+ m_pPropWin = _pPropWin;
+ }
+
+ virtual void Resize()
+ {
+ const Size aSize = GetOutputSizePixel();
+ if ( m_pPropWin && aSize.Height() && aSize.Width() )
+ m_pPropWin->SetSizePixel(aSize);
+ }
+ long getMinimumWidth() const
+ {
+ long nRet = 0;
+ if ( m_pPropWin )
+ nRet = m_pPropWin->getMinimumSize().Width();
+ return nRet;
+ }
+};
+class OwnSplitWindow : public SplitWindow
+{
+public:
+ OwnSplitWindow(Window* pParent) : SplitWindow(pParent,WB_DIALOGCONTROL){SetBackground( );}
+
+ virtual void Split()
+ {
+ SplitWindow::Split();
+ setItemSizes();
+ }
+ void setItemSizes()
+ {
+ const long nOutWidth = GetOutputSizePixel().Width();
+ long nTaskPaneMinSplitSize = static_cast<OTaskWindow*>(GetItemWindow(TASKPANE_ID))->getMinimumWidth();
+ nTaskPaneMinSplitSize = static_cast<long>(nTaskPaneMinSplitSize*100/nOutWidth);
+ if ( !nTaskPaneMinSplitSize )
+ nTaskPaneMinSplitSize = START_SIZE_TASKPANE;
+
+ const long nReportMinSplitSize = static_cast<long>(12000/nOutWidth);
+
+ long nReportSize = GetItemSize( REPORT_ID );
+ long nTaskPaneSize = GetItemSize( TASKPANE_ID );
+
+ BOOL bMod = FALSE;
+ if( nReportSize < nReportMinSplitSize )
+ {
+ nReportSize = nReportMinSplitSize;
+ nTaskPaneSize = 99 - nReportMinSplitSize;
+
+ bMod = TRUE;
+ }
+ else if( nTaskPaneSize < nTaskPaneMinSplitSize )
+ {
+ nTaskPaneSize = nTaskPaneMinSplitSize;
+ nReportSize = 99 - nTaskPaneMinSplitSize;
+
+ bMod = TRUE;
+ }
+
+ if( bMod )
+ {
+ SetItemSize( REPORT_ID, nReportSize );
+ SetItemSize( TASKPANE_ID, nTaskPaneSize );
+ }
+ }
+};
+//==================================================================
+// class ODesignView
+//==================================================================
+DBG_NAME( rpt_ODesignView )
+//------------------------------------------------------------------------------
+ODesignView::ODesignView( Window* pParent,
+ const Reference< XMultiServiceFactory >& _rxOrb,
+ OReportController& _rController) :
+ ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL )
+ ,m_aSplitWin(this)
+ ,m_rReportController( _rController )
+ ,m_aScrollWindow(this)
+ ,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_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid
+ ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation
+ ,m_bGridVisible(TRUE)
+ ,m_bGridSnap(TRUE)
+ ,m_bDeleted( FALSE )
+{
+ DBG_CTOR( rpt_ODesignView,NULL);
+ SetHelpId(UID_RPT_RPT_APP_VIEW);
+ ImplInitSettings();
+
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ // now create the task pane on the right side :-)
+ m_pTaskPane = new OTaskWindow(this);
+ //m_pTaskPane->Show();
+
+ m_aSplitWin.InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET );
+ m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100/*m_aScrollWindow.getMaxMarkerWidth(sal_False)*/, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE /*SWIB_COLSET*/);
+ //m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane, 50, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE );
+
+ // Splitter einrichten
+ //m_aSplitter.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
+ m_aSplitWin.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
+ m_aSplitWin.ShowAutoHideButton();
+ m_aSplitWin.SetAlign(WINDOWALIGN_LEFT);
+ m_aSplitWin.Show();
+
+ m_aMarkTimer.SetTimeout( 100 );
+ m_aMarkTimer.SetTimeoutHdl( LINK( this, ODesignView, MarkTimeout ) );
+}
+
+//------------------------------------------------------------------------------
+ODesignView::~ODesignView()
+{
+ DBG_DTOR( rpt_ODesignView,NULL);
+ m_bDeleted = TRUE;
+ Hide();
+ m_aScrollWindow.Hide();
+ 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 )
+ {
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( UID_RPT_RPT_APP_VIEW ) );
+ aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pAddField->GetWindowState(WINDOWSTATE_MASK_ALL).GetBuffer() ) );
+ notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ ::std::auto_ptr<Window> aTemp2(m_pAddField);
+ m_pAddField = NULL;
+ }
+ if ( m_pReportExplorer )
+ {
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) );
+ aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pReportExplorer->GetWindowState(WINDOWSTATE_MASK_ALL).GetBuffer() ) );
+ notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ ::std::auto_ptr<Window> aTemp2(m_pReportExplorer);
+ m_pReportExplorer = NULL;
+ }
+ {
+ ::std::auto_ptr<Window> aTemp2(m_pTaskPane);
+ m_pTaskPane = NULL;
+ }
+}
+// -----------------------------------------------------------------------------
+void ODesignView::initialize()
+{
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aScrollWindow.initialize();
+ m_aScrollWindow.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() )
+ {
+ const KeyCode& rCode = pKeyEvent->GetKeyCode();
+ util::URL aUrl;
+ aUrl.Complete = m_pAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rCode));
+ if ( !aUrl.Complete.getLength() || !m_rController.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_aSplitWin.IsItemValid(TASKPANE_ID) )
+ {
+ // normalize the split pos
+ const long nSplitterWidth = GetSettings().GetStyleSettings().GetSplitSize();
+ Point aTaskPanePos(nSplitPos + nSplitterWidth, _rPlayground.Top());
+ if ( m_pTaskPane && m_pTaskPane->IsVisible() )
+ {
+ aTaskPanePos.X() = aPlaygroundSize.Width() - m_pTaskPane->GetSizePixel().Width();
+ sal_Int32 nMinWidth = m_pPropWin->getMinimumSize().Width();
+ if ( nMinWidth > (aPlaygroundSize.Width() - aTaskPanePos.X()) )
+ {
+ aTaskPanePos.X() = aPlaygroundSize.Width() - nMinWidth;
+ }
+ nSplitPos = aTaskPanePos.X() - nSplitterWidth;
+ getController().setSplitPos(nSplitPos);
+
+ const long nTaskPaneSize = static_cast<long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
+ if ( m_aSplitWin.GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
+ {
+ m_aSplitWin.SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
+ m_aSplitWin.SetItemSize( TASKPANE_ID, nTaskPaneSize );
+ }
+ }
+ }
+ // set the size of the report window
+ m_aSplitWin.SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize );
+ }
+ // 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);
+ static_cast<OTaskWindow*>(m_pTaskPane)->Resize();
+ }
+ Resize();
+ }
+
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::SetMode( DlgEdMode _eNewMode )
+{
+ m_eMode = _eNewMode;
+ if ( m_eMode == RPTUI_SELECT )
+ m_eActObj = OBJ_NONE;
+
+ m_aScrollWindow.SetMode(_eNewMode);
+}
+//----------------------------------------------------------------------------
+void ODesignView::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ m_eActObj = eObj;
+ m_aScrollWindow.SetInsertObj( eObj,_sShapeType );
+}
+//----------------------------------------------------------------------------
+rtl::OUString ODesignView::GetInsertObjString() const
+{
+ return m_aScrollWindow.GetInsertObjString();
+}
+//----------------------------------------------------------------------------
+
+USHORT ODesignView::GetInsertObj() const
+{
+ return m_eActObj;
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::Cut()
+{
+ Copy();
+ Delete();
+}
+
+//----------------------------------------------------------------------------
+
+void ODesignView::Copy()
+{
+ m_aScrollWindow.Copy();
+}
+
+//----------------------------------------------------------------------------
+
+void ODesignView::Paste()
+{
+ m_aScrollWindow.Paste();
+}
+//----------------------------------------------------------------------------
+void ODesignView::Delete()
+{
+ m_aScrollWindow.Delete();
+}
+//----------------------------------------------------------------------------
+BOOL ODesignView::HasSelection() const
+{
+ return m_aScrollWindow.HasSelection();
+}
+//----------------------------------------------------------------------------
+
+BOOL ODesignView::IsPasteAllowed() const
+{
+ return m_aScrollWindow.IsPasteAllowed();
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView)
+{
+ if ( m_pCurrentView != &_rView )
+ {
+ if ( m_pCurrentView )
+ m_aScrollWindow.setMarked(m_pCurrentView,sal_False);
+ m_pCurrentView = &_rView;
+ if ( m_pCurrentView )
+ m_aScrollWindow.setMarked(m_pCurrentView,sal_True);
+ m_xReportComponent.clear();
+ DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED );
+ Broadcast( aHint );
+ }
+ m_aMarkTimer.Start();
+}
+
+//----------------------------------------------------------------------------
+void ODesignView::toggleGrid(sal_Bool _bGridVisible)
+{
+ m_aScrollWindow.toggleGrid(_bGridVisible);
+}
+//----------------------------------------------------------------------------
+USHORT ODesignView::getSectionCount() const
+{
+ return m_aScrollWindow.getSectionCount();
+}
+//----------------------------------------------------------------------------
+void ODesignView::showRuler(sal_Bool _bShow)
+{
+ m_aScrollWindow.showRuler(_bShow);
+}
+//----------------------------------------------------------------------------
+void ODesignView::removeSection(USHORT _nPosition)
+{
+ m_aScrollWindow.removeSection(_nPosition);
+}
+//----------------------------------------------------------------------------
+void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
+{
+ m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::GetFocus()
+{
+ Window::GetFocus();
+
+ if ( !m_bDeleted )
+ {
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aScrollWindow.getMarkedSection();
+ if ( pSectionWindow )
+ pSectionWindow->GrabFocus();
+ }
+}
+// -----------------------------------------------------------------------------
+void ODesignView::ImplInitSettings()
+{
+//#if OSL_DEBUG_LEVEL > 0
+// SetBackground( Wallpaper( COL_RED ));
+//#else
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
+//#endif
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+ SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( ODesignView, SplitHdl, void*, )
+{
+ const Size aOutputSize = GetOutputSizePixel();
+ const long nTest = aOutputSize.Width() * m_aSplitWin.GetItemSize(TASKPANE_ID) / 100;
+ 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_aScrollWindow.getMaxMarkerWidth(sal_False) )
+ {
+ long nOldSplitPos = getController().getSplitPos();
+ getController().setSplitPos(nTest);
+ if ( nOldSplitPos != -1 && nOldSplitPos <= nTest )
+ {
+ Invalidate(/*INVALIDATE_NOCHILDREN*/);
+ }
+ }
+
+ return 0L;
+}
+//-----------------------------------------------------------------------------
+void ODesignView::SelectAll(const sal_uInt16 _nObjectType)
+{
+ m_aScrollWindow.SelectAll(_nObjectType);
+}
+//-----------------------------------------------------------------------------
+void ODesignView::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ m_aScrollWindow.unmarkAllObjects(_pSectionView);
+}
+//-----------------------------------------------------------------------------
+void ODesignView::togglePropertyBrowser(sal_Bool _bToogleOn)
+{
+ if ( !m_pPropWin && _bToogleOn )
+ {
+ m_pPropWin = new PropBrw(getController().getORB(),m_pTaskPane,this);
+ m_pPropWin->Invalidate();
+ static_cast<OTaskWindow*>(m_pTaskPane)->setPropertyBrowser(m_pPropWin);
+ 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_pTaskPane->Show(bWillBeVisible);
+ m_pTaskPane->Invalidate();
+
+ if ( bWillBeVisible )
+ m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE/*|SWIB_COLSET */);
+ else
+ m_aSplitWin.RemoveItem(TASKPANE_ID);
+
+ // TRY
+ // 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_aScrollWindow.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& rReportController = getController();
+ m_pReportExplorer = new ONavigator(this,rReportController);
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_NAVIGATOR ) );
+ if ( aDlgOpt.Exists() )
+ m_pReportExplorer->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
+ m_pReportExplorer->AddEventListener(LINK(&rReportController,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& rReportController = getController();
+ if ( !m_pCurrentView && !xReport.is() )
+ {
+ if ( xReportComponent.is() )
+ xReport = xReportComponent->getSection()->getReportDefinition();
+ else
+ xReport = rReportController.getReportDefinition().get();
+ }
+ else if ( m_pCurrentView )
+ {
+ uno::Reference< report::XSection > xSection = m_pCurrentView->getReportSection()->getSection();
+ xReport = xSection->getReportDefinition();
+ }
+ uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
+ m_pAddField = new OAddFieldWindow(this,xSet);
+ m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) );
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( UID_RPT_RPT_APP_VIEW ) );
+ if ( aDlgOpt.Exists() )
+ m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
+ m_pAddField->Update();
+ m_pAddField->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl));
+ notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::AddWindow));
+ m_pAddField->Show();
+ }
+ 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->getReportSection()->getSection();
+
+ // why do we need the code below?
+ //else
+ // {
+ // OReportController& rReportController = getController();
+ // xSection = rReportController.getReportDefinition()->getDetail();
+ // }
+ return xSection;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel() const
+{
+ uno::Reference< report::XReportComponent > xModel;
+ if ( m_pCurrentView )
+ {
+ xModel = m_pCurrentView->getReportSection()->getCurrentControlModel();
+ }
+ return xModel;
+}
+// -------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> ODesignView::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_aScrollWindow.getMarkedSection(nsa);
+}
+//-----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> ODesignView::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+{
+ return m_aScrollWindow.getSectionWindow(_xSection);
+}
+// -------------------------------------------------------------------------
+void ODesignView::markSection(const sal_uInt16 _nPos)
+{
+ m_aScrollWindow.markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ m_aScrollWindow.fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections)
+{
+ m_aScrollWindow.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)
+{
+ m_aScrollWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects);
+}
+#if 0
+// -----------------------------------------------------------------------------
+sal_Bool ODesignView::isAlignPossible() const
+{
+ ::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection();
+ return pMarkedSection.get() && pMarkedSection->getReportSection().getSectionView().IsAlignPossible();
+}
+#endif
+//------------------------------------------------------------------------------
+sal_Bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ if ( (m_pPropWin && m_pPropWin->HasChildPathFocus()) )
+ return sal_False;
+ if ( (m_pAddField && m_pAddField->HasChildPathFocus()) )
+ return sal_False;
+ if ( (m_pReportExplorer && m_pReportExplorer->HasChildPathFocus()) )
+ return sal_False;
+ return m_aScrollWindow.handleKeyEvent(_rEvent);
+}
+//------------------------------------------------------------------------
+void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ m_aScrollWindow.setMarked(_xSection,_bMark);
+ if ( _bMark )
+ UpdatePropertyBrowserDelayed(getMarkedSection()->getReportSection().getSectionView());
+ else
+ m_pCurrentView = NULL;
+}
+//------------------------------------------------------------------------
+void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,sal_Bool _bMark)
+{
+ m_aScrollWindow.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<OSectionWindow> pSectionWindow = getMarkedSection();
+ if ( pSectionWindow )
+ {
+ ::std::vector< uno::Reference< uno::XInterface > > aSelection;
+ pSectionWindow->getReportSection().fillControlModelSelection(aSelection);
+ if ( !aSelection.empty() )
+ {
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
+ uno::Sequence< uno::Reference< report::XReportComponent > > aSeq(aSelection.size());
+ for(sal_Int32 i = 0; i < aSeq.getLength(); ++i,++aIter)
+ {
+ aSeq[i].set(*aIter,uno::UNO_QUERY);
+ }
+ aRet <<= aSeq;
+ }
+ }
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
+{
+ m_aScrollWindow.fillControlModelSelection(_rSelection);
+}
+// -----------------------------------------------------------------------------
+void ODesignView::setGridSnap(BOOL bOn)
+{
+ m_aScrollWindow.setGridSnap(bOn);
+
+}
+// -----------------------------------------------------------------------------
+void ODesignView::setDragStripes(BOOL bOn)
+{
+ m_aScrollWindow.setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+sal_Bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
+{
+ return m_pPropWin && m_pPropWin->HasChildPathFocus();
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 ODesignView::getMarkedObjectCount() const
+{
+ return m_aScrollWindow.getMarkedObjectCount();
+}
+// -----------------------------------------------------------------------------
+void ODesignView::zoom(const Fraction& _aZoom)
+{
+ m_aScrollWindow.zoom(_aZoom);
+}
+// -----------------------------------------------------------------------------
+sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const
+{
+ return m_aScrollWindow.getZoomFactor(_eType);
+}
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx
new file mode 100644
index 000000000000..c32a07d5fc76
--- /dev/null
+++ b/reportdesign/source/ui/report/EndMarker.cxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "EndMarker.hxx"
+#include "ColorChanger.hxx"
+#include "SectionWindow.hxx"
+#include "helpids.hrc"
+#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_RPT_ENDMARKER);
+ ImplInitSettings();
+ SetPaintTransparent(TRUE);
+}
+// -----------------------------------------------------------------------------
+OEndMarker::~OEndMarker()
+{
+ DBG_DTOR( rpt_OEndMarker,NULL);
+}
+// -----------------------------------------------------------------------------
+void OEndMarker::Paint( const Rectangle& /*rRect*/ )
+{
+ Fraction aCornerSpace(long(CORNER_SPACE));
+ aCornerSpace *= GetMapMode().GetScaleX();
+ const long nCornerSpace = aCornerSpace;
+
+ Size aSize = GetSizePixel();
+ aSize.Width() += nCornerSpace;
+ Rectangle aWholeRect(Point(-nCornerSpace,0),aSize);
+ PolyPolygon aPoly;
+ aPoly.Insert(Polygon(aWholeRect,nCornerSpace,nCornerSpace));
+
+ 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(PixelToLogic(aPoly) ,aGradient);
+ if ( m_bMarked )
+ {
+ Rectangle aRect( Point(-nCornerSpace,nCornerSpace),
+ Size(aSize.Width()- nCornerSpace,aSize.Height() - nCornerSpace- nCornerSpace));
+ ColorChanger aColors( this, COL_WHITE, COL_WHITE );
+ DrawPolyLine(Polygon(PixelToLogic(aRect)),LineInfo(LINE_SOLID,2));
+ }
+}
+// -----------------------------------------------------------------------
+void OEndMarker::ImplInitSettings()
+{
+ SetBackground( Wallpaper( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor) );
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetShadowColor() );
+}
+// -----------------------------------------------------------------------
+void OEndMarker::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
+ return;
+ static_cast<OSectionWindow*>(GetParent())->showProperties();
+}
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx
new file mode 100644
index 000000000000..9952d706a4b4
--- /dev/null
+++ b/reportdesign/source/ui/report/FixedTextColor.cxx
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_reportdesign.hxx"
+
+#include <FixedTextColor.hxx>
+#include <com/sun/star/report/XFixedText.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/InvalidateStyle.hpp>
+
+#include <RptObject.hxx>
+#include <RptModel.hxx>
+#include <RptPage.hxx>
+#include <ViewsWindow.hxx>
+#include <ReportSection.hxx>
+#include <ReportController.hxx>
+#include <uistrings.hrc>
+#include <reportformula.hxx>
+#include <toolkit/helper/property.hxx>
+
+#include <tools/color.hxx> // COL_TRANSPARENT
+#include <svtools/extcolorcfg.hxx>
+#include <unotools/confignode.hxx>
+
+// DBG_*
+#include <tools/debug.hxx>
+// DBG_UNHANDLED_EXCEPTION
+#include <tools/diagnose_ex.h>
+
+#include <vcl/svapp.hxx>
+#include <vcl/settings.hxx>
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+
+ DBG_NAME(rpt_FixedTextColor)
+
+ FixedTextColor::FixedTextColor(const OReportController& _aController)
+ :m_rReportController(_aController)
+ {
+ DBG_CTOR(rpt_FixedTextColor, NULL);
+ }
+
+ //--------------------------------------------------------------------
+ // sal_Int32 FixedTextColor::getTextColor()
+ // {
+ // const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings();
+ // BOOL bHighContrast = aStyleSettings.GetHighContrastMode();
+ //
+ // Color aGetFaceColor = aStyleSettings.GetFaceColor();
+ // Color aGetCheckedColor = aStyleSettings.GetCheckedColor();
+ // Color aGetLightColor = aStyleSettings.GetLightColor();
+ // Color aGetLightBorderColor = aStyleSettings.GetLightBorderColor();
+ // Color aGetShadowColor = aStyleSettings.GetShadowColor();
+ // Color aGetDarkShadowColor = aStyleSettings.GetDarkShadowColor();
+ // Color aGetButtonTextColor = aStyleSettings.GetButtonTextColor();
+ // Color aGetButtonRolloverTextColor = aStyleSettings.GetButtonRolloverTextColor();
+ // Color aGetRadioCheckTextColor = aStyleSettings.GetRadioCheckTextColor();
+ // Color aGetGroupTextColor = aStyleSettings.GetGroupTextColor();
+ // Color aGetLabelTextColor = aStyleSettings.GetLabelTextColor();
+ // Color aGetInfoTextColor = aStyleSettings.GetInfoTextColor();
+ // Color aGetWindowColor = aStyleSettings.GetWindowColor();
+ // Color aGetWindowTextColor = aStyleSettings.GetWindowTextColor();
+ // Color aGetDialogColor = aStyleSettings.GetDialogColor();
+ // Color aGetDialogTextColor = aStyleSettings.GetDialogTextColor();
+ // Color aGetWorkspaceColor = aStyleSettings.GetWorkspaceColor();
+ // Color aGetFieldColor = aStyleSettings.GetFieldColor();
+ // Color aGetFieldTextColor = aStyleSettings.GetFieldTextColor();
+ // Color aGetFieldRolloverTextColor = aStyleSettings.GetFieldRolloverTextColor();
+ // Color aGetActiveColor = aStyleSettings.GetActiveColor();
+ // Color aGetActiveColor2 = aStyleSettings.GetActiveColor2();
+ // Color aGetActiveTextColor = aStyleSettings.GetActiveTextColor();
+ // Color aGetActiveBorderColor = aStyleSettings.GetActiveBorderColor();
+ // Color aGetDeactiveColor = aStyleSettings.GetDeactiveColor();
+ // Color aGetDeactiveColor2 = aStyleSettings.GetDeactiveColor2();
+ // Color aGetDeactiveTextColor = aStyleSettings.GetDeactiveTextColor();
+ // Color aGetDeactiveBorderColor = aStyleSettings.GetDeactiveBorderColor();
+ // Color aGetHighlightColor = aStyleSettings.GetHighlightColor();
+ // Color aGetHighlightTextColor = aStyleSettings.GetHighlightTextColor();
+ // Color aGetDisableColor = aStyleSettings.GetDisableColor();
+ // Color aGetHelpColor = aStyleSettings.GetHelpColor();
+ // Color aGetHelpTextColor = aStyleSettings.GetHelpTextColor();
+ // Color aGetMenuColor = aStyleSettings.GetMenuColor();
+ // Color aGetMenuBarColor = aStyleSettings.GetMenuBarColor();
+ // Color aGetMenuBorderColor = aStyleSettings.GetMenuBorderColor();
+ // Color aGetMenuTextColor = aStyleSettings.GetMenuTextColor();
+ // Color aGetMenuHighlightColor = aStyleSettings.GetMenuHighlightColor();
+ // Color aGetMenuHighlightTextColor = aStyleSettings.GetMenuHighlightTextColor();
+ // Color aGetLinkColor = aStyleSettings.GetLinkColor();
+ // Color aGetVisitedLinkColor = aStyleSettings.GetVisitedLinkColor();
+ // Color aGetHighlightLinkColor = aStyleSettings.GetHighlightLinkColor();
+ // Color aGetMonoColor = aStyleSettings.GetMonoColor();
+ // Color aGetActiveTabColor = aStyleSettings.GetActiveTabColor();
+ // Color aGetInactiveTabColor = aStyleSettings.GetInactiveTabColor();
+ //
+ // Color aWindowColor = aStyleSettings.GetWindowColor();
+ // Color aLabelColor = aStyleSettings.GetLabelTextColor();
+ //
+ // // if (m_nTextColor == -1)
+ // // {
+ // // svtools::ExtendedColorConfig aConfig;
+ // // m_nTextColor = aConfig.GetColorValue(CFG_REPORTDESIGNER, DBTEXTBOXBOUNDCONTENT).getColor();
+ // // }
+ // return aLabelColor.GetColor();
+ // }
+
+ //--------------------------------------------------------------------
+ FixedTextColor::~FixedTextColor()
+ {
+ DBG_DTOR(rpt_FixedTextColor,NULL);
+ }
+ // -----------------------------------------------------------------------------
+
+ void FixedTextColor::notifyPropertyChange( const beans::PropertyChangeEvent& _rEvent )
+ {
+ // (void)_rEvent;
+ uno::Reference< report::XFixedText > xFixedText( _rEvent.Source, uno::UNO_QUERY );
+ if ( ! xFixedText.is() )
+ {
+ return;
+ }
+
+ try
+ {
+ uno::Reference< lang::XComponent > xComponent( xFixedText, uno::UNO_QUERY_THROW );
+ handle(xComponent);
+ // uno::Reference<awt::XVclWindowPeer> xVclWindowPeer = getVclWindowPeer(xComponent);
+
+ // setPropertyTextColor(xVclWindowPeer, getTextColor());
+ }
+ catch (uno::Exception e)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ // -----------------------------------------------------------------------------
+ void FixedTextColor::setPropertyTextColor(const uno::Reference< awt::XVclWindowPeer >& _xVclWindowPeer, sal_Int32 _nTextColor)
+ {
+ _xVclWindowPeer->setProperty(PROPERTY_TEXTCOLOR, uno::makeAny(sal_Int32(_nTextColor)));
+ }
+
+ // -----------------------------------------------------------------------------
+ void FixedTextColor::notifyElementInserted( const uno::Reference< uno::XInterface >& _rxElement )
+ {
+ handle(_rxElement);
+ }
+
+// -----------------------------------------------------------------------------
+ void FixedTextColor::handle( const uno::Reference< uno::XInterface >& _rxElement )
+ {
+ // (void) _rxElement;
+ uno::Reference< report::XFixedText > xFixedText( _rxElement, uno::UNO_QUERY );
+ if ( ! xFixedText.is() )
+ {
+ return;
+ }
+
+ try
+ {
+ sal_Bool bIsDark = sal_False;
+ const sal_Int32 nBackColor( xFixedText->getControlBackground() );
+ if ((sal_uInt32)nBackColor == COL_TRANSPARENT)
+ {
+ uno::Reference <report::XSection> xSection(xFixedText->getParent(), uno::UNO_QUERY_THROW);
+
+ sal_Bool bSectionBackColorIsTransparent = xSection->getBackTransparent();
+ if (bSectionBackColorIsTransparent)
+ {
+ // Label Transparent, Section Transparent set LabelTextColor
+ const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings();
+ Color aWindowColor = aStyleSettings.GetWindowColor();
+ bIsDark = aWindowColor.IsDark();
+ }
+ else
+ {
+ com::sun::star::util::Color aColor2 = xSection->getBackColor();
+ Color aBackColor(aColor2);
+ bIsDark = aBackColor.IsDark();
+ }
+ }
+ else
+ {
+ Color aLabelBackColor(nBackColor);
+ bIsDark = aLabelBackColor.IsDark();
+ }
+
+ uno::Reference<awt::XVclWindowPeer> xVclWindowPeer = getVclWindowPeer(xFixedText);
+ if (bIsDark)
+ {
+ const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings();
+ Color aLabelTextColor = aStyleSettings.GetLabelTextColor();
+ setPropertyTextColor(xVclWindowPeer, aLabelTextColor.GetColor());
+ }
+ else
+ {
+ util::Color aLabelColor = xFixedText->getCharColor();
+ setPropertyTextColor(xVclWindowPeer, aLabelColor);
+ }
+
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+
+// -----------------------------------------------------------------------------
+ // XPropertyChangeListener
+ uno::Reference<awt::XControl> FixedTextColor::getXControl(const uno::Reference< report::XFixedText >& _xFixedText) throw(uno::RuntimeException)
+ {
+
+ uno::Reference<awt::XControl> xControl;
+ OReportController *pController = (OReportController *)&m_rReportController;
+
+ ::boost::shared_ptr<OReportModel> pModel = pController->getSdrModel();
+
+ uno::Reference<report::XSection> xSection(_xFixedText->getSection());
+ if ( xSection.is() )
+ {
+ OReportPage *pPage = pModel->getPage(xSection);
+ ULONG nIndex = pPage->getIndexOf(_xFixedText.get());
+ if (nIndex < pPage->GetObjCount() )
+ {
+ SdrObject *pObject = pPage->GetObj(nIndex);
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject);
+ if ( pUnoObj ) // this doesn't need to be done for shapes
+ {
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = pController->getSectionWindow(xSection);
+ if (pSectionWindow != NULL)
+ {
+ OReportSection& aOutputDevice = pSectionWindow->getReportSection(); // OutputDevice
+ OSectionView& aSdrView = aOutputDevice.getSectionView(); // SdrView
+ xControl = pUnoObj->GetUnoControl(aSdrView, aOutputDevice);
+ }
+ }
+ }
+ }
+ return xControl;
+ }
+
+// -----------------------------------------------------------------------------
+ uno::Reference<awt::XVclWindowPeer> FixedTextColor::getVclWindowPeer(const uno::Reference< report::XFixedText >& _xComponent) throw(uno::RuntimeException)
+ {
+ uno::Reference<awt::XVclWindowPeer> xVclWindowPeer;
+ uno::Reference<awt::XControl> xControl = getXControl(_xComponent);
+
+ xVclWindowPeer = uno::Reference<awt::XVclWindowPeer>( xControl->getPeer(), uno::UNO_QUERY);
+
+ return xVclWindowPeer;
+ }
+
+
+
+
+}
diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
new file mode 100644
index 000000000000..fdfdad6cb55f
--- /dev/null
+++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
@@ -0,0 +1,203 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_reportdesign.hxx"
+
+#include <FormattedFieldBeautifier.hxx>
+
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/report/XImageControl.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/InvalidateStyle.hpp>
+
+#include <RptObject.hxx>
+#include <RptModel.hxx>
+#include <RptPage.hxx>
+#include <ViewsWindow.hxx>
+#include <ReportSection.hxx>
+#include <ReportController.hxx>
+#include <uistrings.hrc>
+#include <reportformula.hxx>
+#include <toolkit/helper/property.hxx>
+
+#include <svtools/extcolorcfg.hxx>
+#include <unotools/confignode.hxx>
+
+// DBG_*
+#include <tools/debug.hxx>
+// DBG_UNHANDLED_EXCEPTION
+#include <tools/diagnose_ex.h>
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+
+ DBG_NAME(rpt_FormattedFieldBeautifier)
+
+ //--------------------------------------------------------------------
+ FormattedFieldBeautifier::FormattedFieldBeautifier(const OReportController& _aController)
+ :m_rReportController(_aController)
+ ,m_nTextColor(-1)
+ {
+ DBG_CTOR(rpt_FormattedFieldBeautifier, NULL);
+ }
+
+ //--------------------------------------------------------------------
+ sal_Int32 FormattedFieldBeautifier::getTextColor()
+ {
+ if (m_nTextColor == -1)
+ {
+ svtools::ExtendedColorConfig aConfig;
+ m_nTextColor = aConfig.GetColorValue(CFG_REPORTDESIGNER, DBTEXTBOXBOUNDCONTENT).getColor();
+ }
+ return m_nTextColor;
+ }
+
+ //--------------------------------------------------------------------
+ FormattedFieldBeautifier::~FormattedFieldBeautifier()
+ {
+ DBG_DTOR(rpt_FormattedFieldBeautifier,NULL);
+ }
+
+ // -----------------------------------------------------------------------------
+ void FormattedFieldBeautifier::setPlaceholderText( const uno::Reference< uno::XInterface >& _rxComponent )
+ {
+ ::rtl::OUString sDataField;
+
+ try
+ {
+ uno::Reference< report::XFormattedField > xControlModel( _rxComponent, uno::UNO_QUERY );
+ if ( xControlModel.is() )
+ {
+ sDataField = xControlModel->getDataField();
+
+ if ( sDataField.getLength() )
+ {
+ ReportFormula aFormula( sDataField );
+ bool bSet = true;
+ if ( aFormula.getType() == ReportFormula::Field )
+ {
+ const ::rtl::OUString sColumnName = aFormula.getFieldName();
+ ::rtl::OUString sLabel = m_rReportController.getColumnLabel_throw(sColumnName);
+ if ( sLabel.getLength() )
+ {
+ ::rtl::OUStringBuffer aBuffer;
+ aBuffer.appendAscii( "=" );
+ aBuffer.append( sLabel );
+ sDataField = aBuffer.makeStringAndClear();
+ bSet = false;
+ }
+ }
+ if ( bSet )
+ sDataField = aFormula.getEqualUndecoratedContent();
+ }
+ }
+
+ if ( xControlModel.is() )
+ setPlaceholderText( getVclWindowPeer( xControlModel.get() ), sDataField );
+ }
+ catch (uno::Exception)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ // -----------------------------------------------------------------------------
+ void FormattedFieldBeautifier::setPlaceholderText( const uno::Reference< awt::XVclWindowPeer >& _xVclWindowPeer, const ::rtl::OUString& _rText )
+ {
+ OSL_ENSURE( _xVclWindowPeer.is(), "FormattedFieldBeautifier::setPlaceholderText: invalid peer!" );
+ if ( !_xVclWindowPeer.is() )
+ throw uno::RuntimeException();
+
+ // the actual text
+ _xVclWindowPeer->setProperty(PROPERTY_TEXT, uno::makeAny(_rText));
+ // the text color
+ _xVclWindowPeer->setProperty(PROPERTY_TEXTCOLOR, uno::makeAny(getTextColor()));
+ // font->italic
+ uno::Any aFontDescriptor = _xVclWindowPeer->getProperty(PROPERTY_FONTDESCRIPTOR);
+ awt::FontDescriptor aFontDescriptorStructure;
+ aFontDescriptor >>= aFontDescriptorStructure;
+ aFontDescriptorStructure.Slant = ::com::sun::star::awt::FontSlant_ITALIC;
+ _xVclWindowPeer->setProperty(PROPERTY_FONTDESCRIPTOR, uno::makeAny(aFontDescriptorStructure));
+ }
+
+ // -----------------------------------------------------------------------------
+ void FormattedFieldBeautifier::notifyPropertyChange( const beans::PropertyChangeEvent& _rEvent )
+ {
+ if ( !_rEvent.PropertyName.equalsAscii( "DataField" ) )
+ // not interested in
+ return;
+
+ setPlaceholderText( _rEvent.Source );
+ }
+
+ // -----------------------------------------------------------------------------
+ void FormattedFieldBeautifier::handle( const uno::Reference< uno::XInterface >& _rxElement )
+ {
+ setPlaceholderText( _rxElement );
+ }
+
+ // -----------------------------------------------------------------------------
+ void FormattedFieldBeautifier::notifyElementInserted( const uno::Reference< uno::XInterface >& _rxElement )
+ {
+ handle( _rxElement );
+ }
+
+ // -----------------------------------------------------------------------------
+ uno::Reference<awt::XVclWindowPeer> FormattedFieldBeautifier::getVclWindowPeer(const uno::Reference< report::XReportComponent >& _xComponent) throw(uno::RuntimeException)
+ {
+ uno::Reference<awt::XVclWindowPeer> xVclWindowPeer;
+
+ ::boost::shared_ptr<OReportModel> pModel = const_cast< OReportController& >( m_rReportController ).getSdrModel();
+
+ uno::Reference<report::XSection> xSection(_xComponent->getSection());
+ if ( xSection.is() )
+ {
+ OReportPage *pPage = pModel->getPage(xSection);
+ ULONG nIndex = pPage->getIndexOf(_xComponent);
+ if (nIndex < pPage->GetObjCount() )
+ {
+ SdrObject *pObject = pPage->GetObj(nIndex);
+ OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject);
+ if ( pUnoObj ) // this doesn't need to be done for shapes
+ {
+ // Rectangle aRect = pUnoObj->GetCurrentBoundRect();
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_rReportController.getSectionWindow(xSection);
+ if (pSectionWindow != NULL)
+ {
+ OReportSection& aOutputDevice = pSectionWindow->getReportSection(); // OutputDevice
+ OSectionView& aSdrView = aOutputDevice.getSectionView(); // SdrView
+ uno::Reference<awt::XControl> xControl = pUnoObj->GetUnoControl(aSdrView, aOutputDevice);
+ xVclWindowPeer = uno::Reference<awt::XVclWindowPeer>( xControl->getPeer(), uno::UNO_QUERY);
+ }
+ }
+ }
+ }
+ return xVclWindowPeer;
+ }
+}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
new file mode 100644
index 000000000000..4ed0e3cd2842
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -0,0 +1,4391 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "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
+
+
+#include "ReportController.hxx"
+#include "ReportDefinition.hxx"
+#include "CondFormat.hxx"
+#include "UITools.hxx"
+#include "AddField.hxx"
+#include <toolkit/helper/vclunohelper.hxx>
+#include "DateTime.hxx"
+
+#include <sfx2/filedlghelper.hxx>
+#include <tools/string.hxx>
+#include <tools/diagnose_ex.h>
+#include "rptui_slotid.hrc"
+#include "reportformula.hxx"
+
+#include <comphelper/documentconstants.hxx>
+#include <comphelper/mediadescriptor.hxx>
+#include <comphelper/property.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <comphelper/types.hxx>
+
+#include <connectivity/dbtools.hxx>
+#include <com/sun/star/view/PaperFormat.hpp>
+#include <com/sun/star/style/GraphicLocation.hpp>
+#include <com/sun/star/style/XStyle.hpp>
+#include <com/sun/star/style/PageStyleLayout.hpp>
+#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/report/XImageControl.hpp>
+#include <com/sun/star/report/XFixedLine.hpp>
+#include <com/sun/star/report/Function.hpp>
+#include <com/sun/star/report/XShape.hpp>
+#include <com/sun/star/awt/FontDescriptor.hpp>
+#include <com/sun/star/sdb/XDocumentDataSource.hpp>
+#include <com/sun/star/sdb/XParametersSupplier.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/EmbedMapUnits.hpp>
+#include <comphelper/streamsection.hxx>
+#include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/awt/FontUnderline.hpp>
+#include <com/sun/star/awt/TextAlign.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <com/sun/star/frame/status/FontHeight.hpp>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/sdb/SQLContext.hpp>
+#include <com/sun/star/sdbc/SQLWarning.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include <vcl/svapp.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/waitobj.hxx>
+
+#include <svx/fmview.hxx>
+#include <editeng/paperinf.hxx>
+#include <svx/svxids.hrc>
+#include <svx/svdobj.hxx>
+#include <svx/dataaccessdescriptor.hxx>
+#include <editeng/svxenum.hxx>
+#include <svx/pageitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/sizeitem.hxx>
+#include <svx/zoomitem.hxx>
+#include <svx/zoomslideritem.hxx>
+#include <editeng/brshitem.hxx>
+#include <svx/flagsdef.hxx> //CHINA001
+#include <svx/svdpagv.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/zoom_def.hxx>
+#include <svx/dialogs.hrc>
+
+#include "DesignView.hxx"
+#include "ModuleHelper.hxx"
+#include "RptObject.hxx"
+#include "Undo.hxx"
+#include "uistrings.hrc"
+#include "RptDef.hxx"
+#include "ReportSection.hxx"
+#include "SectionView.hxx"
+#include "UndoActions.hxx"
+#include "dlgpage.hxx"
+#include "RptResId.hrc"
+
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
+#include <svl/aeitem.hxx> //CHINA001
+#include <svtools/cliplistener.hxx>
+#include <unotools/syslocale.hxx>
+#include <unotools/viewoptions.hxx>
+
+#include <vos/mutex.hxx>
+#include "PropertyForward.hxx"
+#include "SectionWindow.hxx"
+
+#include <toolkit/helper/convert.hxx>
+#include "GroupsSorting.hxx"
+#include "PageNumber.hxx"
+#include <toolkit/helper/vclunohelper.hxx>
+#include "UndoEnv.hxx"
+#include "InsertFunctions.hxx"
+
+#include <boost/mem_fn.hpp>
+#include <boost/bind.hpp>
+#include <boost/utility.hpp>
+
+#include <cppuhelper/exc_hlp.hxx>
+#include <unotools/confignode.hxx>
+#include <helpids.hrc>
+
+#include <ReportControllerObserver.hxx>
+
+#define MAX_ROWS_FOR_PREVIEW 50
+
+using namespace ::com::sun::star;
+using namespace uno;
+using namespace io;
+using namespace beans;
+using namespace frame;
+using namespace util;
+using namespace lang;
+using namespace container;
+using namespace sdbcx;
+using namespace sdbc;
+using namespace sdb;
+using namespace ui;
+using namespace ui::dialogs;
+using namespace util;
+using namespace ::dbtools;
+using namespace ::rptui;
+using namespace ::dbaui;
+using namespace ::comphelper;
+using namespace ::cppu;
+
+// -----------------------------------------------------------------------------
+namespace
+{
+ // comparing two PropertyValue instances
+ struct PropertyValueCompare : public ::std::binary_function< beans::PropertyValue, ::rtl::OUString , bool >
+ {
+ bool operator() (const beans::PropertyValue& x, const ::rtl::OUString& y) const
+ {
+ return x.Name.equals(y);// ? true : false;
+ }
+ bool operator() (const ::rtl::OUString& x,const beans::PropertyValue& y) const
+ {
+ return x.equals(y.Name);// ? true : false;
+ }
+ };
+
+ void lcl_setFontWPU_nothrow(const uno::Reference< report::XReportControlFormat>& _xReportControlFormat,const sal_Int32 _nId)
+ {
+ 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&)
+ {
+ }
+ } // if ( xReportControlFormat.is() )
+ }
+}
+
+// -----------------------------------------------------------------------------
+void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,
+ ODesignView* _pView,
+ uno::Reference< awt::XWindow>& _xWindow,
+ ::std::vector< uno::Reference< uno::XInterface > >& _rControlsFormats)
+{
+ 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() )
+ {
+ _pView->fillControlModelSelection(_rControlsFormats);
+ //xReportControlFormat.set( _pView->getCurrentControlModel(),uno::UNO_QUERY);
+ } // if ( !xReportControlFormat.is() )
+ else
+ _rControlsFormats.push_back(xReportControlFormat);
+
+ if ( !_xWindow.is() )
+ _xWindow = VCLUnoHelper::GetInterface(_pView);
+}
+// -----------------------------------------------------------------------------
+::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));
+}
+
+#define PROPERTY_ID_ZOOMVALUE 1
+
+DBG_NAME( rpt_OReportController )
+// -----------------------------------------------------------------------------
+OReportController::OReportController(Reference< XComponentContext > const & xContext)
+ :OReportController_BASE(Reference< XMultiServiceFactory >(xContext->getServiceManager(),UNO_QUERY))
+ ,OPropertyStateContainer(OGenericUnoController_Base::rBHelper)
+ ,m_aSelectionListeners( getMutex() )
+ ,m_pClipbordNotifier(NULL)
+ ,m_pGroupsFloater(NULL)
+ ,m_xContext(xContext)
+ ,m_nSplitPos(-1)
+ ,m_nPageNum(-1)
+ ,m_nSelectionCount(0)
+ ,m_nZoomValue(100)
+ ,m_eZoomType(SVX_ZOOM_PERCENT)
+ ,m_bShowRuler(sal_True)
+ ,m_bGridVisible(sal_True)
+ ,m_bGridUse(sal_True)
+ ,m_bShowProperties(sal_True)
+ ,m_bGroupFloaterWasVisible(sal_False)
+ ,m_bHelplinesMove(sal_True)
+ ,m_bChartEnabled(false)
+ ,m_bChartEnabledAsked(false)
+ ,m_bInGeneratePreview(false)
+{
+ // new Observer
+ m_pReportControllerObserver = new OXReportControllerObserver(*this);
+ m_pReportControllerObserver->acquire();
+
+ m_sMode = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal"));
+ DBG_CTOR( rpt_OReportController,NULL);
+ registerProperty(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomValue")),PROPERTY_ID_ZOOMVALUE,beans::PropertyAttribute::BOUND| beans::PropertyAttribute::TRANSIENT,&m_nZoomValue,::getCppuType(reinterpret_cast< sal_Int16*>(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()
+{
+
+ if ( m_pClipbordNotifier )
+ {
+ m_pClipbordNotifier->ClearCallbackLink();
+ m_pClipbordNotifier->AddRemoveListener( getView(), sal_False );
+ m_pClipbordNotifier->release();
+ m_pClipbordNotifier = NULL;
+ } // if ( getView() && m_pClipbordNotifier )
+ if ( m_pGroupsFloater )
+ {
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_GROUPS_SORTING ) );
+ aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pGroupsFloater->GetWindowState(WINDOWSTATE_MASK_ALL).GetBuffer() ) );
+ ::std::auto_ptr<FloatingWindow> aTemp(m_pGroupsFloater);
+ m_pGroupsFloater = NULL;
+ }
+
+ try
+ {
+ m_xHoldAlive.clear();
+ m_xColumns.clear();
+ ::comphelper::disposeComponent( m_xRowSet );
+ ::comphelper::disposeComponent( m_xRowSetMediator );
+ ::comphelper::disposeComponent( m_xFormatter );
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception caught while disposing row sets.");
+ }
+ m_xRowSet.clear();
+ m_xRowSetMediator.clear();
+
+ if ( m_xReportDefinition.is() )
+ {
+ try
+ {
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow;
+ if ( getDesignView() )
+ pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow )
+ pSectionWindow->getReportSection().deactivateOle();
+ getUndoMgr()->Clear(); // clear all undo redo things
+ if ( m_aReportModel )
+ listen(false);
+ m_pReportControllerObserver->Clear();
+ m_pReportControllerObserver->release();
+ }
+ catch(uno::Exception&)
+ {
+ }
+ }
+
+ {
+ EventObject aDisposingEvent( *this );
+ m_aSelectionListeners.disposeAndClear( aDisposingEvent );
+ }
+
+ OReportController_BASE::disposing();
+
+
+ // disconnect();
+ try
+ {
+ m_xReportDefinition.clear();
+ m_aReportModel.reset();
+ m_xFrameLoader.clear();
+ m_xReportEngine.clear();
+ }
+ catch(uno::Exception&)
+ {
+ }
+ if ( getDesignView() )
+ EndListening( *getDesignView() );
+ clearView();
+}
+// -----------------------------------------------------------------------------
+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();
+ 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() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible();
+ if ( aReturn.bEnabled )
+ aReturn.bEnabled = m_nSelectionCount > 1;
+ break;
+
+ case SID_DISTRIBUTION:
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
+ if ( aReturn.bEnabled )
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ aReturn.bEnabled = pSectionView && pSectionView->GetMarkedObjectCount() > 2;
+ }
+ break;
+ case SID_ARRANGEMENU:
+ case SID_FRAME_DOWN:
+ case SID_FRAME_UP:
+ case SID_FRAME_TO_TOP:
+ case SID_FRAME_TO_BOTTOM:
+ case SID_OBJECT_HEAVEN:
+ case SID_OBJECT_HELL:
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
+ if ( aReturn.bEnabled )
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ aReturn.bEnabled = pSectionView && pSectionView->OnlyShapesMarked();
+ if ( aReturn.bEnabled )
+ {
+ if ( SID_OBJECT_HEAVEN == _nId )
+ aReturn.bEnabled = pSectionView->GetLayerIdOfMarkedObjects() != RPT_LAYER_FRONT;
+ else if ( SID_OBJECT_HELL == _nId )
+ aReturn.bEnabled = pSectionView->GetLayerIdOfMarkedObjects() != RPT_LAYER_BACK;
+ }
+ }
+ break;
+
+ case SID_SECTION_SHRINK:
+ case SID_SECTION_SHRINK_TOP:
+ case SID_SECTION_SHRINK_BOTTOM:
+ {
+ sal_Int32 nCount = 0;
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
+ if ( xSection.is() )
+ {
+ nCount = xSection->getCount();
+ }
+ aReturn.bEnabled = isEditable() && nCount > 0;
+ }
+ 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() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible();
+ break;
+ case SID_CUT:
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
+ break;
+ case SID_COPY:
+ aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
+ break;
+ case SID_PASTE:
+ aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId) && getDesignView()->IsPasteAllowed();
+ break;
+ case SID_SELECTALL:
+ aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
+ break;
+ case SID_SELECTALL_IN_SECTION:
+ aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
+ if ( aReturn.bEnabled )
+ aReturn.bEnabled = getCurrentSectionView() != NULL;
+ break;
+ case SID_ESCAPE:
+ aReturn.bEnabled = getDesignView()->GetMode() == RPTUI_INSERT;
+ break;
+ case SID_TERMINATE_INPLACEACTIVATION:
+ aReturn.bEnabled = sal_True;
+ break;
+ case SID_SELECT_ALL_EDITS:
+ case SID_SELECT_ALL_LABELS:
+ aReturn.bEnabled = sal_True;
+ break;
+ case SID_RPT_NEW_FUNCTION:
+ aReturn.bEnabled = isEditable();
+ break;
+ case SID_COLLAPSE_SECTION:
+ case SID_EXPAND_SECTION:
+ 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() && m_xReportDefinition.is();
+ break;
+ case SID_DELETE:
+ aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
+ if ( aReturn.bEnabled )
+ {
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow )
+ aReturn.bEnabled = !pSectionWindow->getReportSection().isUiActive();
+ }
+ {
+ ::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 = getDesignView()->GetMode() == RPTUI_SELECT;
+ break;
+ case SID_INSERT_DIAGRAM:
+ aReturn.bEnabled = isEditable();
+ aReturn.bInvisible = optional< bool >(!m_bChartEnabled);
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2;
+ break;
+ case SID_FM_FIXEDTEXT:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FIXEDTEXT;
+ break;
+ case SID_INSERT_HFIXEDLINE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_HFIXEDLINE;
+ break;
+ case SID_INSERT_VFIXEDLINE:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_VFIXEDLINE;
+ break;
+ case SID_FM_EDIT:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD;
+ break;
+ case SID_FM_IMAGECONTROL:
+ aReturn.bEnabled = isEditable();
+ aReturn.bChecked = getDesignView()->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:
+ impl_fillCustomShapeState_nothrow("diamond",aReturn);
+ break;
+ case SID_DRAWTBX_CS_SYMBOL:
+ 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:
+ impl_fillCustomShapeState_nothrow("smiley",aReturn);
+ break;
+ case SID_DRAWTBX_CS_ARROW:
+ 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:
+ impl_fillCustomShapeState_nothrow("left-right-arrow",aReturn);
+ break;
+ case SID_DRAWTBX_CS_STAR:
+ 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:
+ impl_fillCustomShapeState_nothrow("star5",aReturn);
+ break;
+ case SID_DRAWTBX_CS_FLOWCHART:
+ 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:
+ impl_fillCustomShapeState_nothrow("flowchart-internal-storage",aReturn);
+ break;
+ case SID_DRAWTBX_CS_CALLOUT:
+ 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:
+ impl_fillCustomShapeState_nothrow("round-rectangular-callout",aReturn);
+ break;
+ case SID_RPT_SHOWREPORTEXPLORER:
+ aReturn.bEnabled = m_xReportDefinition.is();
+ aReturn.bChecked = getDesignView() && getDesignView()->isReportExplorerVisible();
+ break;
+ case SID_FM_ADD_FIELD:
+ aReturn.bEnabled = isConnected() && isEditable() && m_xReportDefinition.is()
+ && m_xReportDefinition->getCommand().getLength();
+ aReturn.bChecked = getDesignView() && getDesignView()->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 = impl_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:
+ impl_fillState_nothrow(PROPERTY_CONTROLBACKGROUND,aReturn);
+ break;
+ case SID_ATTR_CHAR_COLOR_BACKGROUND:
+ aReturn.bEnabled = isEditable();
+ {
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
+ if ( xSection.is() )
+ try
+ {
+ aReturn.aValue <<= xSection->getBackColor();
+ const uno::Reference< report::XReportControlModel> xControlModel(getDesignView()->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:
+ impl_fillState_nothrow(PROPERTY_FONTDESCRIPTOR,aReturn);
+ if ( aReturn.bEnabled )
+ {
+ awt::FontDescriptor aFontDescriptor;
+ aReturn.aValue >>= aFontDescriptor;
+ aReturn.aValue.clear();
+
+ switch(_nId)
+ {
+ case SID_ATTR_CHAR_WEIGHT:
+ aReturn.bChecked = awt::FontWeight::BOLD == aFontDescriptor.Weight;
+ break;
+ case SID_ATTR_CHAR_POSTURE:
+ aReturn.bChecked = awt::FontSlant_ITALIC == aFontDescriptor.Slant;
+ break;
+ case SID_ATTR_CHAR_UNDERLINE:
+ aReturn.bChecked = awt::FontUnderline::SINGLE == aFontDescriptor.Underline;
+ break;
+ default:
+ ;
+ } // switch(_nCommand)
+ }
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ case SID_ATTR_CHAR_COLOR2:
+ impl_fillState_nothrow(PROPERTY_CHARCOLOR,aReturn);
+ break;
+ case SID_ATTR_CHAR_FONT:
+ impl_fillState_nothrow(PROPERTY_FONTDESCRIPTOR,aReturn);
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ impl_fillState_nothrow(PROPERTY_CHARHEIGHT,aReturn);
+ if ( aReturn.aValue.hasValue() )
+ {
+ frame::status::FontHeight aFontHeight;
+ aReturn.aValue >>= aFontHeight.Height;
+ aReturn.aValue <<= aFontHeight; // another type is needed here, so
+ }
+ break;
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ case SID_ATTR_PARA_ADJUST_BLOCK:
+ impl_fillState_nothrow(PROPERTY_PARAADJUST,aReturn);
+ if ( aReturn.bEnabled )
+ {
+ ::sal_Int16 nParaAdjust = 0;
+ if ( aReturn.aValue >>= nParaAdjust )
+ {
+ switch(nParaAdjust)
+ {
+ case style::ParagraphAdjust_LEFT:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_LEFT;
+ break;
+ case style::ParagraphAdjust_RIGHT:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_RIGHT;
+ break;
+ case style::ParagraphAdjust_BLOCK:
+ case style::ParagraphAdjust_STRETCH:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_BLOCK;
+ break;
+ case style::ParagraphAdjust_CENTER:
+ aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_CENTER;
+ break;
+ }
+ } // if ( aReturn.aValue >>= nParaAdjust )
+ aReturn.aValue.clear();
+ }
+ break;
+
+ case SID_INSERT_GRAPHIC:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
+ break;
+ case SID_CHAR_DLG:
+ case SID_SETCONTROLDEFAULTS:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable();// && getDesignView()->getCurrentControlModel().is();
+ if ( aReturn.bEnabled )
+ {
+ ::std::vector< uno::Reference< uno::XInterface > > aSelection;
+ getDesignView()->fillControlModelSelection(aSelection);
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
+ for(; aIter != aSelection.end()
+ && !uno::Reference< report::XFixedLine >(*aIter,uno::UNO_QUERY).is()
+ && !uno::Reference< report::XImageControl >(*aIter,uno::UNO_QUERY).is()
+ && uno::Reference< report::XReportControlFormat >(*aIter,uno::UNO_QUERY).is() ;++aIter)
+ ;
+ aReturn.bEnabled = !aSelection.empty() && aIter == aSelection.end();
+ }
+ break;
+ case SID_CONDITIONALFORMATTING:
+ {
+ const uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
+ aReturn.bEnabled = xFormattedField.is();
+ }
+ break;
+ case SID_INSERT_FLD_PGNUMBER:
+ case SID_DATETIME:
+ aReturn.bEnabled = m_xReportDefinition.is() && isEditable() && getDesignView()->getCurrentSection().is();
+ break;
+ case SID_EXPORTDOC:
+ case SID_EXPORTDOCASPDF:
+ aReturn.bEnabled = m_xReportDefinition.is();
+ break;
+ case SID_PRINTPREVIEW:
+ aReturn.bEnabled = sal_False;
+ break;
+ case SID_ATTR_ZOOM:
+ aReturn.bEnabled = sal_True;
+ {
+ SvxZoomItem aZoom(m_eZoomType,m_nZoomValue);
+ aZoom.SetValueSet(SVX_ZOOM_ENABLE_50|SVX_ZOOM_ENABLE_75|SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_200);
+ aZoom.QueryValue(aReturn.aValue);
+ //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue);
+ }
+ break;
+ case SID_ATTR_ZOOMSLIDER:
+ aReturn.bEnabled = sal_True;
+ {
+ SvxZoomSliderItem aZoomSlider(m_nZoomValue,20,400);
+ aZoomSlider.AddSnappingPoint(50);
+ aZoomSlider.AddSnappingPoint(75);
+ aZoomSlider.AddSnappingPoint(100);
+ aZoomSlider.AddSnappingPoint(200);
+ aZoomSlider.QueryValue(aReturn.aValue);
+ //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue);
+ }
+ 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( getMutex() );
+
+ 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:
+ case SID_UNDO:
+ {
+ // const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
+ // We would like to know if we are in undo mode
+ const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() );
+ OReportController_BASE::Execute( _nId, aArgs );
+ InvalidateAll();
+ updateFloater();
+ }
+ break;
+ case SID_CUT:
+ executeMethodWithUndo(RID_STR_UNDO_REMOVE_SELECTION,::std::mem_fun(&ODesignView::Cut));
+ break;
+ case SID_COPY:
+ getDesignView()->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_SECTION_SHRINK_BOTTOM:
+ case SID_SECTION_SHRINK_TOP:
+ case SID_SECTION_SHRINK:
+ {
+ uno::Reference<report::XSection> xSection = getDesignView()->getCurrentSection();
+ shrinkSection(RID_STR_UNDO_SHRINK, xSection, _nId);
+ }
+ break;
+
+ case SID_SELECTALL:
+ getDesignView()->SelectAll(OBJ_NONE);
+ break;
+ case SID_SELECTALL_IN_SECTION:
+ {
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ pSectionView->MarkAll();
+ }
+ break;
+ case SID_ESCAPE:
+ getDesignView()->SetMode(RPTUI_SELECT);
+ InvalidateFeature( SID_OBJECT_SELECT );
+ break;
+ case SID_SELECT_ALL_EDITS:
+ getDesignView()->SelectAll(OBJ_DLG_FORMATTEDFIELD);
+ break;
+ case SID_SELECT_ALL_LABELS:
+ getDesignView()->SelectAll(OBJ_DLG_FIXEDTEXT);
+ break;
+ case SID_TERMINATE_INPLACEACTIVATION:
+ {
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ if ( pSection )
+ pSection->getReportSection().deactivateOle();
+ }
+ 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_COLLAPSE_SECTION:
+ collapseSection(true);
+ break;
+ case SID_EXPAND_SECTION:
+ collapseSection(false);
+ 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);
+ const String sUndoAction = String((ModuleRes(RID_STR_UNDO_REMOVE_FUNCTION)));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ xFunctions->removeByIndex(nIndex);
+ 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:
+ getDesignView()->setGridSnap(m_bGridUse = !m_bGridUse);
+ break;
+ case SID_HELPLINES_MOVE:
+ getDesignView()->setDragStripes(m_bHelplinesMove = !m_bHelplinesMove);
+ break;
+ case SID_GRID_VISIBLE:
+ getDesignView()->toggleGrid(m_bGridVisible = !m_bGridVisible);
+ break;
+ case SID_RULER:
+ getDesignView()->showRuler(m_bShowRuler = !m_bShowRuler);
+ break;
+ case SID_OBJECT_SELECT:
+ getDesignView()->SetMode(RPTUI_SELECT);
+ InvalidateAll();
+ break;
+ case SID_INSERT_DIAGRAM:
+ /*{
+ OSectionView* pView = getCurrentSectionView();
+ if ( pView )
+ {
+ Reference< awt::XWindow> xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent());
+ InsertChart(m_xContext,m_xReportDefinition.get(),xWindow,pView,getSdrModel().get());
+ }
+ }*/
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_OLE2);
+ createDefaultControl(aArgs);
+ InvalidateAll();
+ break;
+ case SID_FM_FIXEDTEXT:
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT );
+ createDefaultControl(aArgs);
+ InvalidateAll();
+ break;
+ case SID_INSERT_HFIXEDLINE:
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE );
+ createDefaultControl(aArgs);
+ InvalidateAll();
+ break;
+ case SID_INSERT_VFIXEDLINE:
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE );
+ createDefaultControl(aArgs);
+ InvalidateAll();
+ break;
+ case SID_FM_EDIT:
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD );
+ createDefaultControl(aArgs);
+ InvalidateAll();
+ break;
+ case SID_FM_IMAGECONTROL:
+ getDesignView()->SetMode( RPTUI_INSERT );
+ getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROL );
+ createDefaultControl(aArgs);
+ 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:
+ getDesignView()->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);
+
+ getDesignView()->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
+ createDefaultControl(aArgs);
+ }
+ InvalidateAll();
+ break;
+ case SID_RPT_SHOWREPORTEXPLORER:
+ if ( isUiVisible() )
+ getDesignView()->toggleReportExplorer();
+ break;
+ case SID_FM_ADD_FIELD:
+ if ( isUiVisible() )
+ getDesignView()->toggleAddField();
+ break;
+ case SID_SHOW_PROPERTYBROWSER:
+ if ( m_bShowProperties )
+ m_sLastActivePage = getDesignView()->getCurrentPage();
+ else
+ getDesignView()->setCurrentPage(m_sLastActivePage);
+
+ if ( isUiVisible() )
+ {
+ m_bShowProperties = !m_bShowProperties;
+ if ( aArgs.getLength() == 1 )
+ aArgs[0].Value >>= m_bShowProperties;
+
+ getDesignView()->togglePropertyBrowser(m_bShowProperties);
+ }
+ break;
+ case SID_PROPERTYBROWSER_LAST_PAGE: // nothing to do
+ m_sLastActivePage = getDesignView()->getCurrentPage();
+ break;
+ case SID_SPLIT_POSITION:
+ getDesignView()->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:
+ {
+ const util::Color aColor( lcl_extractBackgroundColor( aArgs ) );
+ if ( !impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CONTROLBACKGROUND,uno::makeAny(aColor),aArgs) )
+ {
+ uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
+ if ( xSection.is() )
+ {
+ xSection->setBackColor( aColor );
+ }
+ }
+ bForceBroadcast = sal_True;
+ }
+ break;
+ case SID_ATTR_CHAR_WEIGHT:
+ case SID_ATTR_CHAR_POSTURE:
+ case SID_ATTR_CHAR_UNDERLINE:
+ {
+ ::std::auto_ptr<UndoManagerListAction> pListAction;
+ uno::Reference< awt::XWindow> xWindow;
+ ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
+ lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
+ bool bMulti = aControlsFormats.size() > 1;
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin();
+ for(; aIter != aControlsFormats.end();++aIter)
+ {
+ if ( !pListAction.get() && bMulti)
+ {
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT));
+ pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction));
+ } // if ( !pListAction.get() )
+ uno::Reference< report::XReportControlFormat> xReportControlFormat(*aIter,uno::UNO_QUERY);
+ lcl_setFontWPU_nothrow(xReportControlFormat,_nId);
+ }
+ }
+ break;
+ case SID_ATTR_CHAR_COLOR:
+ case SID_ATTR_CHAR_COLOR2:
+ {
+ const SequenceAsHashMap aMap(aArgs);
+ const util::Color aColor = aMap.getUnpackedValueOrDefault(PROPERTY_FONTCOLOR,util::Color());
+ impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CHARCOLOR,uno::makeAny(aColor),aArgs);
+ bForceBroadcast = sal_True;
+ }
+ break;
+ case SID_ATTR_CHAR_FONT:
+ if ( aArgs.getLength() == 1 )
+ {
+ awt::FontDescriptor aFont;
+ if ( aArgs[0].Value >>= aFont )
+ {
+ impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CHARFONTNAME,uno::makeAny(aFont.Name),aArgs);
+ } // if ( aArgs[0].Value >>= aFont )
+ }
+ break;
+ case SID_ATTR_CHAR_FONTHEIGHT:
+ if ( aArgs.getLength() == 1 )
+ {
+ float fSelVal = 0.0;
+ if ( aArgs[0].Value >>= fSelVal )
+ impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CHARHEIGHT,aArgs[0].Value,aArgs);
+ }
+ break;
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ case SID_ATTR_PARA_ADJUST_BLOCK:
+ {
+ sal_Int16 eParagraphAdjust = style::ParagraphAdjust_LEFT;
+ switch(_nId)
+ {
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ eParagraphAdjust = style::ParagraphAdjust_LEFT;
+ break;
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ eParagraphAdjust = style::ParagraphAdjust_CENTER;
+ break;
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ eParagraphAdjust = style::ParagraphAdjust_RIGHT;
+ break;
+ case SID_ATTR_PARA_ADJUST_BLOCK:
+ eParagraphAdjust = style::ParagraphAdjust_BLOCK;
+ break;
+ } // switch(_nId)
+ impl_setPropertyAtControls_throw(RID_STR_UNDO_ALIGNMENT,PROPERTY_PARAADJUST,uno::makeAny(eParagraphAdjust),aArgs);
+
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT);
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_CENTER);
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_RIGHT);
+ InvalidateFeature(SID_ATTR_PARA_ADJUST_BLOCK);
+ }
+ break;
+ case SID_CHAR_DLG:
+ {
+ ::std::auto_ptr<UndoManagerListAction> pListAction;
+ uno::Sequence< beans::NamedValue > aSettings;
+ uno::Reference< awt::XWindow> xWindow;
+ ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats;
+ lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats );
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin();
+ for(; aIter != aControlsFormats.end();++aIter)
+ {
+ uno::Reference< report::XReportControlFormat > xFormat(*aIter,uno::UNO_QUERY);
+ if ( xFormat.is() )
+ {
+ if ( !pListAction.get() )
+ {
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT));
+ pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction));
+ rptui::openCharDialog(xFormat,xWindow,aSettings);
+ } // if ( !pListAction.get() )
+ applyCharacterSettings( xFormat, aSettings );
+ }
+ } // for(; aIter != aControlsFormats.end();++aIter)
+ if ( !aControlsFormats.empty() )
+ 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(getDesignView()->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(),getDesignView()->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_EXPORTDOC:
+ case SID_EXPORTDOCASPDF:
+ break;
+ case SID_PRINTPREVIEW:
+ if ( m_xReportDefinition.is() )
+ {
+ }
+ 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:
+ break;
+ case SID_ATTR_ZOOM:
+ if ( aArgs.getLength() == 0 )
+ {
+ openZoomDialog();
+ }
+ else if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") )
+ {
+ SvxZoomItem aZoomItem;
+ aZoomItem.PutValue(aArgs[0].Value);
+ m_nZoomValue = aZoomItem.GetValue();
+ m_eZoomType = aZoomItem.GetType();
+ impl_zoom_nothrow();
+ } // if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") )
+ break;
+ case SID_ATTR_ZOOMSLIDER:
+ if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("ZoomSlider") )
+ {
+ SvxZoomSliderItem aZoomSlider;
+ aZoomSlider.PutValue(aArgs[0].Value);
+ m_nZoomValue = aZoomSlider.GetValue();
+ m_eZoomType = SVX_ZOOM_PERCENT;
+ impl_zoom_nothrow();
+ }
+ break;
+ default:
+ OReportController_BASE::Execute(_nId,aArgs);
+ }
+ InvalidateFeature(_nId,Reference< XStatusListener >(),bForceBroadcast);
+}
+// -----------------------------------------------------------------------------
+short OReportController::saveModified()
+{
+ return RET_NO;
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::impl_initialize( )
+{
+ OReportController_BASE::impl_initialize();
+
+ const ::comphelper::NamedValueCollection& rArguments( getInitParams() );
+
+ rArguments.get_ensureType( (::rtl::OUString)PROPERTY_REPORTNAME, m_sName );
+ if ( !m_sName.getLength() )
+ rArguments.get_ensureType( "DocumentTitle", m_sName );
+
+ 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();
+
+ ::comphelper::NamedValueCollection aArgs(getModel()->getArgs());
+ setMode(aArgs.getOrDefault("Mode", rtl::OUString::createFromAscii("normal")));
+
+ listen(true);
+ setEditable( !m_aReportModel->IsReadOnly() );
+ m_xFormatter.set(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY);
+ m_xFormatter->attachNumberFormatsSupplier(Reference< XNumberFormatsSupplier>(m_xReportDefinition,uno::UNO_QUERY));
+
+ ::comphelper::MediaDescriptor aDescriptor( m_xReportDefinition->getArgs() );
+ ::rtl::OUString sHierarchicalDocumentName;
+ sHierarchicalDocumentName = aDescriptor.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),sHierarchicalDocumentName);
+
+ if ( !sHierarchicalDocumentName.getLength() && getConnection().is() )
+ {
+ uno::Reference<sdbcx::XTablesSupplier> xTablesSup(getConnection(),uno::UNO_QUERY_THROW);
+ uno::Reference<container::XNameAccess> xTables = xTablesSup->getTables();
+ const uno::Sequence< ::rtl::OUString > aNames( xTables->getElementNames() );
+
+ if ( aNames.hasElements() )
+ {
+ m_xReportDefinition->setCommand(aNames[0]);
+ m_xReportDefinition->setCommandType(sdb::CommandType::TABLE);
+ }
+ } // if ( !sHierarchicalDocumentName.getLength() && getConnection().is() )
+
+ m_aVisualAreaSize = m_xReportDefinition->getVisualAreaSize(0);
+
+ } // if ( m_xReportDefinition.is() )
+
+ // check if chart is supported by the engine
+ checkChartEnabled();
+ // restore the view data
+ getDesignView()->toggleGrid(m_bGridVisible);
+ getDesignView()->showRuler(m_bShowRuler);
+ getDesignView()->togglePropertyBrowser(m_bShowProperties);
+ getDesignView()->setCurrentPage(m_sLastActivePage);
+ getDesignView()->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;
+ }
+ getDesignView()->collapseSections(m_aCollapsedSections);
+ impl_zoom_nothrow();
+ getDesignView()->Resize();
+ getDesignView()->Invalidate();
+ InvalidateAll();
+
+ if ( m_bShowProperties && m_nPageNum == -1 )
+ {
+ m_sLastActivePage = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"));
+ getDesignView()->setCurrentPage(m_sLastActivePage);
+ uno::Sequence< beans::PropertyValue> aArgs;
+ executeUnChecked(SID_SELECT_REPORT,aArgs);
+ } // if ( m_bShowProperties && m_nPageNum == -1 )
+
+ setModified(sal_False); // and we are not modified yet
+
+ // open the global help agent
+ // we need a Frame but at this time there is no frame, therefore we send a UserEvent
+ getView()->PostUserEvent(LINK(this, OReportController, OnOpenHelpAgent));
+ }
+ catch(const SQLException&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnOpenHelpAgent, void* ,/*_pMemfun*/)
+{
+ //m_nExecuteReportEvent = 0;
+ doOpenHelpAgent();
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow* ,_pAddFieldDlg)
+{
+ WaitObject aObj( getDesignView() );
+ uno::Sequence< beans::PropertyValue > aArgs = _pAddFieldDlg->getSelectedFieldDescriptors();
+ // we use this way to create undo actions
+ if ( aArgs.getLength() )
+ {
+ executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
+ }
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+
+void OReportController::doOpenHelpAgent()
+{
+ if (getFrame().is())
+ {
+ rtl::OUString suURL = rtl::OUString::createFromAscii("vnd.sun.star.help://shared/text/shared/explorer/database/rep_main.xhp?UseDB=no&DbPAR=swriter");
+ openHelpAgent(suURL);
+ // openHelpAgent(68245 /* HID_REPORT_DESIGN... UNKNOWN */ );
+ // HID_APP_REPORT_TREE
+ }
+ else
+ {
+ // as long as we don't get a Frame, we send the user event again.
+ getView()->PostUserEvent(LINK(this, OReportController, OnOpenHelpAgent));
+ }
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportController::Construct(Window* pParent)
+{
+ ODesignView* pMyOwnView = new ODesignView( pParent, getORB(), *this );
+ StartListening( *pMyOwnView );
+ setView( *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( getMutex() );
+
+ if ( getView() && getView()->IsInModalMode() )
+ return sal_False;
+
+ // this suspend will be handled in the DBAccess interceptor implementation
+ return sal_True;
+}
+// -----------------------------------------------------------------------------
+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:ZoomSlider", SID_ATTR_ZOOMSLIDER, CommandGroup::VIEW );
+ implDescribeSupportedFeature( ".uno:Zoom", SID_ATTR_ZOOM, CommandGroup::VIEW );
+ //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW );
+
+ 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:JustifyPara", SID_ATTR_PARA_ADJUST_BLOCK, 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:SectionShrink", SID_SECTION_SHRINK, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionShrinkTop", SID_SECTION_SHRINK_TOP, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SectionShrinkBottom", SID_SECTION_SHRINK_BOTTOM, 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 );
+
+ 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 );
+ // 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);
+ implDescribeSupportedFeature( ".uno:TerminateInplaceActivation", SID_TERMINATE_INPLACEACTIVATION);
+ implDescribeSupportedFeature( ".uno:SelectAllLabels", SID_SELECT_ALL_LABELS);
+ implDescribeSupportedFeature( ".uno:SelectAllEdits", SID_SELECT_ALL_EDITS);
+ implDescribeSupportedFeature( ".uno:CollapseSection", SID_COLLAPSE_SECTION);
+ implDescribeSupportedFeature( ".uno:ExpandSection", SID_EXPAND_SECTION);
+}
+// -----------------------------------------------------------------------------
+SfxUndoManager* OReportController::getUndoMgr()
+{
+ return &m_aUndoManager;
+}
+// -----------------------------------------------------------------------------
+void OReportController::impl_onModifyChanged()
+{
+ try
+ {
+ if ( m_xReportDefinition.is() )
+ m_xReportDefinition->setModified( impl_isModified() );
+ OSingleDocumentController::impl_onModifyChanged();
+ }
+ catch(uno::Exception)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::losingConnection( )
+{
+ // let the base class do it's reconnect
+ OReportController_BASE::losingConnection( );
+
+ InvalidateAll();
+}
+// -----------------------------------------------------------------------------
+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/drawbar"))
+ ,::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"))
+ ,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/toolbar/sectionshrinkbar"))
+ };
+ 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( getMutex() );
+ 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 (_bShow)
+ {
+ m_pReportControllerObserver->AddSection(xGroup->getHeader());
+ }
+ else
+ {
+ m_pReportControllerObserver->RemoveSection(xGroup->getHeader());
+ }
+ }
+ if ( xGroup->getFooterOn() )
+ {
+ groupChange(xGroup,PROPERTY_FOOTERON,nGroupPos,_bShow);
+ if (_bShow)
+ {
+ m_pReportControllerObserver->AddSection(xGroup->getFooter());
+ }
+ else
+ {
+ m_pReportControllerObserver->RemoveSection(xGroup->getFooter());
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+// ::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( getMutex() );
+ 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( getMutex() );
+ 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 )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition);
+ m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportHeader());
+ }
+ else
+ {
+ getDesignView()->removeSection(nPosition);
+ }
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) )
+ {
+ USHORT nPosition = getDesignView()->getSectionCount();
+ if ( m_xReportDefinition->getPageFooterOn() )
+ --nPosition;
+ if ( bShow )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER,nPosition);
+ m_pReportControllerObserver->AddSection(m_xReportDefinition->getReportFooter());
+ }
+ else
+ {
+ getDesignView()->removeSection(nPosition - 1);
+ }
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_PAGEHEADERON ) )
+ {
+ if ( bShow )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,0);
+ m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageHeader());
+ }
+ else
+ {
+ getDesignView()->removeSection(USHORT(0));
+ }
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) )
+ {
+ if ( bShow )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+ m_pReportControllerObserver->AddSection(m_xReportDefinition->getPageFooter());
+ }
+ else
+ {
+ getDesignView()->removeSection(getDesignView()->getSectionCount() - 1);
+ }
+ }
+ else if ( evt.PropertyName.equals( PROPERTY_COMMAND )
+ || evt.PropertyName.equals( PROPERTY_COMMANDTYPE )
+ || evt.PropertyName.equals( PROPERTY_ESCAPEPROCESSING )
+ || evt.PropertyName.equals( PROPERTY_FILTER )
+ )
+ {
+ m_xColumns.clear();
+ m_xHoldAlive.clear();
+ InvalidateFeature(SID_FM_ADD_FIELD);
+ if ( !getDesignView()->isAddFieldVisible() && isUiVisible() )
+ getDesignView()->toggleAddField();
+ }
+ /// TODO: check what we need to notify here TitleHelper
+ /*else if ( evt.PropertyName.equals( PROPERTY_CAPTION ) )
+ updateTitle();*/
+ } // 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)
+{
+ OReportController_BASE::disposing(Source);
+}
+
+// -----------------------------------------------------------------------------
+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 = getDesignView()->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);
+ getDesignView()->addSection(pMemFunSection(&aGroupHelper),sColor,nPosition);
+ }
+ else
+ {
+ getDesignView()->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;
+}
+// -----------------------------------------------------------------------------
+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,PAPER_A4),
+ new SfxAllEnumItem(RPTUI_ID_END,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,
+ 0
+ };
+ 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
+
+ try
+ {
+ ::std::auto_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
+ // fill it
+ if ( _xSection.is() )
+ pDescriptor->Put(SvxBrushItem(::Color(_xSection->getBackColor()),ITEMID_BRUSH));
+ else
+ {
+ 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());
+ uno::Reference<beans::XPropertySet> xProp(xPageStyle,uno::UNO_QUERY_THROW);
+ aPageItem.PutValue(xProp->getPropertyValue(PROPERTY_PAGESTYLELAYOUT),MID_PAGE_LAYOUT);
+ 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
+ {
+ uno::Reference< beans::XPropertySet> xProp(getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW);
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEPAGE));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ 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();
+ uno::Any aValue;
+ static_cast<const SvxSizeItem*>(pItem)->QueryValue(aValue,MID_SIZE_SIZE);
+ xProp->setPropertyValue(PROPERTY_PAPERSIZE,aValue);
+ resetZoomType();
+ }
+
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_LRSPACE,sal_True,&pItem))
+ {
+ xProp->setPropertyValue(PROPERTY_LEFTMARGIN,uno::makeAny(static_cast<const SvxLRSpaceItem*>(pItem)->GetLeft()));
+ xProp->setPropertyValue(PROPERTY_RIGHTMARGIN,uno::makeAny(static_cast<const SvxLRSpaceItem*>(pItem)->GetRight()));
+ }
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_ULSPACE,sal_True,&pItem))
+ {
+ xProp->setPropertyValue(PROPERTY_TOPMARGIN,uno::makeAny(static_cast<const SvxULSpaceItem*>(pItem)->GetUpper()));
+ xProp->setPropertyValue(PROPERTY_BOTTOMMARGIN,uno::makeAny(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);
+ xProp->setPropertyValue(PROPERTY_ISLANDSCAPE,uno::makeAny(static_cast<sal_Bool>(pPageItem->IsLandscape())));
+ xProp->setPropertyValue(PROPERTY_NUMBERINGTYPE,uno::makeAny(static_cast<sal_Int16>(pPageItem->GetNumType())));
+ uno::Any aValue;
+ pPageItem->QueryValue(aValue,MID_PAGE_LAYOUT);
+ xProp->setPropertyValue(PROPERTY_PAGESTYLELAYOUT,aValue);
+ resetZoomType();
+ }
+ if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_BRUSH,sal_True,&pItem))
+ {
+ ::Color aBackColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
+ xProp->setPropertyValue(PROPERTY_BACKTRANSPARENT,uno::makeAny(aBackColor == COL_TRANSPARENT));
+ xProp->setPropertyValue(PROPERTY_BACKCOLOR,uno::makeAny(aBackColor.GetColor()));
+ }
+ }
+ }
+ }
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ SfxItemPool::Free(pPool);
+
+ 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( getMutex() );
+ 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);
+ SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_GROUPS_SORTING ) );
+ if ( aDlgOpt.Exists() )
+ m_pGroupsFloater->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
+ m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl));
+ }
+ else if ( isUiVisible() )
+ 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;
+}
+// -----------------------------------------------------------------------------
+void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHint)
+{
+ if (_rHint.ISA(DlgEdHint)
+ && (static_cast< DlgEdHint const & >(_rHint).GetKind()
+ == RPTUI_HINT_SELECTIONCHANGED))
+ {
+ const sal_Int32 nSelectionCount = getDesignView()->getMarkedObjectCount();
+ if ( m_nSelectionCount != nSelectionCount )
+ {
+ m_nSelectionCount = nSelectionCount;
+ 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 sUndoAction = String((ModuleRes(_nUndoStrId)));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ _pMemfun( getDesignView() );
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+}
+// -----------------------------------------------------------------------------
+void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection)
+{
+ const String sUndoAction = String((ModuleRes(_nUndoStrId)));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+ getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection);
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+}
+// -----------------------------------------------------------------------------
+void OReportController::shrinkSectionBottom(uno::Reference<report::XSection> _xSection)
+{
+ const sal_Int32 nElements = _xSection->getCount();
+ if (nElements == 0)
+ {
+ // there are no elements
+ return;
+ }
+ const sal_Int32 nSectionHeight = _xSection->getHeight();
+ // sal_Int32 nMinPositionY = nSectionHeight;
+ sal_Int32 nMaxPositionY = 0;
+ uno::Reference< report::XReportComponent> xReportComponent;
+
+ // for every component get it's Y-position and compare it to the current Y-position
+ for (int i=0;i<nElements;i++)
+ {
+ xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
+ const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
+ const sal_Int32 nReportComponentHeight = xReportComponent->getHeight();
+ const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight;
+ // nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY);
+ nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY);
+ }
+ // now we know the minimal Y-Position and maximal Y-Position
+
+ if (nMaxPositionY > (nSectionHeight - 7) ) // Magic Number, we use a little bit less heights for right positioning
+ {
+ // the lowest position is already 0
+ return;
+ }
+ _xSection->setHeight(nMaxPositionY);
+}
+
+void OReportController::shrinkSectionTop(uno::Reference<report::XSection> _xSection)
+{
+ const sal_Int32 nElements = _xSection->getCount();
+ if (nElements == 0)
+ {
+ // there are no elements
+ return;
+ }
+
+ const sal_Int32 nSectionHeight = _xSection->getHeight();
+ sal_Int32 nMinPositionY = nSectionHeight;
+ // sal_Int32 nMaxPositionY = 0;
+ uno::Reference< report::XReportComponent> xReportComponent;
+
+ // for every component get it's Y-position and compare it to the current Y-position
+ for (int i=0;i<nElements;i++)
+ {
+ xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
+ const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
+ // const sal_Int32 nReportComponentHeight = xReportComponent->getHeight();
+ // const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight;
+ nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY);
+ // nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY);
+ }
+ // now we know the minimal Y-Position and maximal Y-Position
+ if (nMinPositionY == 0)
+ {
+ // the lowest position is already 0
+ return;
+ }
+ for (int i=0;i<nElements;i++)
+ {
+ xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY);
+ const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY();
+ const sal_Int32 nNewPositionY = nReportComponentPositionY - nMinPositionY;
+ xReportComponent->setPositionY(nNewPositionY);
+ }
+ const sal_Int32 nNewSectionHeight = nSectionHeight - nMinPositionY;
+ _xSection->setHeight(nNewSectionHeight);
+}
+
+void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report::XSection> _xSection, sal_Int32 _nSid)
+{
+ if ( _xSection.is() )
+ {
+ const String sUndoAction = String((ModuleRes(_nUndoStrId)));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+
+ if (_nSid == SID_SECTION_SHRINK)
+ {
+ shrinkSectionTop(_xSection);
+ shrinkSectionBottom(_xSection);
+ }
+ else if (_nSid == SID_SECTION_SHRINK_TOP)
+ {
+ shrinkSectionTop(_xSection);
+ }
+ else if (_nSid == SID_SECTION_SHRINK_BOTTOM)
+ {
+ shrinkSectionBottom(_xSection);
+ }
+ }
+
+ InvalidateFeature( SID_SAVEDOC );
+ InvalidateFeature( SID_UNDO );
+}
+
+// -----------------------------------------------------------------------------
+uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+
+ sal_Int32 nCommandIDs[] =
+ {
+ SID_GRID_VISIBLE,
+ SID_GRID_USE,
+ SID_HELPLINES_MOVE,
+ SID_RULER,
+ SID_SHOW_PROPERTYBROWSER,
+ SID_PROPERTYBROWSER_LAST_PAGE,
+ SID_SPLIT_POSITION
+ };
+
+ ::comphelper::NamedValueCollection aCommandProperties;
+ for ( size_t i=0; i < sizeof( nCommandIDs ) / sizeof( nCommandIDs[0] ); ++i )
+ {
+ const FeatureState aFeatureState = GetState( nCommandIDs[i] );
+
+ ::rtl::OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main );
+ OSL_ENSURE( sCommandURL.indexOfAsciiL( ".uno:", 5 ) == 0, "OReportController::getViewData: illegal command URL!" );
+ sCommandURL = sCommandURL.copy( 5 );
+
+ Any aCommandState;
+ if ( !!aFeatureState.bChecked )
+ aCommandState <<= (*aFeatureState.bChecked) ? sal_True : sal_False;
+ else if ( aFeatureState.aValue.hasValue() )
+ aCommandState = aFeatureState.aValue;
+
+ aCommandProperties.put( sCommandURL, aCommandState );
+ }
+
+ ::comphelper::NamedValueCollection aViewData;
+ aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() );
+
+ if ( getDesignView() )
+ {
+ ::std::vector<sal_uInt16> aCollapsedPositions;
+ getDesignView()->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);
+ }
+
+ aViewData.put( "CollapsedSections", aCollapsedSections );
+ }
+
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow.get() )
+ {
+ aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() );
+ } // if ( pSectionWindow.get() )
+ } // if ( getDesignView() )
+
+ aViewData.put( "ZoomFactor", m_nZoomValue );
+ return uno::makeAny( aViewData.getPropertyValues() );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data) throw( uno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+
+ try
+ {
+ const ::comphelper::NamedValueCollection aViewData( i_data );
+
+ m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections );
+ m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum );
+ m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue );
+ // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the
+ // view is fully alive, so we need to reflect those 3 values in the view.
+ // (At the moment, the method is called only during construction phase)
+
+
+ ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) );
+ const ::std::vector< ::rtl::OUString > aCommandNames( aCommandProperties.getNames() );
+
+ for ( ::std::vector< ::rtl::OUString >::const_iterator commandName = aCommandNames.begin();
+ commandName != aCommandNames.end();
+ ++commandName
+ )
+ {
+ const Any& rCommandValue = aCommandProperties.get( *commandName );
+ if ( !rCommandValue.hasValue() )
+ continue;
+
+ if ( getView() )
+ {
+ util::URL aCommand;
+ aCommand.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + *commandName;
+
+ Sequence< PropertyValue > aCommandArgs(1);
+ aCommandArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) );
+ aCommandArgs[0].Value = rCommandValue;
+
+ executeUnChecked( aCommand, aCommandArgs );
+ }
+ else
+ {
+ if ( commandName->equalsAscii( "ShowRuler" ) )
+ OSL_VERIFY( rCommandValue >>= m_bShowRuler );
+ else if ( commandName->equalsAscii( "HelplinesMove" ) )
+ OSL_VERIFY( rCommandValue >>= m_bHelplinesMove );
+ else if ( commandName->equalsAscii( "GridVisible" ) )
+ OSL_VERIFY( rCommandValue >>= m_bGridVisible );
+ else if ( commandName->equalsAscii( "GridUse" ) )
+ OSL_VERIFY( rCommandValue >>= m_bGridUse );
+ else if ( commandName->equalsAscii( "ControlProperties" ) )
+ OSL_VERIFY( rCommandValue >>= m_bShowProperties );
+ else if ( commandName->equalsAscii( "LastPropertyBrowserPage" ) )
+ OSL_VERIFY( rCommandValue >>= m_sLastActivePage );
+ else if ( commandName->equalsAscii( "SplitPosition" ) )
+ OSL_VERIFY( rCommandValue >>= m_nSplitPos );
+ }
+ }
+ }
+ catch ( const IllegalArgumentException& e )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+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()
+{
+ OSL_ENSURE(m_xReportDefinition.is(),"Where is my report?");
+
+ uno::Reference<frame::XModel> xModel;
+ if ( m_xReportDefinition.is() )
+ {
+ sal_uInt16 nErrorId = RID_ERR_NO_COMMAND;
+ bool bEnabled = m_xReportDefinition->getCommand().getLength() != 0;
+ if ( bEnabled )
+ {
+ bEnabled = false;
+ const sal_uInt16 nCount = m_aReportModel->GetPageCount();
+ sal_uInt16 i = 0;
+ for (; i < nCount && !bEnabled ; ++i)
+ {
+ const SdrPage* pPage = m_aReportModel->GetPage(i);
+ bEnabled = pPage->GetObjCount() != 0;
+ }
+ if ( !bEnabled )
+ nErrorId = RID_ERR_NO_OBJECTS;
+ }
+
+ dbtools::SQLExceptionInfo aInfo;
+ if ( !bEnabled )
+ {
+ sdb::SQLContext aFirstMessage;
+ String sInfo = String( ModuleRes( nErrorId ) );
+ aFirstMessage.Message = sInfo;
+ aInfo = aFirstMessage;
+ if ( isEditable() )
+ {
+ sal_uInt16 nCommand = 0;
+ if ( nErrorId == RID_ERR_NO_COMMAND )
+ {
+ if ( !m_bShowProperties )
+ executeUnChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue>());
+
+ m_sLastActivePage = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"));
+ getDesignView()->setCurrentPage(m_sLastActivePage);
+ nCommand = SID_SELECT_REPORT;
+ }
+ else if ( getDesignView() && !getDesignView()->isAddFieldVisible() )
+ {
+ nCommand = SID_FM_ADD_FIELD;
+ }
+ if ( nCommand )
+ {
+ uno::Sequence< beans::PropertyValue> aArgs;
+ executeUnChecked(nCommand,aArgs);
+ }
+ }
+ }
+ else
+ {
+ m_bInGeneratePreview = true;
+ 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());
+ 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);
+ } // if (aInfo.isValid())
+ m_bInGeneratePreview = false;
+ }
+
+ if (aInfo.isValid())
+ {
+ 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( PROPERTY_APPLYFILTER, uno::makeAny( sal_True ) );
+
+ ::boost::shared_ptr<AnyConverter> aNoConverter(new AnyConverter());
+ TPropertyNamePair aPropertyMediation;
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_COMMAND, TPropertyConverter(PROPERTY_COMMAND,aNoConverter) ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_COMMANDTYPE, TPropertyConverter(PROPERTY_COMMANDTYPE,aNoConverter) ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_ESCAPEPROCESSING, TPropertyConverter(PROPERTY_ESCAPEPROCESSING,aNoConverter) ) );
+ aPropertyMediation.insert( TPropertyNamePair::value_type( PROPERTY_FILTER, TPropertyConverter(PROPERTY_FILTER,aNoConverter) ) );
+
+ 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 = getDesignView()->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/*sal_True*/);
+ sal_Bool bLink = sal_True;
+ xController->setValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, ::cppu::bool2any( bLink ) );
+
+ if ( ERRCODE_NONE == aDialog.Execute() )
+ {
+ xController->getValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bLink;
+ uno::Sequence<beans::PropertyValue> aArgs(2);
+ aArgs[0].Name = PROPERTY_IMAGEURL;
+ aArgs[0].Value <<= ::rtl::OUString(aDialog.GetPath());
+ aArgs[1].Name = PROPERTY_PRESERVEIRI;
+ aArgs[1].Value <<= bLink;
+ createControl(aArgs,xSection,::rtl::OUString(),OBJ_DLG_IMAGECONTROL);
+ }
+ }
+ catch(Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+// -----------------------------------------------------------------------------
+::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( getMutex() );
+ ::sal_Bool bRet = sal_True;
+ if ( getDesignView() )
+ {
+ getDesignView()->unmarkAllObjects(NULL);
+ getDesignView()->SetMode(RPTUI_SELECT);
+
+ uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
+ if ( aSelection >>= aElements )
+ {
+ if ( aElements.getLength() > 0 )
+ getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
+ getDesignView()->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() )
+ {
+ getDesignView()->showProperties(xObject);
+ aElements.realloc(1);
+ aElements[0] = xProp;
+ getDesignView()->setMarked(aElements,sal_True);
+ }
+ else
+ {
+ uno::Reference<report::XSection> xSection(aSelection,uno::UNO_QUERY);
+ if ( !xSection.is() && xObject.is() )
+ getDesignView()->showProperties(xObject);
+ getDesignView()->setMarked(xSection,xSection.is());
+ }
+ }
+ InvalidateAll();
+ }
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+Any SAL_CALL OReportController::getSelection( ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+ Any aRet;
+ if ( getDesignView() )
+ {
+ aRet = getDesignView()->getCurrentlyShownProperty();
+ if ( !aRet.hasValue() )
+ aRet <<= getDesignView()->getCurrentSection();
+ }
+ return aRet;
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::addSelectionChangeListener( const Reference< view::XSelectionChangeListener >& _Listener ) throw (RuntimeException)
+{
+ m_aSelectionListeners.addInterface( _Listener );
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::removeSelectionChangeListener( const Reference< view::XSelectionChangeListener >& _Listener ) throw (RuntimeException)
+{
+ m_aSelectionListeners.removeInterface( _Listener );
+}
+// -----------------------------------------------------------------------------
+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;
+}
+// -----------------------------------------------------------------------------
+void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const ::rtl::OUString& _sFunction,sal_uInt16 _nObjectId)
+{
+ SequenceAsHashMap aMap(_aArgs);
+ getDesignView()->setMarked(_xSection ,sal_True);
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ if ( !pSectionWindow )
+ return;
+
+ OSL_ENSURE(pSectionWindow->getReportSection().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;
+
+ SdrObject* pNewControl = NULL;
+ uno::Reference< report::XReportComponent> xShapeProp;
+ if ( _nObjectId == OBJ_CUSTOMSHAPE )
+ {
+ pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+ xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
+ ::rtl::OUString sCustomShapeType = getDesignView()->GetInsertObjString();
+ if ( !sCustomShapeType.getLength() )
+ sCustomShapeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond"));
+ pSectionWindow->getReportSection().createDefault(sCustomShapeType,pNewControl);
+ pNewControl->SetLogicRect(Rectangle(3000,500,6000,3500)); // switch height and width
+ } // if ( _nObjectId == OBJ_CUSTOMSHAPE )
+ else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId )
+ {
+ pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+
+ pNewControl->SetLogicRect(Rectangle(3000,500,8000,5500)); // switch height and width
+ xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
+ OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pNewControl);
+ if ( pObj && !pObj->IsEmpty() )
+ {
+ pObj->initializeChart(getModel());
+ }
+ }
+ else
+ {
+ SdrUnoObj* pLabel( NULL );
+ SdrUnoObj* pControl( NULL );
+ FmFormView::createControlLabelPair( getDesignView()
+ ,nLeftMargin,0
+ ,NULL,NULL,_nObjectId,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
+ NULL,pSectionWindow->getReportSection().getPage(),m_aReportModel.get(),
+ pLabel,pControl);
+ delete pLabel;
+
+ pNewControl = pControl;
+ OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl);
+ uno::Reference<beans::XPropertySet> xUnoProp(pObj->GetUnoControlModel(),uno::UNO_QUERY);
+ xShapeProp.set(pObj->getUnoShape(),uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
+ uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
+
+ const ::rtl::OUString sProps[] = { PROPERTY_NAME
+ ,PROPERTY_FONTDESCRIPTOR
+ ,PROPERTY_FONTDESCRIPTORASIAN
+ ,PROPERTY_FONTDESCRIPTORCOMPLEX
+ ,PROPERTY_ORIENTATION
+ ,PROPERTY_BORDER
+ ,PROPERTY_FORMATSSUPPLIER
+ ,PROPERTY_BACKGROUNDCOLOR
+ };
+ for(size_t i = 0; i < sizeof(sProps)/sizeof(sProps[0]);++i)
+ {
+ if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) )
+ xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i]));
+ } // for(size_t i = 0; i < sizeof(sProps)/sizeof(sProps[0]);++i)
+
+ if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) )
+ xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER));
+
+
+ if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) && _sFunction.getLength() )
+ {
+ 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);
+
+ if ( _nObjectId == OBJ_DLG_FIXEDTEXT ) // special case for fixed text
+ xUnoProp->setPropertyValue(PROPERTY_LABEL,uno::makeAny(OUnoObject::GetDefaultName(pObj)));
+ else if ( _nObjectId == OBJ_DLG_VFIXEDLINE )
+ {
+ awt::Size aOlSize = xShapeProp->getSize();
+ xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width
+ }
+ }
+
+ const sal_Int32 nShapeWidth = aMap.getUnpackedValueOrDefault(PROPERTY_WIDTH,xShapeProp->getWidth());
+ if ( nShapeWidth != xShapeProp->getWidth() )
+ xShapeProp->setWidth( nShapeWidth );
+
+ const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth;
+ if ( bChangedPos )
+ aPos.X = nPaperWidth - nShapeWidth;
+ xShapeProp->setPosition(aPos);
+
+ correctOverlapping(pNewControl,pSectionWindow->getReportSection());
+}
+// -----------------------------------------------------------------------------
+void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs)
+{
+ getDesignView()->unmarkAllObjects(NULL);
+
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+
+ 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;
+
+ sal_Bool bDate = aMap.getUnpackedValueOrDefault(PROPERTY_DATE_STATE,sal_False);
+ if ( bDate )
+ {
+ sFunction = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("TODAY()"));
+ createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
+ }
+ sal_Bool bTime = aMap.getUnpackedValueOrDefault(PROPERTY_TIME_STATE,sal_False);
+ if ( bTime )
+ {
+ sFunction = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("TIMEVALUE(NOW())"));
+ aMap[PROPERTY_FORMATKEY] <<= aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYTIME,sal_Int32(0));
+ createControl(aMap.getAsConstPropertyValueList(),xSection,sFunction);
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs)
+{
+ getDesignView()->unmarkAllObjects(NULL);
+
+ const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL));
+ UndoManagerListAction aListAction(m_aUndoManager,sUndoAction);
+
+ 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);
+}
+
+// -----------------------------------------------------------------------------
+void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
+{
+ getDesignView()->unmarkAllObjects(NULL);
+ //////////////////////////////////////////////////////////////////////
+ // Anhand des FormatKeys wird festgestellt, welches Feld benoetigt wird
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow[2];
+ pSectionWindow[0] = getDesignView()->getMarkedSection();
+
+ if ( !pSectionWindow[0] )
+ {
+ select(uno::makeAny(m_xReportDefinition->getDetail()));
+ pSectionWindow[0] = getDesignView()->getMarkedSection();
+ if ( !pSectionWindow[0] )
+ return;
+ }
+
+ uno::Reference<report::XSection> xCurrentSection = getDesignView()->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();
+
+ getDesignView()->setMarked(xSection,sal_True);
+ pSectionWindow[0] = getDesignView()->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));
+ pSectionWindow[1] = pSectionWindow[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
+ pSectionWindow[1] = getDesignView()->getMarkedSection(bLabelAboveTextField ? PREVIOUS : POST);
+ if (!pSectionWindow[1])
+ {
+ // maybe out of bounds
+ pSectionWindow[1] = pSectionWindow[0];
+ }
+ }
+ // clear all selections
+ getDesignView()->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 = getReportNumberFormatter()->getNumberFormatsSupplier();
+ if ( !xSupplier.is() )
+ continue;
+
+ Reference< XNumberFormats > xNumberFormats(xSupplier->getNumberFormats());
+ SdrUnoObj* pControl[2];
+ pControl[0] = NULL;
+ pControl[1] = NULL;
+ //getDesignView()->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] = &pSectionWindow[1]->getReportSection().getSectionView();
+ pSectionViews[1] = &pSectionWindow[0]->getReportSection().getSectionView();
+ // find this in svx
+ FmFormView::createControlLabelPair( getDesignView()
+ ,nLeftMargin,0
+ ,xField,xNumberFormats,nOBJID,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT,
+ pSectionWindow[1]->getReportSection().getPage(),pSectionWindow[0]->getReportSection().getPage(),m_aReportModel.get(),
+ pControl[0],pControl[1]);
+ //getDesignView()->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_THROW);
+ uno::Reference< report::XReportComponent> xShapeProp(pObjs[i]->getUnoShape(),uno::UNO_QUERY_THROW);
+ xUnoProp->setPropertyValue(PROPERTY_NAME,xShapeProp->getPropertyValue(PROPERTY_NAME));
+
+ uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
+ uno::Reference<beans::XPropertySetInfo> xInfo = xUnoProp->getPropertySetInfo();
+ const ::rtl::OUString sProps[] = { PROPERTY_FONTDESCRIPTOR
+ ,PROPERTY_FONTDESCRIPTORASIAN
+ ,PROPERTY_FONTDESCRIPTORCOMPLEX
+ ,PROPERTY_BORDER
+ ,PROPERTY_BACKGROUNDCOLOR
+ };
+ for(size_t k = 0; k < sizeof(sProps)/sizeof(sProps[0]);++k)
+ {
+ if ( xInfo->hasPropertyByName(sProps[k]) && xShapeInfo->hasPropertyByName(sProps[k]) )
+ xUnoProp->setPropertyValue(sProps[k],xShapeProp->getPropertyValue(sProps[k]));
+ }
+ 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() ) );
+ } // if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) )
+
+ if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) )
+ xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER));
+
+ 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;
+ }
+ ::rtl::OUString sLabel;
+ if ( xField->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
+ xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
+
+ 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_THROW);
+ uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW);
+ if ( sLabel.getLength() )
+ xShapePropTextField->setName(sLabel);
+ 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
+ const uno::Reference<report::XSection> xLabelSection = pSectionWindow[1]->getReportSection().getSection();
+ aPosLabel.Y = xLabelSection->getHeight() - xShapePropLabel->getHeight();
+ }
+ else
+ {
+ // move the label up to the splitter
+ aPosLabel.Y = 0;
+ }
+ xShapePropLabel->setPosition(aPosLabel);
+ }
+ OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl[0]);
+ uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW);
+ xShapeProp->setName(xShapeProp->getName() + sDefaultName );
+
+ for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i) // insert controls
+ {
+ correctOverlapping(pControl[i],pSectionWindow[1-i]->getReportSection());
+ }
+
+ if (!bLabelAboveTextField )
+ {
+ if ( pSectionViews[0] == pSectionViews[1] )
+ {
+ Rectangle aLabel = getRectangleFromControl(pControl[0]);
+ Rectangle aTextfield = getRectangleFromControl(pControl[1]);
+
+ // create a Union of the given Label and Textfield
+ Rectangle aLabelAndTextfield( aLabel );
+ aLabelAndTextfield.Union(aTextfield);
+
+ // check if there exists other fields and if yes, move down
+ bool bOverlapping = true;
+ bool bHasToMove = false;
+ while ( bOverlapping )
+ {
+ const SdrObject* pOverlappedObj = isOver(aLabelAndTextfield, *pSectionWindow[0]->getReportSection().getPage(), *pSectionViews[0], true, pControl, 2);
+ bOverlapping = pOverlappedObj != NULL;
+ if ( bOverlapping )
+ {
+ const Rectangle& aLogicRect = pOverlappedObj->GetLogicRect();
+ aLabelAndTextfield.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aLabelAndTextfield.Top());
+ bHasToMove = true;
+ }
+ }
+
+ if (bHasToMove)
+ {
+ // There was a move down, we need to move the Label and the Textfield down
+ aLabel.Move(0, aLabelAndTextfield.Top() - aLabel.Top());
+ aTextfield.Move(0, aLabelAndTextfield.Top() - aTextfield.Top());
+
+ uno::Reference< report::XReportComponent> xLabel(pControl[0]->getUnoShape(),uno::UNO_QUERY_THROW);
+ xLabel->setPositionY(aLabel.Top());
+
+ uno::Reference< report::XReportComponent> xTextfield(pControl[1]->getUnoShape(),uno::UNO_QUERY_THROW);
+ xTextfield->setPositionY(aTextfield.Top());
+ }
+ }
+ // this should never happen.
+ // else
+ // {
+ // DBG_ERROR("unhandled case.");
+ // }
+ }
+ }
+ }
+ 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<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow.get() )
+ pSectionView = &pSectionWindow->getReportSection().getSectionView();
+ return pSectionView;
+}
+// -----------------------------------------------------------------------------
+void OReportController::changeZOrder(sal_Int32 _nId)
+{
+ OSectionView* pSectionView = getCurrentSectionView();
+ if ( pSectionView )
+ {
+ switch(_nId)
+ {
+ case SID_FRAME_TO_BOTTOM:
+ pSectionView->PutMarkedToBtm();
+ break;
+ case SID_FRAME_TO_TOP:
+ pSectionView->PutMarkedToTop();
+ break;
+ case SID_FRAME_DOWN:
+ pSectionView->MovMarkedToBtm();
+ break;
+ case SID_FRAME_UP:
+ pSectionView->MovMarkedToTop();
+ break;
+
+ case SID_OBJECT_HEAVEN:
+ pSectionView->SetMarkedToLayer( RPT_LAYER_FRONT );
+ break;
+ case SID_OBJECT_HELL:
+ pSectionView->SetMarkedToLayer( RPT_LAYER_BACK );
+ break;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::listen(const bool _bAdd)
+{
+ const ::rtl::OUString aProps [] = { PROPERTY_REPORTHEADERON,PROPERTY_REPORTFOOTERON
+ ,PROPERTY_PAGEHEADERON,PROPERTY_PAGEFOOTERON
+ ,PROPERTY_COMMAND, PROPERTY_COMMANDTYPE,PROPERTY_CAPTION
+ };
+
+ 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])) - 3;
+ for(;pIter != pEnd;++pIter)
+ {
+ if ( ::std::find(pPropsBegin,pPropsEnd,pIter->Name) == pPropsEnd )
+ (m_xReportDefinition.get()->*pPropertyListenerAction)( pIter->Name, xUndo );
+ }
+
+ // Add Listeners to UndoEnvironment
+ void (OXUndoEnvironment::*pElementUndoFunction)( const uno::Reference< uno::XInterface >& ) =
+ _bAdd ? &OXUndoEnvironment::AddElement : &OXUndoEnvironment::RemoveElement;
+
+ (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getStyleFamilies() );
+ (rUndoEnv.*pElementUndoFunction)( m_xReportDefinition->getFunctions() );
+
+ // Add Listeners to ReportControllerObserver
+ OXReportControllerObserver& rObserver = *m_pReportControllerObserver;
+ // void (OXReportControllerObserver::*pObserverFunction)( const uno::Reference< uno::XInterface >& ) =
+ // _bAdd ? &OXReportControllerObserver::AddElement : &OXReportControllerObserver::RemoveElement;
+
+ // (rObserver.*pObserverFunction)( m_xReportDefinition->getStyleFamilies() );
+ // (rObserver.*pObserverFunction)( m_xReportDefinition->getFunctions() );
+
+ if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER);
+ rObserver.AddSection(m_xReportDefinition->getPageHeader());
+ }
+ if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
+ rObserver.AddSection(m_xReportDefinition->getReportHeader());
+ }
+
+ uno::Reference< report::XGroups > xGroups = m_xReportDefinition->getGroups();
+ const sal_Int32 nCount = xGroups->getCount();
+ _bAdd ? xGroups->addContainerListener(&rUndoEnv) : xGroups->removeContainerListener(&rUndoEnv);
+ _bAdd ? xGroups->addContainerListener(&rObserver) : xGroups->removeContainerListener(&rObserver);
+
+ 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 )
+ {
+ getDesignView()->addSection(xGroup->getHeader(),DBGROUPHEADER);
+ rObserver.AddSection(xGroup->getHeader());
+ }
+ } // for (sal_Int32 i=0;i<nCount ; ++i)
+
+ if ( _bAdd )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getDetail(),DBDETAIL);
+ rObserver.AddSection(m_xReportDefinition->getDetail());
+
+ for (sal_Int32 i=nCount;i > 0 ; --i)
+ {
+ uno::Reference< report::XGroup > xGroup(xGroups->getByIndex(i-1),uno::UNO_QUERY);
+ if ( xGroup->getFooterOn() )
+ {
+ getDesignView()->addSection(xGroup->getFooter(),DBGROUPFOOTER);
+ rObserver.AddSection(xGroup->getFooter());
+ }
+ }
+ if ( m_xReportDefinition->getReportFooterOn() )
+ {
+ getDesignView()->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
+ rObserver.AddSection(m_xReportDefinition->getReportFooter());
+ }
+ if ( m_xReportDefinition->getPageFooterOn())
+ {
+ getDesignView()->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
+ rObserver.AddSection(m_xReportDefinition->getPageFooter());
+ }
+
+ xGroups->addContainerListener(static_cast<XContainerListener*>(this));
+ m_xReportDefinition->addModifyListener(static_cast<XModifyListener*>(this));
+ }
+ else /* ! _bAdd */
+ {
+ rObserver.RemoveSection(m_xReportDefinition->getDetail());
+ xGroups->removeContainerListener(static_cast<XContainerListener*>(this));
+ m_xReportDefinition->removeModifyListener(static_cast<XModifyListener*>(this));
+ 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 OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
+ const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn();
+ if ( SID_REPORTHEADERFOOTER == _nId )
+ {
+ const String sUndoAction(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 OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() );
+ const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn();
+
+ if ( SID_PAGEHEADERFOOTER == _nId )
+ {
+ const String sUndoAction(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::collapseSection(const bool _bCollapse)
+{
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ if ( pSection )
+ {
+ pSection->setCollapsed(_bCollapse);
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::markSection(const bool _bNext)
+{
+ ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ if ( pSection )
+ {
+ ::boost::shared_ptr<OSectionWindow> pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS);
+ if ( pPrevSection != pSection && pPrevSection )
+ select(uno::makeAny(pPrevSection->getReportSection().getSection()));
+ else
+ select(uno::makeAny(m_xReportDefinition));
+ }
+ else
+ {
+ getDesignView()->markSection(_bNext ? 0 : getDesignView()->getSectionCount() - 1);
+ pSection = getDesignView()->getMarkedSection();
+ if ( pSection )
+ select(uno::makeAny(pSection->getReportSection().getSection()));
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportController::createDefaultControl(const uno::Sequence< beans::PropertyValue>& _aArgs)
+{
+ uno::Reference< report::XSection > xSection = getDesignView()->getCurrentSection();
+ if ( !xSection.is() )
+ xSection = m_xReportDefinition->getDetail();
+
+ if ( xSection.is() )
+ {
+ const ::rtl::OUString sKeyModifier(RTL_CONSTASCII_USTRINGPARAM("KeyModifier"));
+ const beans::PropertyValue* pIter = _aArgs.getConstArray();
+ const beans::PropertyValue* pEnd = pIter + _aArgs.getLength();
+ const beans::PropertyValue* pKeyModifier = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyValueCompare(),boost::cref(sKeyModifier)));
+ sal_Int16 nKeyModifier = 0;
+ if ( pKeyModifier == pEnd || ((pKeyModifier->Value >>= nKeyModifier) && nKeyModifier == KEY_MOD1) )
+ {
+ Sequence< PropertyValue > aCreateArgs;
+ getDesignView()->unmarkAllObjects(NULL);
+ createControl(aCreateArgs,xSection,::rtl::OUString(),getDesignView()->GetInsertObj());
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+uno::Reference< util::XNumberFormatter > OReportController::getReportNumberFormatter() const
+{
+ return m_xFormatter;
+}
+// -----------------------------------------------------------------------------
+void OReportController::checkChartEnabled()
+{
+ if ( !m_bChartEnabledAsked )
+ {
+ m_bChartEnabledAsked = true;
+ const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign" ) );
+ const ::rtl::OUString sPropertyName( RTL_CONSTASCII_USTRINGPARAM( "UserData/Chart" ) );
+
+ try
+ {
+ ::utl::OConfigurationTreeRoot aConfiguration(
+ ::utl::OConfigurationTreeRoot::createWithServiceFactory( m_xServiceFactory, sConfigName ) );
+
+ sal_Bool bChartEnabled = sal_False;
+ if ( aConfiguration.hasByHierarchicalName(sPropertyName) )
+ aConfiguration.getNodeValue( sPropertyName ) >>= bChartEnabled;
+ m_bChartEnabled = bChartEnabled;
+ }
+ catch(const Exception&)
+ {
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+
+// css.frame.XTitle
+::rtl::OUString SAL_CALL OReportController::getTitle()
+ throw (uno::RuntimeException)
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( getMutex() );
+
+ uno::Reference< frame::XTitle> xTitle(m_xReportDefinition,uno::UNO_QUERY_THROW);
+
+ return xTitle->getTitle ();
+}
+// -----------------------------------------------------------------------------
+void OReportController::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, Any& _rDefault ) const
+{
+ _rDefault <<= sal_Int16(100);
+}
+// -----------------------------------------------------------------------------
+// comphelper::OPropertyArrayUsageHelper
+::cppu::IPropertyArrayHelper* OReportController::createArrayHelper( ) const
+{
+ Sequence< Property > aProps;
+ describeProperties(aProps);
+ return new ::cppu::OPropertyArrayHelper(aProps);
+}
+// -------------------------------------------------------------------------
+
+// cppu::OPropertySetHelper
+::cppu::IPropertyArrayHelper& SAL_CALL OReportController::getInfoHelper()
+{
+ typedef ::comphelper::OPropertyArrayUsageHelper<OReportController_BASE> OReportController_PROP;
+ return *OReportController_PROP::getArrayHelper();
+}
+// -----------------------------------------------------------------------------
+void SAL_CALL OReportController::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle,const Any& _aValue) throw (Exception)
+{
+ if ( _nHandle == PROPERTY_ID_ZOOMVALUE )
+ {
+ _aValue >>= m_nZoomValue;
+ impl_zoom_nothrow();
+ }
+}
+void SAL_CALL OReportController::setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+ m_sMode = aMode;
+}
+::rtl::OUString SAL_CALL OReportController::getMode( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+ return m_sMode;
+}
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL OReportController::getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException)
+{
+ static ::rtl::OUString s_sModes[] = { ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("remote")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")) };
+ return uno::Sequence< ::rtl::OUString> (&s_sModes[0],sizeof(s_sModes)/sizeof(s_sModes[0]));
+}
+::sal_Bool SAL_CALL OReportController::supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException)
+{
+ uno::Sequence< ::rtl::OUString> aModes = getSupportedModes();
+ const ::rtl::OUString* pIter = aModes.getConstArray();
+ const ::rtl::OUString* pEnd = pIter + aModes.getLength();
+ for(;pIter != pEnd;++pIter)
+ {
+ if ( pIter->equals(aMode ) )
+ break;
+ }
+ return pIter != pEnd;
+}
+// -----------------------------------------------------------------------------
+bool OReportController::isUiVisible() const
+{
+ return !m_sMode.equalsAscii("remote");
+}
+// -----------------------------------------------------------------------------
+void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty,dbaui::FeatureState& _rState) const
+{
+ _rState.bEnabled = isEditable();
+ if ( _rState.bEnabled )
+ {
+ ::std::vector< uno::Reference< uno::XInterface > > aSelection;
+ getDesignView()->fillControlModelSelection(aSelection);
+ _rState.bEnabled = !aSelection.empty();
+ if ( _rState.bEnabled )
+ {
+ uno::Any aTemp;
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
+ for(; aIter != aSelection.end() && _rState.bEnabled ;++aIter)
+ {
+ uno::Reference< beans::XPropertySet> xProp(*aIter,uno::UNO_QUERY);
+ try
+ {
+ uno::Any aTemp2 = xProp->getPropertyValue(_sProperty);
+ if ( aIter == aSelection.begin() )
+ {
+ aTemp = aTemp2;
+ }
+ else if ( !comphelper::compare(aTemp,aTemp2) )
+ break;
+ }
+ catch(beans::UnknownPropertyException&)
+ {
+ _rState.bEnabled = sal_False;
+ }
+ } // for(; aIter != aSelection.end();++aIter)
+ if ( aIter == aSelection.end() )
+ _rState.aValue = aTemp;
+ }
+ } // if ( _rState.bEnabled )
+}
+// -----------------------------------------------------------------------------
+void OReportController::impl_zoom_nothrow()
+{
+ Fraction aZoom(m_nZoomValue,100);
+ setZoomFactor( aZoom,*getDesignView() );
+ getDesignView()->zoom(aZoom);
+ // TRY
+ /*getDesignView()->Invalidate(INVALIDATE_NOCHILDREN);*/
+ InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(),sal_True);
+ InvalidateFeature(SID_ATTR_ZOOMSLIDER,Reference< XStatusListener >(),sal_True);
+}
+// -----------------------------------------------------------------------------
+sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const uno::Reference< report::XReportControlFormat>& _xReportControlFormat) const
+{
+ sal_Bool bRet = sal_False;
+ if ( _xReportControlFormat.is() && !uno::Reference< report::XFixedLine>(_xReportControlFormat,uno::UNO_QUERY).is() ) // this command is really often called so we nedd a short cut here
+ {
+ 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;
+}
+// -----------------------------------------------------------------------------
+bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndoResId,const ::rtl::OUString& _sProperty,const uno::Any& _aValue,const Sequence< PropertyValue >& _aArgs)
+{
+ ::std::auto_ptr<UndoManagerListAction> pListAction;
+ ::std::vector< uno::Reference< uno::XInterface > > aSelection;
+ uno::Reference< awt::XWindow> xWindow;
+ lcl_getReportControlFormat( _aArgs, getDesignView(), xWindow, aSelection );
+ const bool bMultiSet = aSelection.size() > 1;
+ ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin();
+ for(; aIter != aSelection.end();++aIter)
+ {
+ if ( !pListAction.get() && _nUndoResId && bMultiSet )
+ {
+ const String sUndoAction = String(ModuleRes(_nUndoResId));
+ pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction));
+ } // if ( !pListAction.get() )
+ const uno::Reference< beans::XPropertySet > xControlModel(*aIter,uno::UNO_QUERY);
+ if ( xControlModel.is() )
+ xControlModel->setPropertyValue(_sProperty,_aValue);
+ } // for(; aIter != aSelection.end();++aIter)
+ return !aSelection.empty();
+}
+// -----------------------------------------------------------------------------
+void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const
+{
+ _rState.bEnabled = isEditable();
+ _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0;
+}
+
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OReportController::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+{
+ if ( getDesignView() )
+ {
+ return getDesignView()->getSectionWindow(_xSection);
+ }
+
+ // throw NullPointerException?
+ ::boost::shared_ptr<OSectionWindow> pEmpty;
+ return pEmpty;
+}
+
+
+// -----------------------------------------------------------------------------
+void OReportController::openZoomDialog()
+{
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ static SfxItemInfo aItemInfos[] =
+ {
+ { SID_ATTR_ZOOM, SFX_ITEM_POOLABLE }
+ };
+ SfxPoolItem* pDefaults[] =
+ {
+ new SvxZoomItem()
+ };
+ static USHORT pRanges[] =
+ {
+ SID_ATTR_ZOOM,SID_ATTR_ZOOM,
+ 0
+ };
+ SfxItemPool* pPool( new SfxItemPool(String::CreateFromAscii("ZoomProperties"), SID_ATTR_ZOOM,SID_ATTR_ZOOM, aItemInfos, pDefaults) );
+ pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM ); // ripped, don't understand why
+ pPool->FreezeIdRanges(); // the same
+ try
+ {
+ ::std::auto_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
+ // fill it
+ SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOM );
+ aZoomItem.SetValueSet(SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_WHOLEPAGE|SVX_ZOOM_ENABLE_PAGEWIDTH);
+ pDescriptor->Put(aZoomItem);
+
+ ::std::auto_ptr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(NULL, *pDescriptor.get()) );
+ pDlg->SetLimits( 20, 400 );
+ bool bCancel = ( RET_CANCEL == pDlg->Execute() );
+
+ if ( !bCancel )
+ {
+ const SvxZoomItem& rZoomItem = (const SvxZoomItem&)pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM );
+ m_eZoomType = rZoomItem.GetType();
+ m_nZoomValue = rZoomItem.GetValue();
+ if ( m_eZoomType != SVX_ZOOM_PERCENT )
+ m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
+
+ impl_zoom_nothrow();
+ } // if ( !bCancel )
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ SfxItemPool::Free(pPool);
+
+ for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+ delete pDefaults[i];
+ } // if(pFact)
+}
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// XVisualObject
+void SAL_CALL OReportController::setVisualAreaSize( ::sal_Int64 _nAspect, const awt::Size& _aSize ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+ //if( nAspect == embed::Aspects::MSOLE_CONTENT )
+ {
+ bool bChanged =
+ (m_aVisualAreaSize.Width != _aSize.Width ||
+ m_aVisualAreaSize.Height != _aSize.Height);
+ m_aVisualAreaSize = _aSize;
+ if( bChanged )
+ setModified( sal_True );
+ }
+ m_nAspect = _nAspect;
+}
+// -----------------------------------------------------------------------------
+awt::Size SAL_CALL OReportController::getVisualAreaSize( ::sal_Int64 /*nAspect*/ ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( getMutex() );
+ return m_aVisualAreaSize;
+}
+// -----------------------------------------------------------------------------
+embed::VisualRepresentation SAL_CALL OReportController::getPreferredVisualRepresentation( ::sal_Int64 _nAspect ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException)
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( getMutex() );
+ embed::VisualRepresentation aResult;
+ if ( !m_bInGeneratePreview )
+ {
+ m_bInGeneratePreview = true;
+ try
+ {
+ if ( !m_xReportEngine.is() )
+ m_xReportEngine.set(getORB()->createInstance(SERVICE_REPORTENGINE),uno::UNO_QUERY_THROW);
+ const sal_Int32 nOldMaxRows = m_xReportEngine->getMaxRows();
+ m_xReportEngine->setMaxRows(MAX_ROWS_FOR_PREVIEW);
+ m_xReportEngine->setReportDefinition(m_xReportDefinition);
+ m_xReportEngine->setActiveConnection(getConnection());
+ try
+ {
+ Reference<embed::XVisualObject> xTransfer(m_xReportEngine->createDocumentModel(),UNO_QUERY);
+ if ( xTransfer.is() )
+ {
+ xTransfer->setVisualAreaSize(m_nAspect,m_aVisualAreaSize);
+ aResult = xTransfer->getPreferredVisualRepresentation( _nAspect );
+ } // if ( xTransfer.is() )
+ }
+ catch( uno::Exception & ex )
+ {
+ (void)ex;
+ }
+ m_xReportEngine->setMaxRows(nOldMaxRows);
+ }
+ catch( uno::Exception & ex )
+ {
+ (void)ex;
+ }
+ m_bInGeneratePreview = false;
+ }
+ return aResult;
+}
+// -----------------------------------------------------------------------------
+::sal_Int32 SAL_CALL OReportController::getMapUnit( ::sal_Int64 /*nAspect*/ ) throw (uno::Exception, uno::RuntimeException)
+{
+ return embed::EmbedMapUnits::ONE_100TH_MM;
+}
+// -----------------------------------------------------------------------------
+uno::Reference< container::XNameAccess > OReportController::getColumns() const
+{
+ if ( !m_xColumns.is() && m_xReportDefinition.is() && m_xReportDefinition->getCommand().getLength() )
+ {
+ m_xColumns = dbtools::getFieldsByCommandDescriptor(getConnection(),m_xReportDefinition->getCommandType(),m_xReportDefinition->getCommand(),m_xHoldAlive);
+ }
+ return m_xColumns;
+}
+// -----------------------------------------------------------------------------
+::rtl::OUString OReportController::getColumnLabel_throw(const ::rtl::OUString& i_sColumnName) const
+{
+ ::rtl::OUString sLabel;
+ uno::Reference< container::XNameAccess > xColumns = getColumns();
+ if ( xColumns.is() && xColumns->hasByName(i_sColumnName) )
+ {
+ uno::Reference< beans::XPropertySet> xColumn(xColumns->getByName(i_sColumnName),uno::UNO_QUERY_THROW);
+ if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) )
+ xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
+ }
+ return sLabel;
+}
+// -----------------------------------------------------------------------------
diff --git a/reportdesign/source/ui/report/ReportControllerObserver.cxx b/reportdesign/source/ui/report/ReportControllerObserver.cxx
new file mode 100644
index 000000000000..7c0f3a572be8
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportControllerObserver.cxx
@@ -0,0 +1,462 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_reportdesign.hxx"
+
+#include <ReportControllerObserver.hxx>
+#include <ReportController.hxx>
+#include <svl/smplhint.hxx>
+#include <vos/mutex.hxx>
+#include <vcl/svapp.hxx>
+#include <com/sun/star/report/XFormattedField.hpp>
+#include <com/sun/star/awt/FontSlant.hpp>
+#include <FormattedFieldBeautifier.hxx>
+
+#include <svx/unopage.hxx>
+
+// DBG_*
+#include <tools/debug.hxx>
+// DBG_UNHANDLED_EXCEPTION
+#include <tools/diagnose_ex.h>
+
+namespace rptui
+{
+
+ using namespace ::com::sun::star;
+
+ // const OReportController *& m_pReportController;
+
+DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties);
+DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache);
+
+class OXReportControllerObserverImpl
+{
+ OXReportControllerObserverImpl(OXReportControllerObserverImpl&);
+ void operator =(OXReportControllerObserverImpl&);
+public:
+ const OReportController& m_rReportController;
+ ::std::vector< uno::Reference< container::XChild> > m_aSections;
+ ::osl::Mutex m_aMutex;
+ oslInterlockedCount m_nLocks;
+ sal_Bool m_bReadOnly;
+
+ OXReportControllerObserverImpl(const OReportController& _rController);
+ ~OXReportControllerObserverImpl();
+};
+
+// -----------------------------------------------------------------------------
+
+ OXReportControllerObserverImpl::OXReportControllerObserverImpl(const OReportController& _rController)
+ :m_rReportController(_rController)
+ ,m_nLocks(0)
+ ,m_bReadOnly(sal_False)
+ {
+ }
+
+ OXReportControllerObserverImpl::~OXReportControllerObserverImpl()
+ {
+ }
+
+ // -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+
+ DBG_NAME(rpt_OXReportControllerObserver)
+
+ OXReportControllerObserver::OXReportControllerObserver(const OReportController& _rController)
+ :m_pImpl(new OXReportControllerObserverImpl(_rController) )
+ ,m_aFormattedFieldBeautifier(_rController)
+ ,m_aFixedTextColor(_rController)
+ {
+ DBG_CTOR( rpt_OXReportControllerObserver,NULL);
+
+ Application::AddEventListener(LINK( this, OXReportControllerObserver, SettingsChanged ) );
+ }
+
+ OXReportControllerObserver::~OXReportControllerObserver()
+ {
+ DBG_CTOR( rpt_OXReportControllerObserver,NULL);
+ Application::RemoveEventListener(LINK( this, OXReportControllerObserver, SettingsChanged ) );
+ }
+
+ // -----------------------------------------------------------------------------
+ IMPL_LINK(OXReportControllerObserver, SettingsChanged, VclWindowEvent*, _pEvt)
+ {
+ if ( _pEvt )
+ {
+ sal_Int32 nEvent = _pEvt->GetId();
+ /*
+ // just for debug
+ if (nEvent == VCLEVENT_WINDOW_CHILDCREATED ||
+ nEvent == VCLEVENT_WINDOW_PAINT ||
+ nEvent == VCLEVENT_WINDOW_MOVE ||
+ nEvent == VCLEVENT_WINDOW_RESIZE ||
+ nEvent == VCLEVENT_WINDOW_SHOW ||
+ nEvent == VCLEVENT_WINDOW_MOUSEMOVE ||
+ nEvent == VCLEVENT_WINDOW_FRAMETITLECHANGED ||
+ nEvent == VCLEVENT_WINDOW_HIDE ||
+ nEvent == VCLEVENT_EDIT_MODIFY ||
+ nEvent == VCLEVENT_SCROLLBAR_ENDSCROLL ||
+ nEvent == VCLEVENT_EDIT_SELECTIONCHANGED ||
+ nEvent == VCLEVENT_TABPAGE_INSERTED ||
+ nEvent == VCLEVENT_TABPAGE_REMOVED ||
+ nEvent == VCLEVENT_TOOLBOX_FORMATCHANGED ||
+ nEvent == VCLEVENT_TOOLBOX_ITEMADDED ||
+ nEvent == VCLEVENT_TOOLBOX_ALLITEMCHANGED ||
+ nEvent == VCLEVENT_MENUBARADDED ||
+ nEvent == 1
+ )
+ {
+ return 0L;
+ }
+ */
+
+ if (nEvent == VCLEVENT_APPLICATION_DATACHANGED )
+ {
+ DataChangedEvent* pData = reinterpret_cast<DataChangedEvent*>(_pEvt->GetData());
+ if ( pData && ((( pData->GetType() == DATACHANGED_SETTINGS ) ||
+ ( pData->GetType() == DATACHANGED_DISPLAY )) &&
+ ( pData->GetFlags() & SETTINGS_STYLE )))
+ {
+ OEnvLock aLock(*this);
+
+ // sal_uInt32 nCount = m_pImpl->m_aSections.size();
+
+ // send all Section Objects a 'tingle'
+ // maybe they need a change in format, color, etc
+ ::std::vector< uno::Reference< container::XChild > >::const_iterator aIter = m_pImpl->m_aSections.begin();
+ ::std::vector< uno::Reference< container::XChild > >::const_iterator aEnd = m_pImpl->m_aSections.end();
+ for (;aIter != aEnd; aIter++)
+ {
+ const uno::Reference<container::XChild> xChild (*aIter);
+ if (xChild.is())
+ {
+ uno::Reference<report::XSection> xSection(xChild, uno::UNO_QUERY);
+ if (xSection.is())
+ {
+ const sal_Int32 nCount = xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ const uno::Any aObj = xSection->getByIndex(i);
+ uno::Reference < report::XReportComponent > xReportComponent(aObj, uno::UNO_QUERY);
+ if (xReportComponent.is())
+ {
+ m_aFormattedFieldBeautifier.handle(xReportComponent);
+ m_aFixedTextColor.handle(xReportComponent);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return 0L;
+ }
+
+ // XEventListener
+ void SAL_CALL OXReportControllerObserver::disposing(const lang::EventObject& e) throw( uno::RuntimeException )
+ {
+ (void) e;
+ // check if it's an object we have cached informations about
+ uno::Reference< beans::XPropertySet > xSourceSet(e.Source, uno::UNO_QUERY);
+ if ( xSourceSet.is() )
+ {
+ uno::Reference< report::XSection> xSection(xSourceSet,uno::UNO_QUERY);
+ if ( xSection.is() )
+ RemoveSection(xSection);
+ else
+ RemoveElement(xSourceSet);
+ }
+ }
+
+ void OXReportControllerObserver::Clear()
+ {
+ OEnvLock aLock(*this);
+ // sal_uInt32 nDebugValue = m_pImpl->m_aSections.size();
+ m_pImpl->m_aSections.clear();
+ }
+
+ // XPropertyChangeListener
+ void SAL_CALL OXReportControllerObserver::propertyChange(const beans::PropertyChangeEvent& _rEvent) throw(uno::RuntimeException)
+ {
+ (void) _rEvent;
+ ::osl::ClearableMutexGuard aGuard( m_pImpl->m_aMutex );
+
+ if ( IsLocked() )
+ return;
+
+ m_aFormattedFieldBeautifier.notifyPropertyChange(_rEvent);
+ m_aFixedTextColor.notifyPropertyChange(_rEvent);
+ }
+
+// -----------------------------------------------------------------------------
+void OXReportControllerObserver::Lock()
+{
+ OSL_ENSURE(m_refCount,"Illegal call to dead object!");
+ osl_incrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+void OXReportControllerObserver::UnLock()
+{
+ OSL_ENSURE(m_refCount,"Illegal call to dead object!");
+
+ osl_decrementInterlockedCount( &m_pImpl->m_nLocks );
+}
+sal_Bool OXReportControllerObserver::IsLocked() const { return m_pImpl->m_nLocks != 0; }
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::AddSection(const uno::Reference< report::XSection > & _xSection)
+{
+ OEnvLock aLock(*this);
+ try
+ {
+ uno::Reference<container::XChild> xChild = _xSection.get();
+ m_pImpl->m_aSections.push_back(xChild);
+ uno::Reference< uno::XInterface > xInt(_xSection);
+ AddElement(xInt);
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::RemoveSection(const uno::Reference< report::XSection > & _xSection)
+{
+ OEnvLock 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());
+ uno::Reference< uno::XInterface > xInt(_xSection);
+ RemoveElement(xInt);
+ }
+ catch(uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::TogglePropertyListening(const uno::Reference< uno::XInterface > & Element)
+{
+ // listen at Container
+ uno::Reference< container::XIndexAccess > xContainer(Element, uno::UNO_QUERY);
+ if (xContainer.is())
+ {
+ uno::Reference< uno::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);
+ }
+ }
+
+ uno::Reference< beans::XPropertySet > xSet(Element, uno::UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!m_pImpl->m_bReadOnly)
+ xSet->addPropertyChangeListener( ::rtl::OUString(), this );
+ else
+ xSet->removePropertyChangeListener( ::rtl::OUString(), this );
+ }
+}
+
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::switchListening( const uno::Reference< container::XIndexAccess >& _rxContainer, bool _bStartListening ) SAL_THROW(())
+{
+ OSL_PRECOND( _rxContainer.is(), "OXReportControllerObserver::switchListening: invalid container!" );
+ if ( !_rxContainer.is() )
+ return;
+
+ try
+ {
+ // also handle all children of this element
+ uno::Reference< uno::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
+ uno::Reference< container::XContainer > xSimpleContainer( _rxContainer, uno::UNO_QUERY );
+ // OSL_ENSURE( xSimpleContainer.is(), "OXReportControllerObserver::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 uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::switchListening( const uno::Reference< uno::XInterface >& _rxObject, bool _bStartListening ) SAL_THROW(())
+{
+ OSL_PRECOND( _rxObject.is(), "OXReportControllerObserver::switchListening: how should I listen at a NULL object?" );
+
+ try
+ {
+ if ( !m_pImpl->m_bReadOnly )
+ {
+ uno::Reference< beans::XPropertySet > xProps( _rxObject, uno::UNO_QUERY );
+ if ( xProps.is() )
+ {
+ if ( _bStartListening )
+ xProps->addPropertyChangeListener( ::rtl::OUString(), this );
+ else
+ xProps->removePropertyChangeListener( ::rtl::OUString(), this );
+ }
+ }
+
+ uno::Reference< util::XModifyBroadcaster > xBroadcaster( _rxObject, uno::UNO_QUERY );
+ if ( xBroadcaster.is() )
+ {
+ if ( _bStartListening )
+ xBroadcaster->addModifyListener( this );
+ else
+ xBroadcaster->removeModifyListener( this );
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXReportControllerObserver::modified( const lang::EventObject& /*aEvent*/ ) throw (uno::RuntimeException)
+{
+ // implSetModified();
+}
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::AddElement(const uno::Reference< uno::XInterface >& _rxElement )
+{
+ // if ( !IsLocked() )
+ // {
+ m_aFormattedFieldBeautifier.notifyElementInserted(_rxElement);
+ m_aFixedTextColor.notifyElementInserted(_rxElement);
+ // }
+
+ // if it's a container, start listening at all elements
+ uno::Reference< container::XIndexAccess > xContainer( _rxElement, uno::UNO_QUERY );
+ if ( xContainer.is() )
+ switchListening( xContainer, true );
+
+ switchListening( _rxElement, true );
+}
+
+//------------------------------------------------------------------------------
+void OXReportControllerObserver::RemoveElement(const uno::Reference< uno::XInterface >& _rxElement)
+{
+ switchListening( _rxElement, false );
+
+ uno::Reference< container::XIndexAccess > xContainer( _rxElement, uno::UNO_QUERY );
+ if ( xContainer.is() )
+ switchListening( xContainer, false );
+}
+
+// -----------------------------------------------------------------------------
+::std::vector< uno::Reference< container::XChild> >::const_iterator OXReportControllerObserver::getSection(const uno::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() )
+ {
+ uno::Reference<container::XChild> xParent(_xContainer->getParent(),uno::UNO_QUERY);
+ aFind = getSection(xParent);
+ }
+ }
+ return aFind;
+}
+// XContainerListener
+//------------------------------------------------------------------------------
+void SAL_CALL OXReportControllerObserver::elementInserted(const container::ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ // neues Object zum lauschen
+ uno::Reference< uno::XInterface > xIface( evt.Element, uno::UNO_QUERY );
+ if ( xIface.is() )
+ {
+ AddElement(xIface);
+ }
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXReportControllerObserver::elementReplaced(const container::ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ uno::Reference< uno::XInterface > xIface(evt.ReplacedElement,uno::UNO_QUERY);
+ OSL_ENSURE(xIface.is(), "OXReportControllerObserver::elementReplaced: invalid container notification!");
+ RemoveElement(xIface);
+
+ xIface.set(evt.Element,uno::UNO_QUERY);
+ AddElement(xIface);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OXReportControllerObserver::elementRemoved(const container::ContainerEvent& evt) throw(uno::RuntimeException)
+{
+ ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
+
+ uno::Reference< uno::XInterface > xIface( evt.Element, uno::UNO_QUERY );
+ if ( xIface.is() )
+ {
+ RemoveElement(xIface);
+ }
+}
+
+
+} // namespace rptui
+
+
+
diff --git a/reportdesign/source/ui/report/ReportRuler.cxx b/reportdesign/source/ui/report/ReportRuler.cxx
new file mode 100644
index 000000000000..c2480f23b3e5
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportRuler.cxx
@@ -0,0 +1,63 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ReportRuler.hxx"
+#include "ReportSection.hxx"
+#include "ReportWindow.hxx"
+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..04222d6e2f1e
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -0,0 +1,878 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ReportSection.hxx"
+#include "ReportWindow.hxx"
+#include "DesignView.hxx"
+#include "uistrings.hrc"
+#include "RptObject.hxx"
+#include "RptModel.hxx"
+#include "SectionView.hxx"
+#include "RptPage.hxx"
+#include "ReportController.hxx"
+#include "UITools.hxx"
+#include "ViewsWindow.hxx"
+
+#include <svx/svdpagv.hxx>
+#include <editeng/eeitemid.hxx>
+#include <editeng/adjitem.hxx>
+#include <svx/sdrpaintwindow.hxx>
+#include <svx/unoshape.hxx>
+#include <svx/gallery.hxx>
+#include <svx/svxids.hrc>
+#include <svx/svditer.hxx>
+#include <svx/dbaexchange.hxx>
+
+#include <vcl/svapp.hxx>
+
+#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
+#include <toolkit/helper/convert.hxx>
+#include "RptDef.hxx"
+#include "SectionWindow.hxx"
+#include "helpids.hrc"
+#include "RptResId.hrc"
+#include "dlgedclip.hxx"
+#include "UndoActions.hxx"
+#include "rptui_slotid.hrc"
+
+#include <connectivity/dbtools.hxx>
+
+#include <vcl/lineinfo.hxx>
+#include "ColorChanger.hxx"
+
+#include <svl/itempool.hxx>
+#include <svtools/extcolorcfg.hxx>
+#include <unotools/confignode.hxx>
+#include <framework/imageproducer.hxx>
+
+// =============================================================================
+namespace rptui
+{
+// =============================================================================
+using namespace ::com::sun::star;
+// -----------------------------------------------------------------------------
+
+sal_Int32 lcl_getOverlappedControlColor(/*const uno::Reference <lang::XMultiServiceFactory> _rxFactory*/)
+{
+ svtools::ExtendedColorConfig aConfig;
+ sal_Int32 nColor = aConfig.GetColorValue(CFG_REPORTDESIGNER, DBOVERLAPPEDCONTROL).getColor();
+ return nColor;
+}
+//------------------------------------------------------------------------------
+DBG_NAME( rpt_OReportSection )
+OReportSection::OReportSection(OSectionWindow* _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();
+ SetHelpId(HID_REPORTSECTION);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ try
+ {
+ fill();
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Exception catched!");
+ }
+
+ m_pFunc.reset(new DlgEdFuncSelect( this ));
+ m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( /* m_pParent->getViewsWindow()->getView()->getReportView()->getController().getORB() */ ) );
+}
+//------------------------------------------------------------------------------
+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 )
+{
+ Window::Paint(rRect);
+
+ if ( m_pView )
+ {
+ // repaint, get PageView and prepare Region
+ SdrPageView* pPgView = m_pView->GetSdrPageView();
+ const Region aPaintRectRegion(rRect);
+
+ // #i74769#
+ SdrPaintWindow* pTargetPaintWindow = 0;
+
+ // mark repaint start
+ if(pPgView)
+ {
+ pTargetPaintWindow = pPgView->GetView().BeginDrawLayers(this, aPaintRectRegion);
+ OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)");
+ // draw background self using wallpaper
+ OutputDevice& rTargetOutDev = pTargetPaintWindow->GetTargetOutputDevice();
+ sal_Int32 nColor = m_xSection->getBackColor();
+ if ( nColor == (sal_Int32)COL_TRANSPARENT )
+ nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
+ rTargetOutDev.DrawWallpaper(rRect, Wallpaper(Color(nColor)));
+ }
+
+ // do paint (unbuffered) and mark repaint end
+ if(pPgView)
+ {
+ pPgView->DrawLayer(0, this);
+ pPgView->GetView().EndDrawLayers(*pTargetPaintWindow, true);
+ }
+
+ m_pView->CompleteRedraw(this,aPaintRectRegion);
+ }
+}
+//------------------------------------------------------------------------------
+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,5*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()) ) );
+ }
+}
+//------------------------------------------------------------------------------
+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->getViewsWindow()->getView()->getReportView()->getController().getSdrModel();
+ m_pPage = m_pModel->getPage(m_xSection);
+
+ m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getViewsWindow()->getView() );
+
+ // #i93597# tell SdrPage that only left and right page border is defined
+ // instead of the full rectangle definition
+ m_pPage->setPageBorderOnlyLeftRight(true);
+
+ // without the following call, no grid is painted
+ m_pView->ShowSdrPage( m_pPage );
+
+ m_pView->SetMoveSnapOnlyTopLeft( TRUE );
+ ODesignView* pDesignView = m_pParent->getViewsWindow()->getView()->getReportView();
+
+ // #i93595# Adapted grid to a more coarse grid and subdivisions for better visualisation. This
+ // is only for visualisation and has nothing to do with the actual snap
+ const Size aGridSizeCoarse(pDesignView->getGridSizeCoarse());
+ const Size aGridSizeFine(pDesignView->getGridSizeFine());
+ m_pView->SetGridCoarse(aGridSizeCoarse);
+ m_pView->SetGridFine(aGridSizeFine);
+
+ // #i93595# set snap grid width to snap to all existing subdivisions
+ const Fraction aX(aGridSizeFine.A());
+ const Fraction aY(aGridSizeFine.B());
+ m_pView->SetSnapGridWidth(aX, aY);
+
+ m_pView->SetGridSnap( pDesignView->isGridSnap() );
+ m_pView->SetGridFront( FALSE );
+ m_pView->SetDragStripes( TRUE );
+ m_pView->SetPageVisible();
+ sal_Int32 nColor = m_xSection->getBackColor();
+ if ( nColor == (sal_Int32)COL_TRANSPARENT )
+ nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
+ m_pView->SetApplicationDocumentColor(nColor);
+
+ 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);
+
+// LLA: TODO
+// m_pPage->SetUppBorder(-10000);
+
+ m_pView->SetDesignMode( TRUE );
+
+ m_pView->StartListening( *m_pModel );
+ /*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,5*m_xSection->getHeight()) );
+ const Size aPageSize = m_pPage->GetSize();
+ const sal_Int32 nWorkAreaLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nWorkAreaRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ m_pView->SetWorkArea( Rectangle( Point( nWorkAreaLeftMargin, 0), Size(aPageSize.Width() - nWorkAreaLeftMargin - nWorkAreaRightMargin,aPageSize.Height()) ) );
+ } // if ( m_xSection.is() && m_pPage && m_pView )
+
+ //SetBackground( Wallpaper( COL_BLUE ));
+}
+// -----------------------------------------------------------------------------
+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<report::XReportComponent> > aCopies;
+ pIter->Value >>= aCopies;
+ const uno::Reference<report::XReportComponent>* pCopiesIter = aCopies.getConstArray();
+ const uno::Reference<report::XReportComponent>* pCopiesEnd = pCopiesIter + aCopies.getLength();
+ for (;pCopiesIter != pCopiesEnd ; ++pCopiesIter)
+ {
+ SvxShape* pShape = SvxShape::getImplementation( *pCopiesIter );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ if ( pObject )
+ {
+ SdrObject* pNeuObj = pObject->Clone();
+
+ pNeuObj->SetPage( m_pPage );
+ pNeuObj->SetModel( m_pModel.get() );
+ SdrInsertReason aReason(SDRREASON_VIEWCALL);
+ m_pPage->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
+
+ Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize()));
+ aRet.setHeight(aRet.getHeight() + 1);
+ aRet.setWidth(aRet.getWidth() + 1);
+ bool bOverlapping = true;
+ while ( bOverlapping )
+ {
+ bOverlapping = isOver(aRet,*m_pPage,*m_pView,true,pNeuObj) != NULL;
+ if ( bOverlapping )
+ {
+ aRet.Move(0,aRet.getHeight()+1);
+ pNeuObj->SetLogicRect(aRet);
+ //(*pCopiesIter)->setPositionY(aRet.Top());
+ }
+ }
+ m_pView->AddUndo( m_pView->GetModel()->GetSdrUndoFactory().CreateUndoNewObject( *pNeuObj ) );
+ m_pView->MarkObj( pNeuObj, m_pView->GetSdrPageView() );
+ if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) )
+ m_xSection->setHeight(aRet.getHeight() + aRet.Top());
+ }
+ }
+ }
+ 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();
+}
+//----------------------------------------------------------------------------
+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_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( ) );
+ m_pModel->SetReadOnly(eNewMode == RPTUI_READONLY);
+ m_eMode = eNewMode;
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedObjects)
+{
+ Copy(_rAllreadyCopiedObjects,false);
+}
+//----------------------------------------------------------------------------
+void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedObjects,bool _bEraseAnddNoClone)
+{
+ 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<report::XReportComponent> > aCopies;
+ aCopies.reserve(nMark);
+
+ SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory();
+
+ for( ULONG i = nMark; i > 0; )
+ {
+ --i;
+ SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj();
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(pSdrObject);
+ if ( pObj )
+ {
+ try
+ {
+ SdrObject* pNeuObj = pSdrObject->Clone();
+ aCopies.push_back(uno::Reference<report::XReportComponent>(pNeuObj->getUnoShape(),uno::UNO_QUERY));
+ if ( _bEraseAnddNoClone )
+ {
+ m_pView->AddUndo( rUndo.CreateUndoDeleteObject( *pSdrObject ) );
+ m_pPage->RemoveObject(pSdrObject->GetOrdNum());
+ }
+
+ }
+ catch(uno::Exception&)
+ {
+ OSL_ENSURE(0,"Can't copy report elements!");
+ }
+ }
+ } // for( ULONG i = 0; i < nMark; i++ )
+
+ if ( !aCopies.empty() )
+ {
+ ::std::reverse(aCopies.begin(),aCopies.end());
+ 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<report::XReportComponent> >(&(*aCopies.begin()),aCopies.size());
+ }
+}
+//----------------------------------------------------------------------------
+void OReportSection::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True); // mark the section in which is clicked
+ m_pFunc->MouseButtonDown( rMEvt );
+ Window::MouseButtonDown(rMEvt);
+}
+//----------------------------------------------------------------------------
+void OReportSection::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( !m_pFunc->MouseButtonUp( rMEvt ) )
+ m_pParent->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_OBJECT_SELECT,uno::Sequence< beans::PropertyValue>());
+}
+
+//----------------------------------------------------------------------------
+
+void OReportSection::MouseMove( const MouseEvent& rMEvt )
+{
+ m_pFunc->MouseMove( rMEvt );
+
+}
+//----------------------------------------------------------------------------
+void OReportSection::SetGridVisible(BOOL _bVisible)
+{
+ m_pView->SetGridVisible( _bVisible );
+}
+//------------------------------------------------------------------------------
+void OReportSection::SelectAll(const sal_uInt16 _nObjectType)
+{
+ if ( m_pView )
+ {
+ if ( _nObjectType == OBJ_NONE )
+ m_pView->MarkAllObj();
+ else
+ {
+ m_pView->UnmarkAll();
+ SdrObjListIter aIter(*m_pPage,IM_DEEPNOGROUPS);
+ SdrObject* pObjIter = NULL;
+ while( (pObjIter = aIter.Next()) != NULL )
+ {
+ if ( pObjIter->GetObjIdentifier() == _nObjectType )
+ m_pView->MarkObj( pObjIter, m_pView->GetSdrPageView() );
+ }
+ }
+ }
+}
+void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rController,const uno::Reference< report::XReportDefinition>& _xReportDefinition,uno::Reference<frame::XFrame>& _rFrame,BOOL _bHiContrast)
+{
+ const USHORT nCount = rContextMenu.GetItemCount();
+ for (USHORT i = 0; i < nCount; ++i)
+ {
+ if ( MENUITEM_SEPARATOR != rContextMenu.GetItemType(i))
+ {
+ const USHORT nId = rContextMenu.GetItemId(i);
+ PopupMenu* pPopupMenu = rContextMenu.GetPopupMenu( nId );
+ if ( pPopupMenu )
+ {
+ lcl_insertMenuItemImages(*pPopupMenu,rController,_xReportDefinition,_rFrame,_bHiContrast);
+ }
+ else
+ {
+ const ::rtl::OUString sCommand = rContextMenu.GetItemCommand(nId);
+ rContextMenu.SetItemImage(nId,framework::GetImageFromURL(_rFrame,sCommand,FALSE,_bHiContrast));
+ if ( nId == SID_PAGEHEADERFOOTER )
+ {
+ String sText = String(ModuleRes((_xReportDefinition.is() && _xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT));
+ rContextMenu.SetItemText(nId,sText);
+ }
+ else if ( nId == SID_REPORTHEADERFOOTER )
+ {
+ String sText = String(ModuleRes((_xReportDefinition.is() && _xReportDefinition->getReportHeaderOn()) ? RID_STR_REPORTHEADERFOOTER_DELETE : RID_STR_REPORTHEADERFOOTER_INSERT));
+ rContextMenu.SetItemText(nId,sText);
+ }
+ }
+ rContextMenu.CheckItem(nId,rController.isCommandChecked(nId));
+ rContextMenu.EnableItem(nId,rController.isCommandEnabled(nId));
+ }
+ } // for (USHORT i = 0; i < nCount; ++i)
+}
+//----------------------------------------------------------------------------
+void OReportSection::Command( const CommandEvent& _rCEvt )
+{
+ Window::Command(_rCEvt);
+ switch (_rCEvt.GetCommand())
+ {
+ case COMMAND_CONTEXTMENU:
+ {
+ const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
+ BOOL bHiContrast = rSettings.GetHighContrastMode();
+ OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController();
+ uno::Reference<frame::XFrame> xFrame = rController.getFrame();
+ PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) );
+ uno::Reference< report::XReportDefinition> xReportDefinition = getSection()->getReportDefinition();
+
+ lcl_insertMenuItemImages(aContextMenu,rController,xReportDefinition,xFrame,bHiContrast);
+
+ 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;
+ }
+ rController.executeChecked(nId,aArgs);
+ }
+ }
+ break;
+ }
+}
+// -----------------------------------------------------------------------------
+void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ if ( m_xSection.is() )
+ {
+ if ( _rEvent.Source == m_xSection || PROPERTY_BACKCOLOR == _rEvent.PropertyName )
+ {
+ sal_Int32 nColor = m_xSection->getBackColor();
+ if ( nColor == (sal_Int32)COL_TRANSPARENT )
+ nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
+ m_pView->SetApplicationDocumentColor(nColor);
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE);
+ }
+ else
+ {
+ uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
+ if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN )
+ {
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ m_pPage->SetLftBorder(nLeftMargin);
+ }
+ else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN )
+ {
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ m_pPage->SetRgtBorder(nRightMargin);
+ }
+
+ try
+ {
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
+ const sal_Int32 nCount = m_xSection->getCount();
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ {
+ bool bChanged = false;
+ uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW);
+ awt::Point aPos = xReportComponent->getPosition();
+ awt::Size aSize = xReportComponent->getSize();
+ SvxShape* pShape = SvxShape::getImplementation( xReportComponent );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ if ( pObject )
+ {
+ OObjectBase* pBase = dynamic_cast<OObjectBase*>(pObject);
+ pBase->EndListening(sal_False);
+ if ( aPos.X < nLeftMargin )
+ {
+ aPos.X = nLeftMargin;
+ bChanged = true;
+ }
+ if ( (aPos.X + aSize.Width) > (nPaperWidth - nRightMargin) )
+ {
+ aPos.X = nPaperWidth - nRightMargin - aSize.Width;
+ if ( aPos.X < nLeftMargin )
+ {
+ aSize.Width += aPos.X - nLeftMargin;
+ aPos.X = nLeftMargin;
+ // add listener around
+ pBase->StartListening();
+ xReportComponent->setSize(aSize);
+ pBase->EndListening(sal_False);
+ }
+ bChanged = true;
+ }
+ if ( aPos.Y < 0 )
+ aPos.Y = 0;
+ if ( bChanged )
+ {
+ xReportComponent->setPosition(aPos);
+ correctOverlapping(pObject,*this,false);
+ Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize()));
+ aRet.setHeight(aRet.getHeight() + 1);
+ aRet.setWidth(aRet.getWidth() + 1);
+ if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) )
+ m_xSection->setHeight(aRet.getHeight() + aRet.Top());
+ }
+ pBase->StartListening();
+ }
+ } // for (sal_Int32 i = 0; i < nCount; ++i)
+ }
+ catch(uno::Exception)
+ {
+ OSL_ENSURE(0,"Exception caught: OReportSection::_propertyChanged(");
+ }
+
+ Resize();
+ }
+ }
+}
+//------------------------------------------------------------------------------
+sal_Bool OReportSection::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_pFunc.get() ? m_pFunc->handleKeyEvent(_rEvent) : sal_False;
+}
+// -----------------------------------------------------------------------------
+void OReportSection::deactivateOle()
+{
+ if ( m_pFunc.get() )
+ m_pFunc->deactivateOle(true);
+}
+// -----------------------------------------------------------------------------
+void OReportSection::createDefault(const ::rtl::OUString& _sType)
+{
+ SdrObject* pObj = m_pView->GetCreateObj();//rMarkList.GetMark(0)->GetObj();
+ if ( !pObj )
+ return;
+ createDefault(_sType,pObj);
+}
+// -----------------------------------------------------------------------------
+void OReportSection::createDefault(const ::rtl::OUString& _sType,SdrObject* _pObj)
+{
+ 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(NULL);
+ 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< uno::XInterface > >& _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);
+ const 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->getViewsWindow()->getPosition(m_pParent);
+ 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->getViewsWindow()->getSectionCount() > (nCurrentPosition + 1) )
+ {
+ return DND_ACTION_COPY;
+ }
+ return DND_ACTION_NONE;
+ }
+ }
+ else
+ {
+ const DataFlavorExVector& rFlavors = GetDataFlavorExVector();
+ if ( ::svx::OMultiColumnTransferable::canExtractDescriptor(rFlavors)
+ || ::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));
+ const MouseEvent aMouseEvt(aDropPos);
+ if ( m_pFunc->isOverlapping(aMouseEvt) )
+ return DND_ACTION_NONE;
+
+ sal_Int8 nDropOption = DND_ACTION_NONE;
+ const TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable);
+ DataFlavorExVector& rFlavors = aDropped.GetDataFlavorExVector();
+ bool bMultipleFormat = ::svx::OMultiColumnTransferable::canExtractDescriptor(rFlavors);
+ if ( OReportExchange::canExtract(rFlavors) )
+ {
+ OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aDropped);
+ Paste(aCopies,true);
+ nDropOption = DND_ACTION_COPYMOVE;
+ m_pParent->getViewsWindow()->BrkAction();
+ m_pParent->getViewsWindow()->unmarkAllObjects(m_pView);
+ //m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True);
+ } // if ( OReportExchange::canExtract(rFlavors) )
+ else if ( bMultipleFormat
+ || ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) )
+ {
+ m_pParent->getViewsWindow()->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();
+
+ uno::Sequence<beans::PropertyValue> aValues;
+ if ( !bMultipleFormat )
+ {
+ ::svx::ODataAccessDescriptor aDescriptor = ::svx::OColumnTransferable::extractColumnDescriptor(aDropped);
+
+ aValues.realloc(1);
+ aValues[0].Value <<= aDescriptor.createPropertyValueSequence();
+ } // if ( !bMultipleFormat )
+ else
+ aValues = ::svx::OMultiColumnTransferable::extractDescriptor(aDropped);
+
+ beans::PropertyValue* pIter = aValues.getArray();
+ beans::PropertyValue* pEnd = pIter + aValues.getLength();
+ for(;pIter != pEnd; ++pIter)
+ {
+ uno::Sequence<beans::PropertyValue> aCurrent;
+ pIter->Value >>= aCurrent;
+ sal_Int32 nLength = aCurrent.getLength();
+ if ( nLength )
+ {
+ aCurrent.realloc(nLength + 3);
+ aCurrent[nLength].Name = PROPERTY_POSITION;
+ aCurrent[nLength++].Value <<= AWTPoint(aDropPos);
+ // give also the DND Action (Shift|Ctrl) Key to really say what we want
+ aCurrent[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction"));
+ aCurrent[nLength++].Value <<= _rEvt.mnAction;
+
+ aCurrent[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section"));
+ aCurrent[nLength++].Value <<= getSection();
+ pIter->Value <<= aCurrent;
+ }
+ }
+
+ // we use this way to create undo actions
+ OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController();
+ rController.executeChecked(SID_ADD_CONTROL_PAIR,aValues);
+ nDropOption = DND_ACTION_COPY;
+ }
+ return nDropOption;
+}
+// -----------------------------------------------------------------------------
+void OReportSection::stopScrollTimer()
+{
+ m_pFunc->stopScrollTimer();
+}
+// -----------------------------------------------------------------------------
+bool OReportSection::isUiActive() const
+{
+ return m_pFunc->isUiActive();
+}
+// -----------------------------------------------------------------------------
+// =============================================================================
+}
+// =============================================================================
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
new file mode 100644
index 000000000000..3a2f4559b43a
--- /dev/null
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -0,0 +1,444 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ReportWindow.hxx"
+#include "ReportSection.hxx"
+#include "SectionView.hxx"
+#include "ViewsWindow.hxx"
+#include "ReportRuler.hxx"
+#include "DesignView.hxx"
+
+#include <tools/debug.hxx>
+#include <svtools/colorcfg.hxx>
+#include <svl/itempool.hxx>
+#include <unotools/syslocale.hxx>
+
+#include "RptDef.hxx"
+#include "dlgedfunc.hxx"
+#include "RptModel.hxx"
+#include "uistrings.hrc"
+#include "RptPage.hxx"
+#include "ReportController.hxx"
+#include "EndMarker.hxx"
+#include "ColorChanger.hxx"
+#include "ScrollHelper.hxx"
+
+#include "helpids.hrc"
+#include "dlgedfac.hxx"
+#include <boost/bind.hpp>
+#include <toolkit/helper/vclunohelper.hxx>
+
+
+#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)
+,m_aViewsWindow(this)
+,m_pObjFac( new DlgEdFactory() )
+{
+ DBG_CTOR( rpt_OReportWindow,NULL);
+ SetHelpId(UID_RPT_REPORTWINDOW);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ m_aViewsWindow.Show();
+
+ m_aHRuler.Show();
+ m_aHRuler.Activate();
+ m_aHRuler.SetPagePos(0);
+ m_aHRuler.SetBorders();
+ m_aHRuler.SetIndents();
+ m_aHRuler.SetMargin1();
+ m_aHRuler.SetMargin2();
+ const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+ m_aHRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
+
+ ImplInitSettings();
+}
+//------------------------------------------------------------------------------
+OReportWindow::~OReportWindow()
+{
+ DBG_DTOR( rpt_OReportWindow,NULL);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::initialize()
+{
+ m_aViewsWindow.initialize();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ m_aViewsWindow.SetInsertObj( eObj,_sShapeType);
+}
+
+//----------------------------------------------------------------------------
+rtl::OUString OReportWindow::GetInsertObjString() const
+{
+ return m_aViewsWindow.GetInsertObjString();
+}
+//------------------------------------------------------------------------------
+void OReportWindow::SetMode( DlgEdMode eNewMode )
+{
+ m_aViewsWindow.SetMode(eNewMode);
+}
+//----------------------------------------------------------------------------
+void OReportWindow::removeSection(USHORT _nPosition)
+{
+ m_aViewsWindow.removeSection(_nPosition);
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+ m_aViewsWindow.Invalidate(INVALIDATE_TRANSPARENT);
+ //Resize();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
+{
+ if ( !_xSection.is() )
+ return;
+
+ m_aViewsWindow.addSection(_xSection,_sColorEntry,_nPosition);
+
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+}
+//------------------------------------------------------------------------------
+void OReportWindow::toggleGrid(sal_Bool _bVisible)
+{
+ m_aViewsWindow.toggleGrid(_bVisible);
+}
+//----------------------------------------------------------------------------
+void OReportWindow::showRuler(sal_Bool _bShow)
+{
+ m_aHRuler.Show(_bShow);
+
+ m_aViewsWindow.showRuler(_bShow);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::getMaxMarkerWidth(sal_Bool _bWithEnd) const
+{
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX();
+ if ( _bWithEnd )
+ aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH));
+ return sal_Int32((long)aStartWidth);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OReportWindow::GetTotalWidth() const
+{
+ sal_Int32 nWidth = 0;
+ if ( !m_aViewsWindow.empty() )
+ {
+ Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
+ const Fraction aZoom(m_pView->getController().getZoomValue(),100);
+ aStartWidth *= aZoom; // m_aViewsWindow.GetMapMode().GetScaleX();;
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
+ Fraction aPaperWidth(nPaperWidth,1);
+ aPaperWidth *= aZoom;
+ const Size aPageSize = LogicToPixel(Size(aPaperWidth,0));
+ nWidth = aPageSize.Width() + long(aStartWidth);
+ }
+ return nWidth;
+}
+//------------------------------------------------------------------------------
+void OReportWindow::Resize()
+{
+ Window::Resize();
+ if ( !m_aViewsWindow.empty() )
+ {
+ const Size aTotalOutputSize = GetOutputSizePixel();
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
+
+ const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MAP_APPFONT );
+ Point aStartPoint((long)aStartWidth + aOffset.X(),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 = m_aViewsWindow.LogicToPixel(Size(nPaperWidth ,0));
+ nLeftMargin = m_aViewsWindow.LogicToPixel(Size(nLeftMargin,0)).Width();
+ nRightMargin = m_aViewsWindow.LogicToPixel(Size(nRightMargin,0)).Width();
+
+ aPageSize.Height() = m_aHRuler.GetSizePixel().Height();
+
+ const long nTermp(m_aViewsWindow.getTotalHeight() + aPageSize.Height());
+ long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.Height());
+
+ 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();
+
+ aStartPoint.X() = aOffset.X();
+
+ m_aViewsWindow.SetPosSizePixel(aStartPoint,Size(aTotalOutputSize.Width(),nSectionsHeight));
+ }
+}
+//------------------------------------------------------------------------------
+Point OReportWindow::getThumbPos() const
+{
+ return m_pParent->getThumbPos();
+}
+//------------------------------------------------------------------------------
+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::GetTotalHeight() const
+{
+ return m_aViewsWindow.getTotalHeight();
+}
+//------------------------------------------------------------------------------
+void OReportWindow::ScrollChildren(const Point& _aThumbPos)
+{
+ MapMode aMap = m_aHRuler.GetMapMode();
+ Point aOrg( aMap.GetOrigin() );
+ if ( aOrg.X() != (-_aThumbPos.X()) )
+ {
+ aMap.SetOrigin( Point(- _aThumbPos.X(), aOrg.Y()));
+ m_aHRuler.SetMapMode( aMap );
+ m_aHRuler.Scroll(-(aOrg.X() + _aThumbPos.X()),0);
+ }
+
+ /*const Point aPos(PixelToLogic(_aThumbPos));*/
+ m_aViewsWindow.scrollChildren(_aThumbPos);
+}
+//----------------------------------------------------------------------------
+USHORT OReportWindow::getSectionCount() const
+{
+ return m_aViewsWindow.getSectionCount();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::notifySizeChanged()
+{
+ m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
+}
+//----------------------------------------------------------------------------
+BOOL OReportWindow::HasSelection() const
+{
+ return m_aViewsWindow.HasSelection();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Delete()
+{
+
+ m_aViewsWindow.Delete();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Copy()
+{
+
+ m_aViewsWindow.Copy();
+}
+//----------------------------------------------------------------------------
+void OReportWindow::Paste()
+{
+
+ m_aViewsWindow.Paste();
+}
+//----------------------------------------------------------------------------
+BOOL OReportWindow::IsPasteAllowed() const
+{
+ return m_aViewsWindow.IsPasteAllowed();
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::SelectAll(const sal_uInt16 _nObjectType)
+{
+
+ m_aViewsWindow.SelectAll(_nObjectType);
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::unmarkAllObjects(OSectionView* _pSectionView)
+{
+
+ m_aViewsWindow.unmarkAllObjects(_pSectionView);
+}
+//-----------------------------------------------------------------------------
+void OReportWindow::showProperties(const uno::Reference< report::XSection>& _xReportComponent)
+{
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aViewsWindow.getSectionWindow( _xReportComponent );
+ m_pView->UpdatePropertyBrowserDelayed(pSectionWindow->getReportSection().getSectionView());
+}
+//------------------------------------------------------------------------------
+sal_Bool OReportWindow::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_aViewsWindow.handleKeyEvent(_rEvent);
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ if ( _pSectionView )
+ m_aViewsWindow.setMarked(_pSectionView,_bMark);
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+
+ m_aViewsWindow.setMarked(_xSection,_bMark);
+}
+//------------------------------------------------------------------------
+void OReportWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape,sal_Bool _bMark)
+{
+
+ m_aViewsWindow.setMarked(_xShape,_bMark);
+}
+//-----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OReportWindow::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_aViewsWindow.getMarkedSection(nsa);
+}
+//-----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OReportWindow::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+{
+ return m_aViewsWindow.getSectionWindow(_xSection);
+}
+// -------------------------------------------------------------------------
+void OReportWindow::markSection(const sal_uInt16 _nPos)
+{
+
+ m_aViewsWindow.markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+
+ m_aViewsWindow.fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
+{
+
+ m_aViewsWindow.collapseSections(_aCollpasedSections);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
+{
+
+ m_aViewsWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::setGridSnap(BOOL bOn)
+{
+
+ m_aViewsWindow.setGridSnap(bOn);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::setDragStripes(BOOL bOn)
+{
+ m_aViewsWindow.setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 OReportWindow::getMarkedObjectCount() const
+{
+ return m_aViewsWindow.getMarkedObjectCount();
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::zoom(const Fraction& _aZoom)
+{
+ m_aHRuler.SetZoom(_aZoom);
+ m_aHRuler.Invalidate();
+
+ //setZoomFactor(_aZoom,*this); // if this will be include the H - ruler has the wrong size
+ m_aViewsWindow.zoom(_aZoom);
+
+ notifySizeChanged();
+ const Point aNewThumbPos( m_pParent->getThumbPos() );
+
+ ScrollChildren( aNewThumbPos );
+ Resize();
+
+ Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
+}
+// -----------------------------------------------------------------------------
+void OReportWindow::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
+{
+ m_aViewsWindow.fillControlModelSelection(_rSelection);
+}
+// -----------------------------------------------------------------------------
+sal_Int32 OReportWindow::impl_getRealPixelWidth() const
+{
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
+ MapMode aMap( MAP_100TH_MM );
+ const Size aPageSize = LogicToPixel(Size(nPaperWidth,0),aMap);
+ return aPageSize.Width() + REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH + SECTION_OFFSET;
+}
+// -----------------------------------------------------------------------------
+sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
+{
+ sal_uInt16 nZoom(100);
+ const Size aSize( GetSizePixel() );
+ switch( _eType)
+ {
+ case SVX_ZOOM_PERCENT:
+ nZoom = m_pView->getController().getZoomValue();
+ break;
+ case SVX_ZOOM_OPTIMAL:
+ break;
+ case SVX_ZOOM_WHOLEPAGE:
+ {
+ nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
+ MapMode aMap( MAP_100TH_MM );
+ const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap);
+ nZoom = ::std::min(nZoom,(USHORT)(long)Fraction(aSize.Height()*100,aHeight.Height()));
+ }
+ break;
+ case SVX_ZOOM_PAGEWIDTH:
+ nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
+ break;
+ default:
+ break;
+ }
+
+ return nZoom;
+}
+//==================================================================
+} //rptui
+//==================================================================
+
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
new file mode 100644
index 000000000000..b6ab83e24a64
--- /dev/null
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -0,0 +1,416 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "ScrollHelper.hxx"
+#include "DesignView.hxx"
+#include "ReportController.hxx"
+#include "ReportWindow.hxx"
+#include "UITools.hxx"
+#include <tools/debug.hxx>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <toolkit/helper/convert.hxx>
+#include <vcl/svapp.hxx>
+
+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,const Point& _aPos,const Size& _aSize,ScrollBar& _rScrollBar)
+{
+ _rScrollBar.SetPosSizePixel(_aPos,_aSize);
+ _rScrollBar.SetPageSize( _nNewValue );
+ _rScrollBar.SetVisibleSize( _nNewValue );
+}
+
+// -----------------------------------------------------------------------------
+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_aReportWindow(this,m_pParent)
+ ,m_pReportDefintionMultiPlexer(NULL)
+{
+ DBG_CTOR( rpt_OScrollWindowHelper,NULL);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ impl_initScrollBar( m_aHScroll );
+ impl_initScrollBar( m_aVScroll );
+
+ m_aReportWindow.SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aReportWindow.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();
+}
+
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::impl_initScrollBar( ScrollBar& _rScrollBar ) const
+{
+ AllSettings aSettings( _rScrollBar.GetSettings() );
+ StyleSettings aStyle( aSettings.GetStyleSettings() );
+ aStyle.SetDragFullOptions( aStyle.GetDragFullOptions() | DRAGFULL_OPTION_SCROLL ); // live scrolling
+ aSettings.SetStyleSettings( aStyle );
+ _rScrollBar.SetSettings( aSettings );
+ //_rScrollBar.SetMapMode( MapMode( MAP_100TH_MM ) );
+
+ _rScrollBar.SetScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) );
+ _rScrollBar.SetLineSize( SCR_LINE_SIZE );
+}
+
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::initialize()
+{
+ uno::Reference<report::XReportDefinition> xReportDefinition = m_pParent->getController().getReportDefinition();
+ m_pReportDefintionMultiPlexer = addStyleListener(xReportDefinition,this);
+
+ m_aReportWindow.initialize();
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight)
+{
+ m_aTotalPixelSize.Width() = _nWidth;
+ m_aTotalPixelSize.Height() = _nHeight;
+
+ // now set the ranges without start marker
+ Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100);
+ long nWidth = long(_nWidth - (double)aStartWidth);
+ m_aHScroll.SetRangeMax( nWidth );
+ m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
+
+ Resize();
+}
+//------------------------------------------------------------------------------
+Size OScrollWindowHelper::ResizeScrollBars()
+{
+ // get the new output-size in pixel
+ Size aOutPixSz = GetOutputSizePixel();
+ if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 )
+ return aOutPixSz;
+
+ aOutPixSz.Height() -= m_aReportWindow.getRulerHeight();
+ // 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
+
+ aOutPixSz.Height() += m_aReportWindow.getRulerHeight();
+
+ // 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.Width(), aOutPixSz.Height()), 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
+ {
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
+ const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth;
+ lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll);
+ }
+ {
+ const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight();
+ lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll);
+ }
+
+ return aOutPixSz;
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::Resize()
+{
+ OScrollWindowHelper_BASE::Resize();
+ const Size aTotalOutputSize = ResizeScrollBars();
+
+ m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize);
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ )
+{
+ m_aReportWindow.ScrollChildren( getThumbPos() );
+ return 0;
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _xSection
+ ,const ::rtl::OUString& _sColorEntry
+ ,USHORT _nPosition)
+{
+ m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::removeSection(USHORT _nPosition)
+{
+ m_aReportWindow.removeSection(_nPosition);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::toggleGrid(sal_Bool _bVisible)
+{
+ m_aReportWindow.toggleGrid(_bVisible);
+}
+//------------------------------------------------------------------------------
+USHORT OScrollWindowHelper::getSectionCount() const
+{
+ return m_aReportWindow.getSectionCount();
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType )
+{
+ m_aReportWindow.SetInsertObj(eObj,_sShapeType);
+}
+//----------------------------------------------------------------------------
+rtl::OUString OScrollWindowHelper::GetInsertObjString() const
+{
+ return m_aReportWindow.GetInsertObjString();
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode )
+{
+ m_aReportWindow.SetMode(_eNewMode);
+}
+//------------------------------------------------------------------------------
+BOOL OScrollWindowHelper::HasSelection() const
+{
+ return m_aReportWindow.HasSelection();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Delete()
+{
+ m_aReportWindow.Delete();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Copy()
+{
+ m_aReportWindow.Copy();
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::Paste()
+{
+ m_aReportWindow.Paste();
+}
+//----------------------------------------------------------------------------
+BOOL OScrollWindowHelper::IsPasteAllowed() const
+{
+ return m_aReportWindow.IsPasteAllowed();
+}
+//-----------------------------------------------------------------------------
+void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType)
+{
+ m_aReportWindow.SelectAll(_nObjectType);
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::unmarkAllObjects(OSectionView* _pSectionView)
+{
+ m_aReportWindow.unmarkAllObjects(_pSectionView);
+}
+//------------------------------------------------------------------------------
+sal_Int32 OScrollWindowHelper::getMaxMarkerWidth(sal_Bool _bWithEnd) const
+{
+ return m_aReportWindow.getMaxMarkerWidth(_bWithEnd);
+}
+//----------------------------------------------------------------------------
+void OScrollWindowHelper::showRuler(sal_Bool _bShow)
+{
+ m_aReportWindow.showRuler(_bShow);
+}
+//------------------------------------------------------------------------------
+sal_Bool OScrollWindowHelper::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ return m_aReportWindow.handleKeyEvent(_rEvent);
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(OSectionView* _pSectionView,sal_Bool _bMark)
+{
+ m_aReportWindow.setMarked(_pSectionView,_bMark);
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(const uno::Reference< report::XSection>& _xSection,sal_Bool _bMark)
+{
+ m_aReportWindow.setMarked(_xSection,_bMark);
+}
+//------------------------------------------------------------------------
+void OScrollWindowHelper::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape,sal_Bool _bMark)
+{
+ m_aReportWindow.setMarked(_xShape,_bMark);
+}
+// -------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const
+{
+ return m_aReportWindow.getMarkedSection(nsa);
+}
+// -------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+{
+ return m_aReportWindow.getSectionWindow(_xSection);
+}
+// -------------------------------------------------------------------------
+void OScrollWindowHelper::markSection(const sal_uInt16 _nPos)
+{
+ m_aReportWindow.markSection(_nPos);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ m_aReportWindow.fillCollapsedSections(_rCollapsedPositions);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
+{
+ m_aReportWindow.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)
+{
+ m_aReportWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+}
+//------------------------------------------------------------------------------
+void OScrollWindowHelper::ImplInitSettings()
+{
+ SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
+ // SetBackground( Wallpaper( COL_LIGHTRED ));
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+ SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() );
+}
+//-----------------------------------------------------------------------------
+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)
+{
+ m_aReportWindow.notifySizeChanged();
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::setGridSnap(BOOL bOn)
+{
+ m_aReportWindow.setGridSnap(bOn);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::setDragStripes(BOOL bOn)
+{
+ m_aReportWindow.setDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const
+{
+ return m_aReportWindow.getMarkedObjectCount();
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::zoom(const Fraction& _aZoom)
+{
+ m_aReportWindow.zoom(_aZoom);
+ Resize();
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
+}
+// -----------------------------------------------------------------------------
+void OScrollWindowHelper::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
+{
+ m_aReportWindow.fillControlModelSelection(_rSelection);
+}
+// -----------------------------------------------------------------------------
+sal_uInt16 OScrollWindowHelper::getZoomFactor(SvxZoomType _eType) const
+{
+ return m_aReportWindow.getZoomFactor(_eType);
+}
+//==============================================================================
+} // rptui
+//==============================================================================
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
new file mode 100644
index 000000000000..e0d836a3d8c5
--- /dev/null
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -0,0 +1,274 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "SectionView.hxx"
+#include "DesignView.hxx"
+#include <RptPage.hxx>
+#include <RptObject.hxx>
+#include <RptDef.hxx>
+#include <svx/svxids.hrc>
+#include <svx/svddrgmt.hxx>
+#include <vcl/scrbar.hxx>
+#include "ReportSection.hxx"
+#include "ReportWindow.hxx"
+#include "uistrings.hrc"
+#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
+
+namespace rptui
+{
+ using namespace ::com::sun::star;
+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();
+ SetQuickTextEditMode(FALSE);
+}
+
+//----------------------------------------------------------------------------
+
+OSectionView::~OSectionView()
+{
+ DBG_DTOR( rpt_OSectionView,NULL);
+}
+
+//----------------------------------------------------------------------------
+
+void OSectionView::MarkListHasChanged()
+{
+ DBG_CHKTHIS( rpt_OSectionView,NULL);
+ SdrView::MarkListHasChanged();
+
+ if ( m_pReportWindow && m_pSectionWindow && !m_pSectionWindow->getPage()->getSpecialMode() )
+ {
+ //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 );
+ }
+ }
+ else
+ {
+ rWin.Invalidate(INVALIDATE_NOERASE);
+ }
+}
+//------------------------------------------------------------------------------
+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;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo )
+{
+ if (AreObjectsMarked())
+ {
+ // #i11702# use SdrUndoObjectLayerChange for undo
+ // STR_UNDO_SELATTR is "Attributes" - should use a different text later
+ BegUndo( );
+
+ const SdrMarkList& rMark = GetMarkedObjectList();
+ ULONG nCount = rMark.GetMarkCount();
+ for (ULONG i=0; i<nCount; i++)
+ {
+ SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
+ if ( pObj->ISA(OCustomShape) )
+ {
+ AddUndo( new SdrUndoObjectLayerChange( *pObj, pObj->GetLayer(), _nLayerNo) );
+ pObj->SetLayer( _nLayerNo );
+ OObjectBase* pBaseObj = dynamic_cast<OObjectBase*>(pObj);
+ try
+ {
+ pBaseObj->getReportComponent()->setPropertyValue(PROPERTY_OPAQUE,uno::makeAny(_nLayerNo == RPT_LAYER_FRONT));
+ }
+ catch(const uno::Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+ EndUndo();
+
+ // #84073# check mark list now instead of later in a timer
+ CheckMarked();
+ MarkListHasChanged();
+ }
+}
+// -----------------------------------------------------------------------------
+bool OSectionView::OnlyShapesMarked() const
+{
+ const SdrMarkList& rMark = GetMarkedObjectList();
+ const ULONG nCount = rMark.GetMarkCount();
+ if ( !nCount )
+ return false;
+ ULONG i=0;
+ for (; i<nCount; i++)
+ {
+ SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
+ if ( !pObj->ISA(OCustomShape) )
+ {
+ break;
+ }
+ } // for (ULONG i=0; i<nCount; i++)
+ return i == nCount;
+}
+
+bool OSectionView::IsDragResize() const
+{
+ const SdrDragMethod* pDragMethod = GetDragMethod();
+ if (pDragMethod)
+ {
+ bool bMoveOnly = pDragMethod->getMoveOnly();
+ if (bMoveOnly == false)
+ {
+ // current marked components will be resized
+ return true;
+ }
+ }
+ return false;
+}
+
+// -----------------------------------------------------------------------------
+short OSectionView::GetLayerIdOfMarkedObjects() const
+{
+ short nRet = SHRT_MAX;
+ const SdrMarkList &rMrkList = GetMarkedObjectList();
+ for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
+ {
+ const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if ( nRet == SHRT_MAX )
+ nRet = pObj->GetLayer();
+ else if ( nRet != pObj->GetLayer() )
+ {
+ nRet = -1;
+ break;
+ }
+ }
+ if ( nRet == SHRT_MAX )
+ nRet = -1;
+ return nRet;
+}
+
+//============================================================================
+} // rptui
+//============================================================================
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
new file mode 100644
index 000000000000..26ce8c13c2a6
--- /dev/null
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -0,0 +1,418 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "SectionWindow.hxx"
+#include "ReportWindow.hxx"
+#include "ReportRuler.hxx"
+#include "rptui_slotid.hrc"
+#include "ReportController.hxx"
+#include "SectionView.hxx"
+#include "RptDef.hxx"
+#include "ReportSection.hxx"
+#include "DesignView.hxx"
+#include "uistrings.hrc"
+#include "helpids.hrc"
+#include "RptResId.hrc"
+#include "StartMarker.hxx"
+#include "EndMarker.hxx"
+#include "ViewsWindow.hxx"
+
+#include <svtools/colorcfg.hxx>
+#include <boost/bind.hpp>
+#include <functional>
+#include <algorithm>
+#include <vcl/svapp.hxx>
+#include <connectivity/dbtools.hxx>
+
+namespace rptui
+{
+#define SECTION_OFFSET 3
+
+using namespace ::com::sun::star;
+using namespace ::comphelper;
+
+DBG_NAME( rpt_OSectionWindow )
+OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry)
+: Window( _pParent,WB_DIALOGCONTROL)
+,OPropertyChangeListener(m_aMutex)
+,m_pParent(_pParent)
+,m_aStartMarker( this,_sColorEntry)
+,m_aReportSection( this,_xSection)
+,m_aSplitter(this)
+,m_aEndMarker( this,_sColorEntry)
+{
+ DBG_CTOR( rpt_OSectionWindow,NULL);
+ SetUniqueId(UID_RPT_SECTIONSWINDOW);
+ const MapMode& rMapMode = _pParent->GetMapMode();
+ SetMapMode( rMapMode );
+ ImplInitSettings();
+ // TRY
+ m_aSplitter.SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aSplitter.SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl));
+ m_aSplitter.SetSplitHdl(LINK(this, OSectionWindow,SplitHdl));
+ m_aSplitter.SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl));
+ m_aSplitter.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
+ m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,_xSection->getHeight())).Height());
+
+
+ m_aStartMarker.setCollapsedHdl(LINK(this,OSectionWindow,Collapsed));
+
+ m_aStartMarker.zoom(rMapMode.GetScaleX());
+ setZoomFactor(rMapMode.GetScaleX(),m_aReportSection);
+ setZoomFactor(rMapMode.GetScaleX(),m_aSplitter);
+ setZoomFactor(rMapMode.GetScaleX(),m_aEndMarker);
+
+ m_aSplitter.Show();
+ m_aStartMarker.Show();
+ m_aReportSection.Show();
+ m_aEndMarker.Show();
+ Show();
+
+ m_pSectionMulti = new OPropertyChangeMultiplexer(this,_xSection.get());
+ m_pSectionMulti->addProperty(PROPERTY_NAME);
+ m_pSectionMulti->addProperty(PROPERTY_HEIGHT);
+
+ beans::PropertyChangeEvent aEvent;
+ aEvent.Source = _xSection;
+ aEvent.PropertyName = PROPERTY_NAME;
+ uno::Reference< report::XGroup > xGroup(_xSection->getGroup());
+ if ( xGroup.is() )
+ {
+ m_pGroupMulti = new OPropertyChangeMultiplexer(this,xGroup.get());
+ m_pGroupMulti->addProperty(PROPERTY_EXPRESSION);
+ aEvent.Source = xGroup;
+ aEvent.PropertyName = PROPERTY_EXPRESSION;
+ }
+
+ _propertyChanged(aEvent);
+ SetPaintTransparent(TRUE);
+}
+// -----------------------------------------------------------------------------
+OSectionWindow::~OSectionWindow()
+{
+ DBG_DTOR( rpt_OSectionWindow,NULL);
+ try
+ {
+ if ( m_pSectionMulti.is() )
+ m_pSectionMulti->dispose();
+ if ( m_pGroupMulti.is() )
+ m_pGroupMulti->dispose();
+ }
+ catch (uno::Exception&)
+ {
+ }
+}
+// -----------------------------------------------------------------------------
+void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException)
+{
+ const uno::Reference< report::XSection > xSection(_rEvent.Source,uno::UNO_QUERY);
+ if ( xSection.is() )
+ {
+ const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection();
+ if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) )
+ {
+ m_pParent->getView()->SetUpdateMode(FALSE);
+ Resize();
+ m_pParent->getView()->notifySizeChanged();
+ m_pParent->resize(*this);
+ m_pParent->getView()->SetUpdateMode(TRUE);
+ m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
+ m_aEndMarker.Invalidate(INVALIDATE_NOERASE);
+ m_aReportSection.Invalidate(/*INVALIDATE_NOERASE*/);
+ getViewsWindow()->getView()->getReportView()->getController().resetZoomType();
+ // Invalidate(INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
+ // m_pParent->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE|INVALIDATE_TRANSPARENT);
+ // m_pParent->Invalidate(/*INVALIDATE_NOCHILDREN | INVALIDATE_NOERASE |*/ INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
+ }
+ else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() )
+ {
+ uno::Reference< report::XReportDefinition > xReport = xSection->getReportDefinition();
+ if ( setReportSectionTitle(xReport,RID_STR_REPORT_HEADER,::std::mem_fun(&OReportHelper::getReportHeader),::std::mem_fun(&OReportHelper::getReportHeaderOn))
+ || setReportSectionTitle(xReport,RID_STR_REPORT_FOOTER,::std::mem_fun(&OReportHelper::getReportFooter),::std::mem_fun(&OReportHelper::getReportFooterOn))
+ || setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn))
+ || setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) )
+ m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
+ else
+ {
+ String sTitle = String(ModuleRes(RID_STR_DETAIL));
+ m_aStartMarker.setTitle(sTitle);
+ m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ }
+ }
+ } // if ( xSection.is() )
+ else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) )
+ {
+ uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY);
+ if ( xGroup.is() )
+ {
+ if ( !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)) )
+ setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn));
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OReportHelper> _pIsSectionOn)
+{
+ OReportHelper aReportHelper(_xReport);
+ const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection();
+ if ( bRet )
+ {
+ String sTitle = String(ModuleRes(_nResId));
+ m_aStartMarker.setTitle(sTitle);
+ m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ } // if ( bRet )
+ return bRet;
+}
+// -----------------------------------------------------------------------------
+bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OGroupHelper> _pIsSectionOn)
+{
+ OGroupHelper aGroupHelper(_xGroup);
+ const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ;
+ if ( bRet )
+ {
+ ::rtl::OUString sExpression = _xGroup->getExpression();
+ ::rtl::OUString sLabel = getViewsWindow()->getView()->getReportView()->getController().getColumnLabel_throw(sExpression);
+ if ( sLabel.getLength() )
+ {
+ sExpression = sLabel;
+ }
+
+ String sTitle = String(ModuleRes(_nResId));
+ sTitle.SearchAndReplace('#',sExpression);
+ m_aStartMarker.setTitle(sTitle);
+ m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ } // if ( _pIsSectionOn(&aGroupHelper) )
+ return bRet;
+}
+//------------------------------------------------------------------------------
+void OSectionWindow::ImplInitSettings()
+{
+ SetBackground( );
+ //SetBackground( Wallpaper( COL_RED ));
+}
+//-----------------------------------------------------------------------------
+void OSectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+//------------------------------------------------------------------------------
+void OSectionWindow::Resize()
+{
+ Window::Resize();
+
+ Size aOutputSize = GetOutputSizePixel();
+ Fraction aEndWidth(long(REPORT_ENDMARKER_WIDTH));
+ aEndWidth *= GetMapMode().GetScaleX();
+
+ const Point aThumbPos = m_pParent->getView()->getThumbPos();
+ aOutputSize.Width() -= aThumbPos.X();
+ aOutputSize.Height() -= m_aSplitter.GetSizePixel().Height();
+
+ if ( m_aStartMarker.isCollapsed() )
+ {
+ Point aPos(0,0);
+ m_aStartMarker.SetPosSizePixel(aPos,aOutputSize);
+ }
+ else
+ {
+ const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() + aOutputSize.Width() );
+
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ aStartWidth *= GetMapMode().GetScaleX();
+
+ // set start marker
+ m_aStartMarker.SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height()));
+
+ // set report section
+ const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
+ Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) );
+ Point aReportPos(aStartWidth,0);
+ aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth;
+ if ( bShowEndMarker )
+ aSectionSize.Width() -= (long)aEndWidth;
+
+ m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize);
+
+ // set splitter
+ aReportPos.Y() += aSectionSize.Height();
+ m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height()));
+ aSectionSize.Height() = (long)(1000 * (double)GetMapMode().GetScaleY());
+ m_aSplitter.SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize));
+
+ // set end marker
+ aReportPos.X() += aSectionSize.Width();
+ aReportPos.Y() = 0;
+ m_aEndMarker.Show(bShowEndMarker);
+ m_aEndMarker.SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height()));
+ }
+}
+// -----------------------------------------------------------------------------
+void OSectionWindow::setCollapsed(sal_Bool _bCollapsed)
+{
+ if ( m_aStartMarker.isCollapsed() != _bCollapsed )
+ {
+ m_aStartMarker.setCollapsed(_bCollapsed);
+ }
+}
+//-----------------------------------------------------------------------------
+void OSectionWindow::showProperties()
+{
+ m_pParent->getView()->showProperties( m_aReportSection.getSection().get() );
+}
+//-----------------------------------------------------------------------------
+void OSectionWindow::setMarked(sal_Bool _bMark)
+{
+ m_aStartMarker.setMarked(_bMark);
+ m_aEndMarker.setMarked(_bMark);
+}
+// -----------------------------------------------------------------------------
+IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
+{
+ if ( _pMarker )
+ {
+ sal_Bool bShow = !_pMarker->isCollapsed();
+ m_aReportSection.Show(bShow);
+ m_aEndMarker.Show(bShow);
+ m_aSplitter.Show(bShow);
+
+ m_pParent->resize(*this);
+ Resize();
+ // TRY
+ // m_pParent->Invalidate(INVALIDATE_TRANSPARENT | INVALIDATE_NOCHILDREN);
+ Invalidate();
+ }
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void OSectionWindow::zoom(const Fraction& _aZoom)
+{
+ setZoomFactor(_aZoom,*this);
+ m_aStartMarker.zoom(_aZoom);
+
+ setZoomFactor(_aZoom,m_aReportSection);
+ setZoomFactor(_aZoom,m_aSplitter);
+ setZoomFactor(_aZoom,m_aEndMarker);
+ //Resize();
+ Invalidate(/*INVALIDATE_UPDATE |*/ /* | INVALIDATE_TRANSPARENT *//*INVALIDATE_NOCHILDREN*/);
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, )
+{
+ const String sEmpty(ModuleRes(RID_STR_UNDO_CHANGE_SIZE));
+ getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->EnterListAction(sEmpty,String());
+ return 0L;
+}
+//------------------------------------------------------------------------------
+IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, )
+{
+ getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->LeaveListAction();
+ /*getViewsWindow()->Resize();*/
+ return 0L;
+}
+//-----------------------------------------------------------------------------
+IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter )
+{
+ if ( !getViewsWindow()->getView()->getReportView()->getController().isEditable() )
+ {
+ return 0L;
+ }
+
+ sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel();
+ const Point aPos = _pSplitter->GetPosPixel();
+
+
+ const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
+ nSplitPos = m_aSplitter.PixelToLogic(Size(0,nSplitPos)).Height();
+ // nSplitPos = xSection->getHeight() + m_aSplitter.PixelToLogic(Size(0,nSplitPos - aPos.Y() )).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 = ::std::max(nSplitPos,xReportComponent->getPositionY() + xReportComponent->getHeight());
+ }
+ } // for (sal_Int32 i = 0; i < nCount; ++i)
+
+ if ( nSplitPos < 0 )
+ nSplitPos = 0;
+
+ xSection->setHeight(nSplitPos);
+ m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,nSplitPos)).Height());
+
+ return 0L;
+}
+// -----------------------------------------------------------------------------
+void lcl_scroll(Window& _rWindow,const Point& _aDelta)
+{
+ _rWindow.Scroll(-_aDelta.X(),-_aDelta.Y()/*,SCROLL_CHILDREN*//*|SCROLL_CLIP*/);
+ _rWindow.Invalidate(INVALIDATE_TRANSPARENT);
+}
+// -----------------------------------------------------------------------------
+void lcl_setOrigin(Window& _rWindow,long _nX, long _nY)
+{
+ MapMode aMap = _rWindow.GetMapMode();
+ aMap.SetOrigin( Point(- _nX, - _nY));
+ _rWindow.SetMapMode( aMap );
+}
+//----------------------------------------------------------------------------
+void OSectionWindow::scrollChildren(long _nX)
+{
+ const Point aDelta( _nX,0 );
+
+ MapMode aMapMode( m_aReportSection.GetMapMode() );
+ const Point aOld = aMapMode.GetOrigin();
+ lcl_setOrigin(m_aReportSection,aDelta.X(), 0);
+
+ aMapMode = m_aReportSection.GetMapMode();
+ const Point aNew = aMapMode.GetOrigin();
+ const Point aDiff = aOld - aNew;
+ {
+ //OWindowPositionCorrector aCorrector(&m_aReportSection,-aDelta.Width(),0);
+ lcl_scroll(m_aReportSection,aDiff);
+ }
+
+ //lcl_setOrigin(m_aEndMarker,_nDeltaX, 0);
+ lcl_scroll(m_aEndMarker,m_aEndMarker.PixelToLogic(Point(_nX,0)));
+
+ lcl_setOrigin(m_aSplitter,_nX, 0);
+ lcl_scroll(m_aSplitter,aDiff);
+
+ Resize();
+}
+//==============================================================================
+} // rptui
+//==============================================================================
+
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
new file mode 100644
index 000000000000..c3fed866e534
--- /dev/null
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -0,0 +1,324 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "StartMarker.hxx"
+#include <vcl/image.hxx>
+#include <vcl/svapp.hxx>
+#include "RptResId.hrc"
+#include "ModuleHelper.hxx"
+#include "ColorChanger.hxx"
+#include "ReportDefines.hxx"
+#include "SectionWindow.hxx"
+#include "helpids.hrc"
+#include <vcl/help.hxx>
+#include <vcl/gradient.hxx>
+#include <vcl/lineinfo.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+#include <unotools/syslocale.hxx>
+#include <svl/smplhint.hxx>
+
+#define CORNER_SPACE 5
+
+//=====================================================================
+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(OSectionWindow* _pParent,const ::rtl::OUString& _sColorEntry)
+: OColorListener(_pParent,_sColorEntry)
+,m_aVRuler(this,WB_VERT)
+,m_aText(this,WB_HYPHENATION)
+,m_aImage(this,WB_LEFT|WB_TOP|WB_SCALE)
+,m_pParent(_pParent)
+,m_bShowRuler(sal_True)
+{
+ DBG_CTOR( rpt_OStartMarker,NULL);
+ SetUniqueId(HID_RPT_STARTMARKER);
+
+ osl_incrementInterlockedCount(&s_nImageRefCount);
+ initDefaultNodeImages();
+ ImplInitSettings();
+ m_aText.SetHelpId(HID_RPT_START_TITLE);
+ m_aImage.SetHelpId(HID_RPT_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();
+ const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
+ m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
+ SetPaintTransparent(TRUE);
+}
+// -----------------------------------------------------------------------------
+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::getMinHeight() const
+{
+ Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE));
+ aExtraWidth *= GetMapMode().GetScaleX();
+ return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + (long)aExtraWidth;
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::Paint( const Rectangle& rRect )
+{
+ Window::Paint( rRect );
+ //SetUpdateMode(FALSE);
+ Size aSize = GetOutputSizePixel();
+ long nSize = aSize.Width();
+ const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX());
+
+ if ( !isCollapsed() )
+ {
+ const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+ nSize = aSize.Width() - nVRulerWidth/* - m_nCornerSize*/;
+ SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size( nSize,aSize.Height())))));
+ aSize.Width() += nCornerWidth;
+ } // if ( !isCollapsed() )
+ else
+ SetClipRegion();
+
+ const Point aGcc3WorkaroundTemporary;
+ Rectangle aWholeRect(aGcc3WorkaroundTemporary,aSize);
+ {
+ const ColorChanger aColors( this, m_nTextBoundaries, m_nColor );
+ PolyPolygon aPoly;
+ aPoly.Insert(Polygon(aWholeRect,nCornerWidth,nCornerWidth));
+
+ 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(PixelToLogic(aPoly) ,aGradient);
+ }
+ if ( m_bMarked )
+ {
+ const long nCornerHeight = long(CORNER_SPACE * (double)GetMapMode().GetScaleY());
+ Rectangle aRect( Point(nCornerWidth,nCornerHeight),
+ Size(aSize.Width() - nCornerWidth - nCornerWidth,aSize.Height() - nCornerHeight - nCornerHeight));
+ ColorChanger aColors( this, COL_WHITE, COL_WHITE );
+ DrawPolyLine(Polygon(PixelToLogic(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.GetSizePixel());
+ if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) )
+ {
+ m_bCollapsed = !m_bCollapsed;
+
+ changeImage();
+
+ m_aVRuler.Show(!m_bCollapsed && m_bShowRuler);
+ if ( m_aCollapsedLink.IsSet() )
+ m_aCollapsedLink.Call(this);
+ }
+
+ m_pParent->showProperties();
+}
+// -----------------------------------------------------------------------------
+void OStartMarker::changeImage()
+{
+ Image* pImage = NULL;
+ if ( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC;
+ else
+ pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
+ m_aImage.SetImage(*pImage);
+}
+// -----------------------------------------------------------------------
+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 ( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ 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( COL_YELLOW ));
+ SetBackground( );
+ SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );
+ setColor();
+}
+//------------------------------------------------------------------------------
+void OStartMarker::Resize()
+{
+ const Size aOutputSize( GetOutputSizePixel() );
+ const long nOutputWidth = aOutputSize.Width();
+ const long nOutputHeight = aOutputSize.Height();
+
+ const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+ const Point aRulerPos(nOutputWidth - nVRulerWidth,0);
+ m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
+
+ Size aImageSize = m_aImage.GetImage().GetSizePixel();
+ const MapMode& rMapMode = GetMapMode();
+ aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX());
+ aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY());
+
+ Fraction aExtraWidth(long(REPORT_EXTRA_SPACE));
+ aExtraWidth *= rMapMode.GetScaleX();
+
+ Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth);
+ const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height());
+ m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
+
+ aPos.X() = aExtraWidth;
+ aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
+ m_aImage.SetPosSizePixel(aPos,aImageSize);
+}
+// -----------------------------------------------------------------------------
+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);
+}
+//------------------------------------------------------------------------------
+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);
+ changeImage();
+}
+// -----------------------------------------------------------------------
+void OStartMarker::zoom(const Fraction& _aZoom)
+{
+ setZoomFactor(_aZoom,*this);
+ m_aVRuler.SetZoom(_aZoom);
+ setZoomFactor(_aZoom,m_aText);
+ Resize();
+ Invalidate();
+}
+// -----------------------------------------------------------------------
+// =======================================================================
+}
+// =======================================================================
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
new file mode 100644
index 000000000000..bcd50236aab3
--- /dev/null
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -0,0 +1,1869 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+
+#include "ViewsWindow.hxx"
+#include "ScrollHelper.hxx"
+#include "UndoActions.hxx"
+#include "ReportWindow.hxx"
+#include "DesignView.hxx"
+#include <svtools/colorcfg.hxx>
+#include "ReportController.hxx"
+#include "UITools.hxx"
+#include "RptDef.hxx"
+#include "RptResId.hrc"
+#include "SectionView.hxx"
+#include "ReportSection.hxx"
+#include "uistrings.hrc"
+#include "rptui_slotid.hrc"
+#include "dlgedclip.hxx"
+#include "ColorChanger.hxx"
+#include "RptObject.hxx"
+#include "RptObject.hxx"
+#include "ModuleHelper.hxx"
+#include "EndMarker.hxx"
+#include <svx/svdpagv.hxx>
+#include <svx/unoshape.hxx>
+#include <vcl/svapp.hxx>
+#include <boost/bind.hpp>
+
+#include "helpids.hrc"
+#include <svx/svdundo.hxx>
+#include <toolkit/helper/convert.hxx>
+#include <algorithm>
+#include <numeric>
+
+namespace rptui
+{
+#define DEFAUL_MOVE_SIZE 100
+
+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;
+ }
+ if ( dynamic_cast<OUnoObject*>(_pObj) )
+ {
+ 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:
+ if ( _aObjRect.Left() < aOverlappingRect.Left() )
+ nXTemp += aOverlappingRect.Left() - aNewRect.Left() - aNewRect.getWidth();
+ else
+ nXTemp += aOverlappingRect.Right() - aNewRect.Left();
+ bMoveAllowed = _nXMov != nXTemp;
+ break;
+ case ControlModification::CENTER_VERTICAL:
+ if ( _aObjRect.Top() < aOverlappingRect.Top() )
+ nYTemp += aOverlappingRect.Top() - aNewRect.Top() - aNewRect.getHeight();
+ else
+ nYTemp += aOverlappingRect.Bottom() - aNewRect.Top();
+ 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( OReportWindow* _pReportWindow)
+: Window( _pReportWindow,WB_DIALOGCONTROL)
+,m_pParent(_pReportWindow)
+,m_bInUnmark(sal_False)
+{
+ DBG_CTOR( rpt_OViewsWindow,NULL);
+ SetPaintTransparent(TRUE);
+ SetUniqueId(UID_RPT_VIEWSWINDOW);
+ SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aColorConfig.AddListener(this);
+ ImplInitSettings();
+}
+// -----------------------------------------------------------------------------
+OViewsWindow::~OViewsWindow()
+{
+ m_aColorConfig.RemoveListener(this);
+ m_aSections.clear();
+
+ DBG_DTOR( rpt_OViewsWindow,NULL);
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::initialize()
+{
+
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet)
+{
+ const uno::Reference< report::XSection> xSection = _rSectionWindow.getReportSection().getSection();
+
+ Size aSectionSize = _rSectionWindow.LogicToPixel( Size( 0,xSection->getHeight() ) );
+ aSectionSize.Width() = getView()->GetTotalWidth();
+
+ const sal_Int32 nMinHeight = _rSectionWindow.getStartMarker().getMinHeight();
+ if ( _rSectionWindow.getStartMarker().isCollapsed() || nMinHeight > aSectionSize.Height() )
+ {
+ aSectionSize.Height() = nMinHeight;
+ }
+ const StyleSettings& rSettings = GetSettings().GetStyleSettings();
+ aSectionSize.Height() += (long)(rSettings.GetSplitSize() * (double)_rSectionWindow.GetMapMode().GetScaleY());
+
+ if ( _bSet )
+ _rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize);
+
+ _rStartPoint.Y() += aSectionSize.Height();
+}
+
+// -----------------------------------------------------------------------------
+void OViewsWindow::resize(const OSectionWindow& _rSectionWindow)
+{
+ bool bSet = false;
+ Point aStartPoint;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ const ::boost::shared_ptr<OSectionWindow> pSectionWindow = (*aIter);
+ if ( pSectionWindow.get() == &_rSectionWindow )
+ {
+ aStartPoint = pSectionWindow->GetPosPixel();
+ bSet = true;
+ } // if ( pSectionWindow.get() == &_rSectionWindow )
+
+ if ( bSet )
+ {
+ impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,bSet);
+ pSectionWindow->Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
+ pSectionWindow->getStartMarker().Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT );
+ }
+ } // for (;aIter != aEnd ; ++aIter,++nPos)
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ aStartWidth *= GetMapMode().GetScaleX();
+ Size aOut = GetOutputSizePixel();
+ aOut.Width() = aStartWidth;
+ aOut = PixelToLogic(aOut);
+ m_pParent->notifySizeChanged();
+
+ Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
+ Invalidate(aRect,INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT);
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::Resize()
+{
+ Window::Resize();
+ if ( !m_aSections.empty() )
+ {
+ const Point aOffset(m_pParent->getThumbPos());
+ Point aStartPoint(0,-aOffset.Y());
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (USHORT nPos=0;aIter != aEnd ; ++aIter,++nPos)
+ {
+ const ::boost::shared_ptr<OSectionWindow> pSectionWindow = (*aIter);
+ impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,true);
+ } // for (;aIter != aEnd ; ++aIter)
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::Paint( const Rectangle& rRect )
+{
+ Window::Paint( rRect );
+
+ Size aOut = GetOutputSizePixel();
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ aStartWidth *= GetMapMode().GetScaleX();
+
+ aOut.Width() -= (long)aStartWidth;
+ aOut = PixelToLogic(aOut);
+
+ Rectangle aRect(PixelToLogic(Point(aStartWidth,0)),aOut);
+ Wallpaper aWall( m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor );
+ DrawWallpaper(aRect,aWall);
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::ImplInitSettings()
+{
+ // SetBackground( Wallpaper( COL_LIGHTBLUE ));
+ SetBackground( );
+ 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<OSectionWindow> pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) );
+ m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow));
+ m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),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)->getReportSection().getSectionView());
+
+ m_aSections.erase(aPos);
+ Resize();
+ } // if ( _nPosition < m_aSections.size() )
+}
+//------------------------------------------------------------------------------
+void OViewsWindow::toggleGrid(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
+{
+ sal_Int32 nHeight = 0;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ nHeight += (*aIter)->GetSizePixel().Height();
+ }
+ return nHeight;
+}
+//----------------------------------------------------------------------------
+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)->getReportSection().getSectionView().SetCurrentObj( eObj, ReportInventor );
+
+ m_sShapeType = _sShapeType;
+}
+//----------------------------------------------------------------------------
+rtl::OUString OViewsWindow::GetInsertObjString() const
+{
+ return m_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() const
+{
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd && !(*aIter)->getReportSection().getSectionView().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;
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OReportSection::Copy,_1,::boost::ref(aAllreadyCopiedObjects)),TReportPairHelper()));
+
+ //TSectionsMap::iterator aIter = m_aSections.begin();
+ //TSectionsMap::iterator aEnd = m_aSections.end();
+ //for (; aIter != aEnd; ++aIter)
+ // (*aIter)->getReportSection().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<OSectionWindow> pMarkedSection = getMarkedSection();
+ if ( pMarkedSection )
+ pMarkedSection->getReportSection().Paste(aCopies,true);
+ }
+}
+// ---------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const uno::Reference< report::XSection>& _xSection) const
+{
+ OSL_ENSURE(_xSection.is(),"Section is NULL!");
+
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ((*aIter)->getReportSection().getSection() == _xSection)
+ {
+ pSectionWindow = (*aIter);
+ break;
+ }
+ }
+
+ return pSectionWindow;
+}
+
+//----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OViewsWindow::getMarkedSection(NearSectionAccess nsa) const
+{
+ ::boost::shared_ptr<OSectionWindow> 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)->getStartMarker().isMarked() )
+ {
+ if (nsa == CURRENT)
+ {
+ pRet = (*aIter);
+ break;
+ }
+ else if ( nsa == PREVIOUS )
+ {
+ if (nCurrentPosition > 0)
+ {
+ pRet = (*(--aIter));
+ if (pRet == NULL)
+ {
+ pRet = (*m_aSections.begin());
+ }
+ }
+ else
+ {
+ // if we are out of bounds return the first one
+ pRet = (*m_aSections.begin());
+ }
+ break;
+ }
+ else if ( nsa == POST )
+ {
+ sal_uInt32 nSize = m_aSections.size();
+ if ((nCurrentPosition + 1) < nSize)
+ {
+ pRet = *(++aIter);
+ if (pRet == NULL)
+ {
+ pRet = (*(--aEnd));
+ }
+ }
+ else
+ {
+ // if we are out of bounds return the last one
+ pRet = (*(--aEnd));
+ }
+ break;
+ }
+ } // ( (*aIter).second->isMarked() )
+ ++nCurrentPosition;
+ } // for (; aIter != aEnd ; ++aIter)
+
+ return pRet;
+}
+// -------------------------------------------------------------------------
+void OViewsWindow::markSection(const sal_uInt16 _nPos)
+{
+ if ( _nPos < m_aSections.size() )
+ m_pParent->setMarked(m_aSections[_nPos]->getReportSection().getSection(),sal_True);
+}
+//----------------------------------------------------------------------------
+BOOL OViewsWindow::IsPasteAllowed() const
+{
+ TransferableDataHelper aTransferData( TransferableDataHelper::CreateFromSystemClipboard( const_cast< OViewsWindow* >( this ) ) );
+ return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId());
+}
+//-----------------------------------------------------------------------------
+void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType)
+{
+ m_bInUnmark = sal_True;
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(::boost::mem_fn(&OReportSection::SelectAll),_1,_nObjectType),TReportPairHelper()));
+ m_bInUnmark = sal_False;
+}
+//-----------------------------------------------------------------------------
+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)->getReportSection().getSectionView() != _pSectionView )
+ {
+ (*aIter)->getReportSection().deactivateOle();
+ (*aIter)->getReportSection().getSectionView().UnmarkAllObj();
+ }
+ } // for (; aIter != aEnd ; ++aIter)
+ m_bInUnmark = sal_False;
+ }
+}
+//-----------------------------------------------------------------------------
+/*
+::boost::shared_ptr<OSectionWindow> OViewsWindow::getReportSection(const uno::Reference< report::XSection >& _xSection)
+{
+ OSL_ENSURE(_xSection.is(),"Section is NULL!");
+ ::boost::shared_ptr<OSectionWindow> pRet;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( (*aIter)->getReportSection().getSection() == _xSection )
+ {
+ pRet = (*aIter);
+ break;
+ } // if ( (*aIter)->getSection() == _xSection )
+ } // for (; aIter != aEnd ; ++aIter)
+ return pRet;
+}
+*/
+// -----------------------------------------------------------------------
+void OViewsWindow::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32)
+{
+ 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::showRuler(sal_Bool _bShow)
+{
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OStartMarker::showRuler,_1,_bShow),TStartMarkerHelper()));
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::bind(&OStartMarker::Window::Invalidate,_1,USHORT(INVALIDATE_NOERASE)),TStartMarkerHelper()));
+}
+//----------------------------------------------------------------------------
+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)->getReportSection().getSectionView().AreObjectsMarked() )
+ {
+ (*aIter)->getReportSection().MouseButtonUp(rMEvt);
+ break;
+ }
+ }
+
+ // remove special insert mode
+ for (aIter = m_aSections.begin();aIter != aEnd ; ++aIter)
+ {
+ (*aIter)->getReportSection().getPage()->resetSpecialMode();
+ }
+ }
+}
+//------------------------------------------------------------------------------
+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).getReportSection().getSectionView().->AreObjectsMarked() )
+ if ( (*aIter)->getStartMarker().isMarked() )
+ {
+ bRet = (*aIter)->getReportSection().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->getReportSection()->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)->getReportSection().getSection() != _xSection )
+ {
+ (*aIter)->setMarked(sal_False);
+ }
+ else if ( (*aIter)->getStartMarker().isMarked() != _bMark )
+ {
+ (*aIter)->setMarked(_bMark);
+ }
+ }
+}
+//------------------------------------------------------------------------
+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)
+ {
+ const uno::Reference< report::XSection> xSection = (*pIter)->getSection();
+ if ( xSection.is() )
+ {
+ if ( bFirst )
+ {
+ bFirst = false;
+ m_pParent->setMarked(xSection,_bMark);
+ }
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = getSectionWindow(xSection);
+ if ( pSectionWindow )
+ {
+ SvxShape* pShape = SvxShape::getImplementation( *pIter );
+ SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
+ OSL_ENSURE( pObject, "OViewsWindow::setMarked: no SdrObject for the shape!" );
+ if ( pObject )
+ pSectionWindow->getReportSection().getSectionView().MarkObj( pObject, pSectionWindow->getReportSection().getSectionView().GetSdrPageView(), !_bMark );
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+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& rView = (*aIter)->getReportSection().getSectionView();
+ if ( rView.AreObjectsMarked() )
+ {
+ rView.SortMarkedObjects();
+ const sal_uInt32 nCount = rView.GetMarkedObjectCount();
+ for (sal_uInt32 i=0; i < nCount; ++i)
+ {
+ const SdrMark* pM = rView.GetSdrMarkByIndex(i);
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ Rectangle aObjRect(_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect());
+ _rSortRectangles.insert(TRectangleMap::value_type(aObjRect,TRectangleMap::mapped_type(pObj,&rView)));
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection, bool _bBoundRects,Rectangle& _rBound,Rectangle& _rResize)
+{
+ bool bOnlyOnce = false;
+ 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
+ if ( ! bOnlyOnce )
+ {
+ bOnlyOnce = true;
+ OReportSection* pReportSection = aRectIter->second.second->getReportSection();
+ const 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())->getReportSection().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 && dynamic_cast<OUnoObject*>(aInterSectRectIter->second.first) )
+ {
+ 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));
+ {
+ OObjectBase* pObjBase = dynamic_cast<OObjectBase*>(pObj);
+ OSL_ENSURE(pObjBase,"Where comes this object from?");
+ if ( pObjBase )
+ {
+ if ( _nControlModification == ControlModification::WIDTH_SMALLEST || _nControlModification == ControlModification::WIDTH_GREATEST )
+ pObjBase->getReportComponent()->setSize(awt::Size(nXMov,aObjRect.getHeight()));
+ //pObj->Resize(aObjRect.TopLeft(),Fraction(nXMov,aObjRect.getWidth()),Fraction(1,1));
+ else if ( _nControlModification == ControlModification::HEIGHT_GREATEST || _nControlModification == ControlModification::HEIGHT_SMALLEST )
+ pObjBase->getReportComponent()->setSize(awt::Size(aObjRect.getWidth(),nYMov));
+ //pObj->Resize(aObjRect.TopLeft(),Fraction(1,1),Fraction(nYMov,aObjRect.getHeight()));
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ pView->AdjustMarkHdl();
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::createDefault()
+{
+ ::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection();
+ if ( pMarkedSection )
+ pMarkedSection->getReportSection().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)->getReportSection().getSectionView().SetGridSnap(bOn);
+ (*aIter)->getReportSection().Invalidate();
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::setDragStripes(BOOL bOn)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter)
+ (*aIter)->getReportSection().getSectionView().SetDragStripes(bOn);
+}
+// -----------------------------------------------------------------------------
+USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const
+{
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ USHORT nPosition = 0;
+ for (; aIter != aEnd ; ++aIter)
+ {
+ if ( _pSectionWindow == (*aIter).get() )
+ {
+ break;
+ }
+ ++nPosition;
+ }
+ return nPosition;
+}
+// -----------------------------------------------------------------------------
+::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const USHORT _nPos) const
+{
+ ::boost::shared_ptr<OSectionWindow> aReturn;
+
+ if ( _nPos < m_aSections.size() )
+ aReturn = m_aSections[_nPos];
+
+ return aReturn;
+}
+// -----------------------------------------------------------------------------
+namespace
+{
+ enum SectionViewAction
+ {
+ eEndDragObj,
+ eEndAction,
+ eMoveAction,
+ eMarkAction,
+ eForceToAnotherPage,
+ eBreakAction
+ };
+ class 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(SectionViewAction _eAction = eEndAction ) : m_eAction( _eAction ) { }
+ ApplySectionViewAction( const Point& _rPoint, SectionViewAction _eAction = eMoveAction ) : m_eAction( _eAction ), m_bCopy( sal_False ), m_aPoint( _rPoint ) { }
+
+ void operator() ( const OViewsWindow::TSectionsMap::value_type& _rhs )
+ {
+ OSectionView& rView( _rhs->getReportSection().getSectionView() );
+ switch ( m_eAction )
+ {
+ case eEndDragObj:
+ rView.EndDragObj( m_bCopy );
+ break;
+ case eEndAction:
+ if ( rView.IsAction() )
+ rView.EndAction ( );
+ break;
+ case eMoveAction:
+ rView.MovAction ( m_aPoint );
+ break;
+ case eMarkAction:
+ rView.BegMarkObj ( m_aPoint );
+ break;
+ case eForceToAnotherPage:
+ rView.ForceMarkedToAnotherPage();
+ break;
+ case eBreakAction:
+ if ( rView.IsAction() )
+ rView.BrkAction ( );
+ break;
+ // default:
+
+ }
+ }
+ };
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::BrkAction()
+{
+ EndDragObj_removeInvisibleObjects();
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction(eBreakAction) );
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView& _rSection)
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ Point aNewPos(0,0);
+
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ rReportSection.getPage()->setSpecialMode();
+ OSectionView& rView = rReportSection.getSectionView();
+
+ if ( &rView != &_rSection )
+ {
+// SdrRectObj *pNewObj = new SdrRectObj(OBJ_RECT, _aRect);
+// SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Temp Label")));
+ SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")));
+ if (pNewObj)
+ {
+ pNewObj->SetLogicRect(_aRect);
+ // pNewObj->SetSize(_aRect.GetSize());
+ // pNewObj->Move(Size(_aRect.Left(), _aRect.Top()));
+
+ pNewObj->Move(Size(0, aNewPos.Y()));
+ BOOL bChanged = rView.GetModel()->IsChanged();
+ rReportSection.getPage()->InsertObject(pNewObj);
+ rView.GetModel()->SetChanged(bChanged);
+ m_aBegDragTempList.push_back(pNewObj);
+ Rectangle aRect = pNewObj->GetLogicRect();
+
+ // pNewObj->SetText(String::CreateFromAscii("Drag helper"));
+ rView.MarkObj( pNewObj, rView.GetSdrPageView() );
+ }
+ }
+ const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aNewPos.Y() -= nSectionHeight;
+// aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ }
+}
+// -----------------------------------------------------------------------------
+bool OViewsWindow::isObjectInMyTempList(SdrObject *_pObj)
+{
+ return ::std::find(m_aBegDragTempList.begin(),m_aBegDragTempList.end(),_pObj) != m_aBegDragTempList.end();
+}
+
+// -----------------------------------------------------------------------------
+void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection)
+{
+ OSL_TRACE("BegDragObj Clickpoint X:%d Y:%d\n", _aPnt.X(), _aPnt.Y() );
+
+ m_aBegDragTempList.clear();
+
+ // Calculate the absolute clickpoint in the views
+ Point aAbsolutePnt = _aPnt;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ OSectionView* pView = &rReportSection.getSectionView();
+ if (pView == _pSection)
+ break;
+ const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aAbsolutePnt.Y() += nSectionHeight;
+ }
+ m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32);
+ OSL_TRACE("BegDragObj Absolute X:%d Y:%d\n", aAbsolutePnt.X(), aAbsolutePnt.Y() );
+
+ // Create drag lines over all viewable Views
+ // Therefore we need to identify the marked objects
+ // and create temporary objects on all other views at the same position
+ // relative to its occurance.
+
+ OSL_TRACE("BegDragObj createInvisible Objects\n" );
+ int nViewCount = 0;
+ Point aNewObjPos(0,0);
+ Point aLeftTop = Point(SAL_MAX_INT32, SAL_MAX_INT32);
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+
+ OSectionView& rView = rReportSection.getSectionView();
+
+ if ( rView.AreObjectsMarked() )
+ {
+ const sal_uInt32 nCount = rView.GetMarkedObjectCount();
+ for (sal_uInt32 i=0; i < nCount; ++i)
+ {
+ const SdrMark* pM = rView.GetSdrMarkByIndex(i);
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ if (!isObjectInMyTempList(pObj))
+ {
+ Rectangle aRect( pObj->GetCurrentBoundRect() );
+ aRect.Move(0, aNewObjPos.Y());
+
+ aLeftTop.X() = ::std::min( aRect.Left(), aLeftTop.X() );
+ aLeftTop.Y() = ::std::min( aRect.Top(), aLeftTop.Y() );
+
+ OSL_TRACE("BegDragObj createInvisible X:%d Y:%d on View #%d\n", aRect.Left(), aRect.Top(), nViewCount );
+
+ BegDragObj_createInvisibleObjectAtPosition(aRect, rView);
+
+ // calculate the clickpoint
+// const sal_Int32 nDeltaX = abs(aRect.Left() - aAbsolutePnt.X());
+// const sal_Int32 nDeltaY = abs(aRect.Top() - aAbsolutePnt.Y());
+// if (m_aDragDelta.X() > nDeltaX)
+// m_aDragDelta.X() = nDeltaX;
+// if (m_aDragDelta.Y() > nDeltaY)
+// m_aDragDelta.Y() = nDeltaY;
+ }
+ }
+ }
+ ++nViewCount;
+ Rectangle aClipRect = rView.GetWorkArea();
+ aClipRect.Top() = -aNewObjPos.Y();
+ rView.SetWorkArea( aClipRect );
+
+ const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aNewObjPos.Y() += nSectionHeight;
+
+ // don't subtract the height of the lines between the views
+ // aNewObjPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ }
+
+ const sal_Int32 nDeltaX = abs(aLeftTop.X() - aAbsolutePnt.X());
+ const sal_Int32 nDeltaY = abs(aLeftTop.Y() - aAbsolutePnt.Y());
+ m_aDragDelta.X() = nDeltaX;
+ m_aDragDelta.Y() = nDeltaY;
+
+ Point aNewPos = aAbsolutePnt;
+ // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ // {
+ // OReportSection& rReportSection = (*aIter)->getReportSection();
+ // if ( &rReportSection.getSectionView() == _pSection )
+ // break;
+ // aNewPos.Y() += rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ // }
+
+ const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width());
+ // long nLastSectionHeight = 0;
+ // bool bAdd = true;
+ nViewCount = 0;
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+
+ // if ( &rReportSection.getSectionView() == _pSection )
+ // {
+ // bAdd = false;
+ // aNewPos = _aPnt;
+ // }
+ // else if ( bAdd )
+ // {
+ // const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ // aNewPos.Y() += nSectionHeight;
+ // }
+ // else
+ // {
+ // aNewPos.Y() -= nLastSectionHeight;
+ // }
+
+ //?
+ SdrHdl* pHdl = _pHdl;
+ if ( pHdl )
+ {
+ if ( &rReportSection.getSectionView() != _pSection )
+ {
+ const SdrHdlList& rHdlList = rReportSection.getSectionView().GetHdlList();
+ pHdl = rHdlList.GetHdl(_pHdl->GetKind());
+ }
+ }
+ OSL_TRACE("BegDragObj X:%d Y:%d on View#%d\n", aNewPos.X(), aNewPos.Y(), nViewCount++ );
+ rReportSection.getSectionView().BegDragObj(aNewPos, (OutputDevice*)NULL, pHdl, nDrgLog, NULL);
+
+ const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aNewPos.Y() -= nSectionHeight;
+ // subtract the height between the views, because they are visible but not from interest here.
+ // aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ }
+}
+
+// -----------------------------------------------------------------------------
+void OViewsWindow::ForceMarkedToAnotherPage()
+{
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction(eForceToAnotherPage ) );
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection)
+{
+ bool bAdd = true;
+ Point aNewPos = _aPnt;
+
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ long nLastSectionHeight = 0;
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ if ( &rReportSection.getSectionView() == _pSection )
+ {
+ bAdd = false;
+ aNewPos = _aPnt; // 2,2
+ }
+ else if ( bAdd )
+ {
+ const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aNewPos.Y() += nSectionHeight;
+ }
+ else
+ {
+ aNewPos.Y() -= nLastSectionHeight;
+ }
+ rReportSection.getSectionView().BegMarkObj ( aNewPos );
+ nLastSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+
+ // aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ }
+ //::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( _aPnt , eMarkAction) );
+}
+// -----------------------------------------------------------------------------
+OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt)
+{
+ OSectionView* pSection = NULL;
+ sal_Int32 nCount = 0;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ const TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd ; ++aIter,++nCount)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ if ( &rReportSection.getSectionView() == _pSection)
+ break;
+ }
+ OSL_ENSURE(aIter != aEnd,"This can never happen!");
+ if ( _rPnt.Y() < 0 )
+ {
+ if ( nCount )
+ --aIter;
+ for (; nCount && (_rPnt.Y() < 0); --nCount)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ const sal_Int32 nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ _rPnt.Y() += nHeight;
+ if ( (nCount -1) > 0 && (_rPnt.Y() < 0) )
+ --aIter;
+ }
+ if ( nCount == 0 )
+ pSection = &(*m_aSections.begin())->getReportSection().getSectionView();
+ else
+ pSection = &(*aIter)->getReportSection().getSectionView();
+ }
+ else
+ {
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ const long nHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ if ( (_rPnt.Y() - nHeight) < 0 )
+ break;
+ _rPnt.Y() -= nHeight;
+ }
+ if ( aIter != aEnd )
+ pSection = &(*aIter)->getReportSection().getSectionView();
+ else
+ pSection = &(*(aEnd-1))->getReportSection().getSectionView();
+ }
+
+ return pSection;
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::EndDragObj_removeInvisibleObjects()
+{
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ rReportSection.getPage()->resetSpecialMode();
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt)
+{
+ const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION)));
+ UndoManagerListAction aListAction(*getView()->getReportView()->getController().getUndoMgr(),sUndoAction);
+
+ Point aNewPos = _aPnt;
+ OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos);
+ if (!_bControlKeyPressed &&
+ (_pSection && ( _pSection->IsDragResize() == false ) ) && /* Not in resize mode */
+ _pSection != pInSection)
+ {
+ EndDragObj_removeInvisibleObjects();
+
+ // we need to manipulate the current clickpoint, we substract the old delta from BeginDrag
+ // OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aPnt);
+ // aNewPos.X() -= m_aDragDelta.X();
+ // aNewPos.Y() -= m_aDragDelta.Y();
+ aNewPos -= m_aDragDelta;
+
+ uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects;
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ const TSectionsMap::iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ if ( pInSection != &rReportSection.getSectionView() )
+ {
+ rReportSection.getSectionView().BrkAction();
+ rReportSection.Copy(aAllreadyCopiedObjects,true);
+ }
+ else
+ pInSection->EndDragObj(FALSE);
+ } // for (; aIter != aEnd; ++aIter)
+
+ if ( aAllreadyCopiedObjects.getLength() )
+ {
+ beans::NamedValue* pIter = aAllreadyCopiedObjects.getArray();
+ const beans::NamedValue* pEnd = pIter + aAllreadyCopiedObjects.getLength();
+ try
+ {
+ uno::Reference<report::XReportDefinition> xReportDefinition = getView()->getReportView()->getController().getReportDefinition();
+ const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+ const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+ const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
+
+ if ( aNewPos.X() < nLeftMargin )
+ aNewPos.X() = nLeftMargin;
+ if ( aNewPos.Y() < 0 )
+ aNewPos.Y() = 0;
+
+ Point aPrevious;
+ for (; pIter != pEnd; ++pIter)
+ {
+ uno::Sequence< uno::Reference<report::XReportComponent> > aClones;
+ pIter->Value >>= aClones;
+ uno::Reference<report::XReportComponent>* pColIter = aClones.getArray();
+ const uno::Reference<report::XReportComponent>* pColEnd = pColIter + aClones.getLength();
+
+ // move the cloned Components to new positions
+ for (; pColIter != pColEnd; ++pColIter)
+ {
+ uno::Reference< report::XReportComponent> xRC(*pColIter);
+ aPrevious = VCLPoint(xRC->getPosition());
+ awt::Size aSize = xRC->getSize();
+
+ if ( aNewPos.X() < nLeftMargin )
+ {
+ aNewPos.X() = nLeftMargin;
+ }
+ else if ( (aNewPos.X() + aSize.Width) > (nPaperWidth - nRightMargin) )
+ {
+ aNewPos.X() = nPaperWidth - nRightMargin - aSize.Width;
+ }
+ if ( aNewPos.Y() < 0 )
+ {
+ aNewPos.Y() = 0;
+ }
+ if ( aNewPos.X() < 0 )
+ {
+ aSize.Width += aNewPos.X();
+ aNewPos.X()= 0;
+ xRC->setSize(aSize);
+ }
+ xRC->setPosition(AWTPoint(aNewPos));
+ if ( (pColIter+1) != pColEnd )
+ {
+ // bring aNewPos to the position of the next object
+ uno::Reference< report::XReportComponent> xRCNext(*(pColIter + 1),uno::UNO_QUERY);
+ Point aNextPosition = VCLPoint(xRCNext->getPosition());
+ aNewPos += (aNextPosition - aPrevious);
+ }
+ }
+ }
+ }
+ catch(uno::Exception&)
+ {
+ }
+ pInSection->getReportSection()->Paste(aAllreadyCopiedObjects,true);
+ }
+ }
+ else
+ {
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( FALSE ) );
+ EndDragObj_removeInvisibleObjects();
+ }
+ m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32);
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::EndAction()
+{
+ ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction() );
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bool _bMove, bool _bControlKeySet)
+{
+ (void)_bMove;
+
+ Point aRealMousePos = _aPnt;
+ Point aCurrentSectionPos;
+ OSL_TRACE("MovAction X:%d Y:%d\n", aRealMousePos.X(), aRealMousePos.Y() );
+
+ Point aHdlPos;
+ SdrHdl* pHdl = _pSection->GetDragHdl();
+ if ( pHdl )
+ {
+ aHdlPos = pHdl->GetPos();
+ }
+
+ TSectionsMap::iterator aIter/* = m_aSections.begin() */;
+ TSectionsMap::iterator aEnd = m_aSections.end();
+
+ //if ( _bMove )
+ //{
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ if ( &rReportSection.getSectionView() == _pSection )
+ break;
+ const long nSectionHeight = (*aIter)->PixelToLogic(rReportSection.GetOutputSizePixel()).Height();
+ aCurrentSectionPos.Y() += nSectionHeight;
+ } // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ //}
+ aRealMousePos += aCurrentSectionPos;
+
+ // If control key is pressed the work area is limited to the section with the current selection.
+ Point aPosForWorkArea(0,0);
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ OSectionView& rView = rReportSection.getSectionView();
+ const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height();
+
+ if (_bControlKeySet)
+ {
+ Rectangle aClipRect = rView.GetWorkArea();
+ aClipRect.Top() = aCurrentSectionPos.Y() - aPosForWorkArea.Y();
+ // if (aClipRect.Top() < 0) aClipRect.Top() = 0;
+ aClipRect.Bottom() = aClipRect.Top() + nSectionHeight;
+ rView.SetWorkArea( aClipRect );
+ }
+ else
+ {
+ Rectangle aClipRect = rView.GetWorkArea();
+ aClipRect.Top() = -aPosForWorkArea.Y();
+ rView.SetWorkArea( aClipRect );
+ }
+ aPosForWorkArea.Y() += nSectionHeight;
+ // aNewPos.Y() += PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+ }
+
+
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ SdrHdl* pCurrentHdl = rReportSection.getSectionView().GetDragHdl();
+ if ( pCurrentHdl )
+ {
+ if ( aRealMousePos.Y() > 0 )
+ aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
+ }
+ rReportSection.getSectionView().MovAction ( aRealMousePos );
+ const long nSectionHeight = (*aIter)->PixelToLogic((*aIter)->GetOutputSizePixel()).Height();
+ aRealMousePos.Y() -= nSectionHeight;
+ }
+#if 0
+#if OSL_DEBUG_LEVEL > 0
+ // TEST TEST TEST TEST
+ // Ich versuche gerade rauszubekommen, ob ich ein Object bewege oder nur resize.
+ // TEST TEST TEST TEST
+
+ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ OSectionView& rView = rReportSection.getSectionView();
+ if ( rView.AreObjectsMarked() )
+ {
+ rView.SortMarkedObjects();
+ const sal_uInt32 nCount = rView.GetMarkedObjectCount();
+ for (sal_uInt32 i=0; i < nCount; ++i)
+ {
+ const SdrMark* pM = rView.GetSdrMarkByIndex(i);
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ (void)pObj;
+
+ int dummy = 0;
+ (void)dummy;
+ }
+ }
+
+ /*
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ OSectionView& rView = rReportSection.getSectionView();
+ const SdrHdlList& rHdlList = rView.GetHdlList();
+ SdrHdl* pHdl2 = rHdlList.GetFocusHdl();
+
+ if ( pHdl2 != 0 )
+ {
+ SdrHdlKind eKind = pHdl->GetKind();
+ int dummy = 0;
+ switch(eKind)
+ {
+ case HDL_UPLFT: // Oben links
+ case HDL_UPPER: // Oben
+ case HDL_UPRGT: // Oben rechts
+ case HDL_LEFT: // Links
+ case HDL_RIGHT: // Rechts
+ case HDL_LWLFT: // Unten links
+ case HDL_LOWER: // Unten
+ case HDL_LWRGT: // Unten rechts
+ dummy = 1;
+ break;
+ default:
+ dummy = 0;
+ }
+ }
+ */
+ }
+ // TEST TEST TEST TEST
+#endif
+#endif
+}
+// -----------------------------------------------------------------------------
+BOOL OViewsWindow::IsAction() const
+{
+ BOOL bAction = FALSE;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (; !bAction && aIter != aEnd; ++aIter)
+ bAction = (*aIter)->getReportSection().getSectionView().IsAction();
+ return bAction;
+}
+// -----------------------------------------------------------------------------
+BOOL OViewsWindow::IsDragObj() const
+{
+ BOOL bAction = FALSE;
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (; !bAction && aIter != aEnd; ++aIter)
+ bAction = (*aIter)->getReportSection().getSectionView().IsAction();
+ return bAction;
+}
+// -----------------------------------------------------------------------------
+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)->getReportSection().getSectionView().GetMarkedObjectCount();
+ return nCount;
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::handleKey(const KeyCode& _rCode)
+{
+ const USHORT nCode = _rCode.GetCode();
+ if ( _rCode.IsMod1() )
+ {
+ // scroll page
+ OScrollWindowHelper* pScrollWindow = getView()->getScrollWindow();
+ ScrollBar* pScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll();
+ if ( pScrollBar && pScrollBar->IsVisible() )
+ pScrollBar->DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN );
+ return;
+ }
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (; aIter != aEnd; ++aIter)
+ {
+ OReportSection& rReportSection = (*aIter)->getReportSection();
+ 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 ( rReportSection.getSectionView().AreObjectsMarked() )
+ {
+ if ( _rCode.IsMod2() )
+ {
+ // move in 1 pixel distance
+ const Size aPixelSize = rReportSection.PixelToLogic( Size( 1, 1 ) );
+ nX *= aPixelSize.Width();
+ nY *= aPixelSize.Height();
+ }
+ else
+ {
+ // move in 1 mm distance
+ nX *= DEFAUL_MOVE_SIZE;
+ nY *= DEFAUL_MOVE_SIZE;
+ }
+
+ OSectionView& rView = rReportSection.getSectionView();
+ const SdrHdlList& rHdlList = rView.GetHdlList();
+ SdrHdl* pHdl = rHdlList.GetFocusHdl();
+
+ if ( pHdl == 0 )
+ {
+ // no handle selected
+ if ( rView.IsMoveAllowed() )
+ {
+ // restrict movement to work area
+ Rectangle rWorkArea = rView.GetWorkArea();
+
+ if ( !rWorkArea.IsEmpty() )
+ {
+ if ( rWorkArea.Top() < 0 )
+ rWorkArea.Top() = 0;
+ Rectangle aMarkRect( rView.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 = rView.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,*rReportSection.getPage(),rView) )
+ break;
+ }
+
+ if ( nX != 0 || nY != 0 )
+ {
+ rView.MoveAllMarked( Size( nX, nY ) );
+ rView.MakeVisible( rView.GetAllMarkedRect(), rReportSection);
+ }
+ }
+ }
+ else
+ {
+ // move the handle
+ if ( pHdl && ( nX || nY ) )
+ {
+ const Point aStartPoint( pHdl->GetPos() );
+ const Point aEndPoint( pHdl->GetPos() + Point( nX, nY ) );
+ const SdrDragStat& rDragStat = rView.GetDragStat();
+
+ // start dragging
+ rView.BegDragObj( aStartPoint, 0, pHdl, 0 );
+
+ if ( rView.IsDragObj() )
+ {
+ const FASTBOOL bWasNoSnap = rDragStat.IsNoSnap();
+ const BOOL bWasSnapEnabled = rView.IsSnapEnabled();
+
+ // switch snapping off
+ if ( !bWasNoSnap )
+ ((SdrDragStat&)rDragStat).SetNoSnap( TRUE );
+ if ( bWasSnapEnabled )
+ rView.SetSnapEnabled( FALSE );
+
+ Rectangle aNewRect;
+ bool bCheck = false;
+ const SdrMarkList& rMarkList = rView.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,*rReportSection.getPage(),rView)) )
+ rView.MovAction(aEndPoint);
+ rView.EndDragObj();
+
+ // restore snap
+ if ( !bWasNoSnap )
+ ((SdrDragStat&)rDragStat).SetNoSnap( bWasNoSnap );
+ if ( bWasSnapEnabled )
+ rView.SetSnapEnabled( bWasSnapEnabled );
+ }
+
+ // make moved handle visible
+ const Rectangle aVisRect( aEndPoint - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) );
+ rView.MakeVisible( aVisRect, rReportSection);
+ }
+ }
+ rView.AdjustMarkHdl();
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::stopScrollTimer()
+{
+ ::std::for_each(m_aSections.begin(),m_aSections.end(),
+ ::std::compose1(::boost::mem_fn(&OReportSection::stopScrollTimer),TReportPairHelper()));
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
+{
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for (sal_uInt16 i = 0;aIter != aEnd ; ++aIter,++i)
+ {
+ if ( (*aIter)->getStartMarker().isCollapsed() )
+ _rCollapsedPositions.push_back(i);
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections)
+{
+ const beans::PropertyValue* pIter = _aCollpasedSections.getConstArray();
+ const beans::PropertyValue* pEnd = pIter + _aCollpasedSections.getLength();
+ for (; pIter != pEnd; ++pIter)
+ {
+ sal_uInt16 nPos = sal_uInt16(-1);
+ if ( (pIter->Value >>= nPos) && nPos < m_aSections.size() )
+ {
+ m_aSections[nPos]->setCollapsed(sal_True);
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::zoom(const Fraction& _aZoom)
+{
+ const MapMode& aMapMode = GetMapMode();
+
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ if ( _aZoom < aMapMode.GetScaleX() )
+ aStartWidth *= aMapMode.GetScaleX();
+ else
+ aStartWidth *= _aZoom;
+
+ setZoomFactor(_aZoom,*this);
+
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ (*aIter)->zoom(_aZoom);
+ } // for (;aIter != aEnd ; ++aIter)
+
+ Resize();
+
+ Size aOut = GetOutputSizePixel();
+ aOut.Width() = aStartWidth;
+ aOut = PixelToLogic(aOut);
+
+ Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
+ Invalidate(aRect,/*INVALIDATE_NOERASE | */INVALIDATE_NOCHILDREN /*| INVALIDATE_TRANSPARENT*/);
+}
+//----------------------------------------------------------------------------
+void OViewsWindow::scrollChildren(const Point& _aThumbPos)
+{
+ const Point aPos(PixelToLogic(_aThumbPos));
+ {
+ MapMode aMapMode = GetMapMode();
+ const Point aOld = aMapMode.GetOrigin();
+ aMapMode.SetOrigin(m_pParent->GetMapMode().GetOrigin());
+
+ const Point aPosY(m_pParent->PixelToLogic(_aThumbPos,aMapMode));
+
+ aMapMode.SetOrigin( Point(aOld.X() , - aPosY.Y()));
+ SetMapMode( aMapMode );
+ //OWindowPositionCorrector aCorrector(this,0,-( aOld.Y() + aPosY.Y()));
+ Scroll(0, -( aOld.Y() + aPosY.Y()),SCROLL_CHILDREN);
+ Resize();
+ Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
+ }
+
+ TSectionsMap::iterator aIter = m_aSections.begin();
+ TSectionsMap::iterator aEnd = m_aSections.end();
+ for (;aIter != aEnd ; ++aIter)
+ {
+ (*aIter)->scrollChildren(aPos.X());
+ } // for (;aIter != aEnd ; ++aIter)
+}
+// -----------------------------------------------------------------------------
+void OViewsWindow::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
+{
+ TSectionsMap::const_iterator aIter = m_aSections.begin();
+ TSectionsMap::const_iterator aEnd = m_aSections.end();
+ for(;aIter != aEnd; ++aIter)
+ {
+ (*aIter)->getReportSection().fillControlModelSelection(_rSelection);
+ }
+}
+//==============================================================================
+} // rptui
+//==============================================================================
diff --git a/reportdesign/source/ui/report/dlgedclip.cxx b/reportdesign/source/ui/report/dlgedclip.cxx
new file mode 100644
index 000000000000..d0c1b03bda11
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedclip.cxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "dlgedclip.hxx"
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/datatransfer/XMimeContentType.hpp>
+#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp>
+
+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..7e6bd00d0091
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "dlgedfac.hxx"
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#include "RptObject.hxx"
+#include <RptDef.hxx>
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/awt/ScrollBarOrientation.hpp>
+#include <svx/svdoole2.hxx>
+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(SERVICE_SHAPE);
+ break;
+ case OBJ_DLG_SUBREPORT:
+ pObjFactory->pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
+ break;
+ case OBJ_OLE2:
+ pObjFactory->pNewObj = new OOle2Obj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.ChartDocument")),OBJ_OLE2);
+ 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..1535ce7d6ee1
--- /dev/null
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -0,0 +1,1119 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include <vcl/scrbar.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/seleng.hxx>
+#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include <svx/svdview.hxx>
+#include <svx/svdpagv.hxx>
+#include <editeng/outlobj.hxx>
+#include <editeng/unolingu.hxx>
+#include <svx/svdetc.hxx>
+#include <editeng/editstat.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svddrgmt.hxx>
+#include <svx/svdoashp.hxx>
+#include <svx/svxids.hrc>
+#include <svx/svditer.hxx>
+
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include "dlgedfunc.hxx"
+#include "ReportSection.hxx"
+#include "DesignView.hxx"
+#include "ReportController.hxx"
+#include "SectionView.hxx"
+#include "ViewsWindow.hxx"
+#include "ReportWindow.hxx"
+#include "RptObject.hxx"
+#include "ScrollHelper.hxx"
+
+#include "ReportRuler.hxx"
+#include "UITools.hxx"
+
+#include <uistrings.hrc>
+#include "UndoEnv.hxx"
+#include <RptModel.hxx>
+#include <tools/diagnose_ex.h>
+
+#define DEFAUL_MOVE_SIZE 100
+namespace rptui
+{
+using namespace ::com::sun::star;
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+
+IMPL_LINK( DlgEdFunc, ScrollTimeout, Timer *, )
+{
+ ForceScroll( m_pParent->PixelToLogic( m_pParent->GetPointerPosPixel() ) );
+ return 0;
+}
+
+//----------------------------------------------------------------------------
+
+void DlgEdFunc::ForceScroll( const Point& rPos )
+{
+ aScrollTimer.Stop();
+
+ OReportWindow* pReportWindow = m_pParent->getSectionWindow()->getViewsWindow()->getView();
+ OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
+
+ Size aOut = pReportWindow->GetOutputSizePixel();
+ Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+ aStartWidth *= m_pParent->GetMapMode().GetScaleX();
+
+ aOut.Width() -= (long)aStartWidth;
+
+ Rectangle aOutRect( pScrollWindow->getThumbPos(), aOut );
+ aOutRect = m_pParent->PixelToLogic( aOutRect );
+ //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea();
+ Point aGcc3WorkaroundTemporary;
+ Rectangle aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize());
+ aWorkArea.Right() -= (long)aStartWidth;
+ aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
+ if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
+ {
+ ScrollBar* pHScroll = pScrollWindow->GetHScroll();
+ ScrollBar* pVScroll = pScrollWindow->GetVScroll();
+ ScrollType eH = SCROLL_LINEDOWN,eV = SCROLL_LINEDOWN;
+ if( rPos.X() < aOutRect.Left() )
+ eH = SCROLL_LINEUP;
+ else if( rPos.X() <= aOutRect.Right() )
+ eH = SCROLL_DONTKNOW;
+
+ if( rPos.Y() < aOutRect.Top() )
+ eV = SCROLL_LINEUP;
+ else if( rPos.Y() <= aOutRect.Bottom() )
+ eV = SCROLL_DONTKNOW;
+
+ pHScroll->DoScrollAction(eH);
+ pVScroll->DoScrollAction(eV);
+ }
+
+ aScrollTimer.Start();
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFunc::DlgEdFunc( OReportSection* _pParent )
+:m_pParent(_pParent),
+ m_rView(_pParent->getSectionView()),
+ m_xOverlappingObj(NULL),
+ m_pOverlappingObj(NULL),
+ m_bSelectionMode(false),
+ m_bUiActive(false),
+ m_bShowPropertyBrowser(false)
+{
+ // m_pParent = _pParent;
+ aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) );
+ m_rView.SetActualWin( m_pParent);
+ aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
+}
+
+//----------------------------------------------------------------------------
+void DlgEdFunc::setOverlappedControlColor(sal_Int32 _nColor)
+{
+ m_nOverlappedControlColor = _nColor;
+}
+// -----------------------------------------------------------------------------
+sal_Int32 lcl_setColorOfObject(uno::Reference< uno::XInterface > _xObj, long _nColorTRGB)
+{
+ sal_Int32 nBackColor = 0;
+ try
+ {
+ uno::Reference<report::XReportComponent> xComponent(_xObj, uno::UNO_QUERY_THROW);
+ // NOT NEED if UNO_QUERY_THROW:
+ // if (xComponent.is())
+ // {
+ uno::Reference< beans::XPropertySet > xProp(xComponent, uno::UNO_QUERY_THROW);
+ // if (xProp.is())
+ // {
+ // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlBackground"))
+ // is PROPERTY_CONTROLBACKGROUND
+ uno::Any aAny = xProp->getPropertyValue(PROPERTY_CONTROLBACKGROUND);
+ if (aAny.hasValue())
+ {
+ aAny >>= nBackColor;
+ // try to set background color at the ReportComponent
+ uno::Any aBlackColorAny = uno::makeAny(_nColorTRGB);
+ xProp->setPropertyValue(PROPERTY_CONTROLBACKGROUND, aBlackColorAny);
+ }
+ // aCopies.push_back(xComponent->createClone());
+ }
+ catch(uno::Exception&)
+ {
+ // bit my shiny metal as!
+ // OSL_ENSURE(0,"Can't copy report elements!");
+ }
+ return nBackColor;
+}
+// -----------------------------------------------------------------------------
+DlgEdFunc::~DlgEdFunc()
+{
+ unColorizeOverlappedObj();
+ aScrollTimer.Stop();
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ m_aMDPos = m_pParent->PixelToLogic( rMEvt.GetPosPixel() );
+ m_pParent->GrabFocus();
+ BOOL bHandled = FALSE;
+ if ( rMEvt.IsLeft() )
+ {
+ if ( rMEvt.GetClicks() > 1 )
+ {
+ // show property browser
+ if ( m_pParent->GetMode() != RPTUI_READONLY )
+ {
+ uno::Sequence<beans::PropertyValue> aArgs(1);
+ aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowProperties"));
+ aArgs[0].Value <<= sal_True;
+ m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs);
+ m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
+ // TODO character in shapes
+ // SdrViewEvent aVEvt;
+ // m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) )
+ // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, FALSE);
+ bHandled = TRUE;
+ }
+ }
+ else
+ {
+ SdrHdl* pHdl = m_rView.PickHandle(m_aMDPos);
+ //m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(m_pView);
+
+ // if selected object was hit, drag object
+ if ( pHdl!=NULL || m_rView.IsMarkedHit(m_aMDPos) )
+ {
+ bHandled = TRUE;
+ m_pParent->CaptureMouse();
+ m_pParent->getSectionWindow()->getViewsWindow()->BegDragObj(m_aMDPos, pHdl,&m_rView);
+ }
+ }
+ }
+ else if ( rMEvt.IsRight() && !rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) // mark object when context menu was selected
+ {
+ SdrPageView* pPV = m_rView.GetSdrPageView();
+ SdrViewEvent aVEvt;
+ if ( m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() )
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+ if ( aVEvt.pRootObj )
+ m_rView.MarkObj(aVEvt.pRootObj, pPV);
+ else
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+
+ bHandled = TRUE;
+ }
+ else if( !rMEvt.IsLeft() )
+ bHandled = TRUE;
+ if ( !bHandled )
+ m_pParent->CaptureMouse();
+ return bHandled;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ )
+{
+ BOOL bHandled = FALSE;
+ m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer();
+ return bHandled;
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt)
+{
+ deactivateOle();
+
+ const USHORT nClicks = rMEvt.GetClicks();
+ if ( nClicks == 2 && rMEvt.IsLeft() )
+ {
+ if ( m_rView.AreObjectsMarked() )
+ {
+ const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
+ if (rMarkList.GetMarkCount() == 1)
+ {
+ const SdrMark* pMark = rMarkList.GetMark(0);
+ SdrObject* pObj = pMark->GetMarkedSdrObj();
+ activateOle(pObj);
+ } // if (rMarkList.GetMarkCount() == 1)
+ } // if ( pView->AreObjectsMarked() )
+ }
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::stopScrollTimer()
+{
+ unColorizeOverlappedObj();
+ aScrollTimer.Stop();
+ if ( m_pParent->IsMouseCaptured() )
+ m_pParent->ReleaseMouse();
+}
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ )
+{
+ return FALSE;
+}
+//------------------------------------------------------------------------------
+sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent)
+{
+ BOOL bReturn = FALSE;
+
+ if ( !m_bUiActive )
+ {
+ const KeyCode& rCode = _rEvent.GetKeyCode();
+ USHORT nCode = rCode.GetCode();
+
+ switch ( nCode )
+ {
+ case KEY_ESCAPE:
+ {
+ if ( m_pParent->getSectionWindow()->getViewsWindow()->IsAction() )
+ {
+ m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
+ bReturn = TRUE;
+ }
+ else if ( m_rView.IsTextEdit() )
+ {
+ m_rView.SdrEndTextEdit();
+ bReturn = TRUE;
+ }
+ else if ( m_rView.AreObjectsMarked() )
+ {
+ const SdrHdlList& rHdlList = m_rView.GetHdlList();
+ SdrHdl* pHdl = rHdlList.GetFocusHdl();
+ if ( pHdl )
+ ((SdrHdlList&)rHdlList).ResetFocusHdl();
+ else
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+ //m_rView.UnmarkAll();
+
+ deactivateOle(true);
+ bReturn = FALSE;
+ }
+ else
+ {
+ deactivateOle(true);
+ }
+ }
+ break;
+ case KEY_TAB:
+ {
+ if ( !rCode.IsMod1() && !rCode.IsMod2() )
+ {
+ // mark next object
+ if ( !m_rView.MarkNextObj( !rCode.IsShift() ) )
+ {
+ // if no next object, mark first/last
+ m_rView.UnmarkAllObj();
+ m_rView.MarkNextObj( !rCode.IsShift() );
+ }
+
+ if ( m_rView.AreObjectsMarked() )
+ m_rView.MakeVisible( m_rView.GetAllMarkedRect(), *m_pParent);
+
+ bReturn = TRUE;
+ }
+ else if ( rCode.IsMod1() && rCode.IsMod2())
+ {
+ // selected handle
+ const SdrHdlList& rHdlList = m_rView.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 ) );
+ m_rView.MakeVisible( aVisRect, *m_pParent);
+ }
+
+ bReturn = TRUE;
+ }
+ }
+ break;
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ {
+ m_pParent->getSectionWindow()->getViewsWindow()->handleKey(rCode);
+ bReturn = TRUE;
+ }
+ break;
+ case KEY_RETURN:
+ if ( !rCode.IsMod1() )
+ {
+ const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
+ if ( rMarkList.GetMarkCount() == 1 )
+ {
+ SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+ activateOle(pObj);
+ }
+ }
+ break;
+ case KEY_DELETE:
+ if ( !rCode.IsMod1() && !rCode.IsMod2() )
+ {
+ bReturn = TRUE;
+ break;
+ } // if ( !rCode.IsMod1() && !rCode.IsMod2() )
+ // run through
+ default:
+ {
+ bReturn = m_rView.KeyInput(_rEvent, m_pParent);
+ }
+ break;
+ }
+ }
+
+ if ( bReturn && m_pParent->IsMouseCaptured() )
+ m_pParent->ReleaseMouse();
+
+ return bReturn;
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::activateOle(SdrObject* _pObj)
+{
+ if ( _pObj )
+ {
+ const UINT16 nSdrObjKind = _pObj->GetObjIdentifier();
+ //
+ // OLE: activate
+ //
+ if (nSdrObjKind == OBJ_OLE2)
+ {
+ bool bIsInplaceOle = false;
+ if (!bIsInplaceOle)
+ {
+ SdrOle2Obj* pOleObj = dynamic_cast<SdrOle2Obj*>(_pObj);
+ if ( pOleObj->GetObjRef().is() )
+ {
+ if (m_rView.IsTextEdit())
+ {
+ m_rView.SdrEndTextEdit();
+ }
+
+ pOleObj->AddOwnLightClient();
+ pOleObj->SetWindow(VCLUnoHelper::GetInterface(m_pParent));
+ try
+ {
+ pOleObj->GetObjRef()->changeState( embed::EmbedStates::UI_ACTIVE );
+ m_bUiActive = true;
+ OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
+ m_bShowPropertyBrowser = rController.isCommandChecked(SID_SHOW_PROPERTYBROWSER);
+ if ( m_bShowPropertyBrowser )
+ rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
+ }
+ catch( uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+ } // if (nSdrObjKind == OBJ_OLE2)
+ } // if ( _pObj )
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::deactivateOle(bool _bSelect)
+{
+ OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache();
+ const ULONG nCount = rObjCache.Count();
+ for(ULONG i = 0 ; i< nCount;++i)
+ {
+ SdrOle2Obj* pObj = reinterpret_cast<SdrOle2Obj*>(rObjCache.GetObject(i));
+ if ( m_pParent->getPage() == pObj->GetPage() )
+ {
+ uno::Reference< embed::XEmbeddedObject > xObj = pObj->GetObjRef();
+ if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
+ {
+ xObj->changeState( embed::EmbedStates::RUNNING );
+ m_bUiActive = false;
+ if ( m_bShowPropertyBrowser )
+ {
+ OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
+ rController.executeChecked(SID_SHOW_PROPERTYBROWSER,uno::Sequence< beans::PropertyValue >());
+ }
+
+ if ( _bSelect )
+ {
+ SdrPageView* pPV = m_rView.GetSdrPageView();
+ m_rView.MarkObj(pObj, pPV);
+ }
+ } // if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE )
+ }
+ } // for(ULONG i = 0 ; i< nCount;++i)
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj)
+{
+ OObjectBase* pObj = dynamic_cast<OObjectBase*>(_pOverlappedObj);
+ if ( pObj )
+ {
+ uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent();
+ if (xComponent.is() && xComponent != m_xOverlappingObj)
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(_pOverlappedObj->GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+
+ // uncolorize an old object, if there is one
+ unColorizeOverlappedObj();
+
+ m_nOldColor = lcl_setColorOfObject(xComponent, m_nOverlappedControlColor);
+ m_xOverlappingObj = xComponent;
+ m_pOverlappingObj = _pOverlappedObj;
+ }
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::unColorizeOverlappedObj()
+{
+ // uncolorize an old object, if there is one
+ if (m_xOverlappingObj.is())
+ {
+ OReportModel* pRptModel = static_cast<OReportModel*>(m_pOverlappingObj->GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
+
+ lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor);
+ m_xOverlappingObj = NULL;
+ m_pOverlappingObj = NULL;
+ }
+ }
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::isOverlapping(const MouseEvent& rMEvt)
+{
+ bool bOverlapping = false;
+ SdrViewEvent aVEvt;
+ bOverlapping = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE;
+ if (bOverlapping && aVEvt.pObj)
+ {
+ colorizeOverlappedObject(aVEvt.pObj);
+ }
+ else
+ {
+ unColorizeOverlappedObj();
+ }
+
+ return bOverlapping;
+}
+// -----------------------------------------------------------------------------
+void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt)
+{
+ if ( m_pParent->getSectionWindow()->getViewsWindow()->IsDragObj() )
+ {
+ if ( isRectangleHit(rMEvt) )
+ {
+ // there is an other component under use, break action
+ m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
+ }
+ // object was dragged
+ Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ if (m_bSelectionMode)
+ {
+ m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
+ }
+ else
+ {
+ bool bControlKeyPressed = rMEvt.IsMod1();
+ // Don't allow points smaller 0
+ if (bControlKeyPressed && (aPnt.Y() < 0))
+ {
+ aPnt.Y() = 0;
+ }
+ if (m_rView.IsDragResize())
+ {
+ // we resize the object don't resize to above sections
+ if ( aPnt.Y() < 0 )
+ {
+ aPnt.Y() = 0;
+ }
+ }
+ m_pParent->getSectionWindow()->getViewsWindow()->EndDragObj( bControlKeyPressed, &m_rView, aPnt );
+ }
+ m_pParent->getSectionWindow()->getViewsWindow()->ForceMarkedToAnotherPage();
+ m_pParent->Invalidate(INVALIDATE_CHILDREN);
+ }
+ else
+ m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::isOnlyCustomShapeMarked()
+{
+ bool bReturn = true;
+ const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
+ for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i )
+ {
+ SdrMark* pMark = rMarkList.GetMark(i);
+ // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ SdrObject* pObj = pMark->GetMarkedSdrObj();
+ if (pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE)
+ {
+ // we found an object in the marked objects, which is not a custom shape.
+ bReturn = false;
+ break;
+ }
+ }
+ return bReturn;
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
+{
+ if (isOnlyCustomShapeMarked())
+ {
+ return false;
+ }
+
+ SdrViewEvent aVEvt;
+ const SdrHitKind eHit = m_rView.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 = m_rView.GetDragStat().GetActionRect();
+ const SdrDragStat& rDragStat = m_rView.GetDragStat();
+ if (rDragStat.GetDragMethod() != NULL)
+ {
+ SdrObjListIter aIter(*m_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 ( m_rView.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();
+
+ if ( rDragStat.GetDragMethod()->getMoveOnly() )
+ aNewRect.Move(nDx,nDy);
+ else
+ ::ResizeRect(aNewRect,rDragStat.GetRef1(),rDragStat.GetXFact(),rDragStat.GetYFact());
+
+
+ SdrObject* pObjOverlapped = isOver(aNewRect,*m_pParent->getPage(),m_rView,false,pObjIter, ISOVER_IGNORE_CUSTOMSHAPES);
+ bIsSetPoint = pObjOverlapped ? true : false;
+ if (pObjOverlapped && !m_bSelectionMode)
+ {
+ colorizeOverlappedObject(pObjOverlapped);
+ }
+ }
+ }
+ }
+ }
+ else if ( aVEvt.pObj && !m_bSelectionMode)
+ {
+ colorizeOverlappedObject(aVEvt.pObj);
+ }
+ return bIsSetPoint;
+}
+// -----------------------------------------------------------------------------
+bool DlgEdFunc::setMovementPointer(const MouseEvent& rMEvt)
+{
+ bool bIsSetPoint = isRectangleHit(rMEvt);
+ if ( bIsSetPoint )
+ m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED));
+ else
+ {
+ bool bCtrlKey = rMEvt.IsMod1();
+ (void)bCtrlKey;
+ if (bCtrlKey)
+ {
+ m_pParent->SetPointer( Pointer(POINTER_MOVEDATALINK ));
+ bIsSetPoint = true;
+ }
+ }
+ return bIsSetPoint;
+}
+//----------------------------------------------------------------------------
+
+DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) :
+ DlgEdFunc( _pParent )
+{
+ m_rView.SetCreateMode( TRUE );
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncInsert::~DlgEdFuncInsert()
+{
+ m_rView.SetEditMode( TRUE );
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseButtonDown(rMEvt) )
+ return TRUE;
+
+ SdrViewEvent aVEvt;
+ sal_Int16 nId = m_rView.GetCurrentObjIdentifier();
+
+ const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+
+// eHit == SDRHIT_UNMARKEDOBJECT under the mouse cursor is a unmarked object
+
+ if (eHit == SDRHIT_UNMARKEDOBJECT &&
+ nId != OBJ_CUSTOMSHAPE)
+ {
+ // there is an object under the mouse cursor, but not a customshape
+ // rtl::OUString suWasN = m_rView.getInsertObjString();
+ // rtl::OUString suWasN2 = m_pParent->getSectionWindow()->getViewsWindow()->GetInsertObjString();
+
+ m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
+ return FALSE;
+ }
+
+ if( eHit != SDRHIT_UNMARKEDOBJECT || nId == OBJ_CUSTOMSHAPE)
+ {
+ // if no action, create object
+ if ( !m_pParent->getSectionWindow()->getViewsWindow()->IsAction() )
+ {
+ deactivateOle(true);
+ if ( m_pParent->getSectionWindow()->getViewsWindow()->HasSelection() )
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(&m_rView);
+ m_rView.BegCreateObj(m_aMDPos);
+ m_pParent->getSectionWindow()->getViewsWindow()->createDefault();
+ }
+ }
+ else
+ {
+ if( !rMEvt.IsShift() )
+ {
+ // shift key pressed?
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+ }
+ m_pParent->getSectionWindow()->getViewsWindow()->BegMarkObj( m_aMDPos,&m_rView );
+ }
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseButtonUp( rMEvt ) )
+ return TRUE;
+
+ const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ const USHORT nHitLog = USHORT ( m_pParent->PixelToLogic(Size(3,0)).Width() );
+
+ BOOL bReturn = TRUE;
+ // object creation active?
+ if ( m_rView.IsCreateObj() )
+ {
+ if ( isOver(m_rView.GetCreateObj(),*m_pParent->getPage(),m_rView) )
+ {
+ m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();
+ // BrkAction disables the create mode
+ m_rView.SetCreateMode( TRUE );
+ return TRUE;
+ }
+
+ m_rView.EndCreateObj(SDRCREATE_FORCEEND);
+
+ if ( !m_rView.AreObjectsMarked() )
+ {
+ m_rView.MarkObj(aPos, nHitLog);
+ }
+
+ bReturn = m_rView.AreObjectsMarked();
+ if ( bReturn )
+ {
+ OReportController& rController = m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController();
+ const SdrMarkList& rMarkList = m_rView.GetMarkedObjectList();
+ for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i )
+ {
+ SdrMark* pMark = rMarkList.GetMark(i);
+ // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL;
+ OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj());
+ if ( pObj && !pObj->IsEmpty() )
+ {
+ pObj->initializeChart(rController.getModel());
+ }
+ }
+ }
+ }
+ else
+ checkMovementAllowed(rMEvt);
+
+ if ( !m_rView.AreObjectsMarked() &&
+ Abs(m_aMDPos.X() - aPos.X()) < nHitLog &&
+ Abs(m_aMDPos.Y() - aPos.Y()) < nHitLog &&
+ !rMEvt.IsShift() && !rMEvt.IsMod2() )
+ {
+ SdrPageView* pPV = m_rView.GetSdrPageView();
+ SdrViewEvent aVEvt;
+ m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ m_rView.MarkObj(aVEvt.pRootObj, pPV);
+ } // ift() && !rMEvt.IsMod2() )
+ checkTwoCklicks(rMEvt);
+ m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
+ return bReturn;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseMove(rMEvt ) )
+ return TRUE;
+ Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+
+ if ( m_rView.IsCreateObj() )
+ {
+ m_rView.SetOrtho(SdrObjCustomShape::doConstructOrthogonal(m_rView.getReportSection()->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift());
+ m_rView.SetAngleSnapEnabled(rMEvt.IsShift());
+ }
+
+ bool bIsSetPoint = false;
+ if ( m_rView.IsAction() )
+ {
+ if ( m_rView.IsDragResize() )
+ {
+ // we resize the object don't resize to above sections
+ if ( aPos.Y() < 0 )
+ {
+ aPos.Y() = 0;
+ }
+ }
+ bIsSetPoint = setMovementPointer(rMEvt);
+ ForceScroll(aPos);
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPos,&m_rView, m_rView.GetDragMethod() == NULL, false);
+ }
+
+ //if ( isOver(m_rView.GetCreateObj(),*m_pParent->getPage(),*m_pView) )
+ // m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED));
+ //else
+ if ( !bIsSetPoint )
+ m_pParent->SetPointer( m_rView.GetPreferedPointer( aPos, m_pParent) );
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncSelect::DlgEdFuncSelect( OReportSection* _pParent ) :
+ DlgEdFunc( _pParent )
+{
+}
+
+//----------------------------------------------------------------------------
+
+DlgEdFuncSelect::~DlgEdFuncSelect()
+{
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ m_bSelectionMode = false;
+ if ( DlgEdFunc::MouseButtonDown(rMEvt) )
+ return TRUE;
+
+ SdrViewEvent aVEvt;
+ const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+ if( eHit == SDRHIT_UNMARKEDOBJECT )
+ {
+ // if not multi selection, unmark all
+ if ( !rMEvt.IsShift() )
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+
+ if ( m_rView.MarkObj(m_aMDPos) && rMEvt.IsLeft() )
+ {
+ // drag object
+ m_pParent->getSectionWindow()->getViewsWindow()->BegDragObj(m_aMDPos, m_rView.PickHandle(m_aMDPos), &m_rView);
+ }
+ else
+ {
+ // select object
+ m_pParent->getSectionWindow()->getViewsWindow()->BegMarkObj(m_aMDPos,&m_rView);
+ }
+ }
+ else
+ {
+ if( !rMEvt.IsShift() )
+ m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
+ //m_rView.UnmarkAll();
+
+ if ( rMEvt.GetClicks() == 1 )
+ {
+ m_bSelectionMode = true;
+ m_pParent->getSectionWindow()->getViewsWindow()->BegMarkObj( m_aMDPos ,&m_rView);
+ }
+ else
+ {
+ m_rView.SdrBeginTextEdit( aVEvt.pRootObj,m_rView.GetSdrPageView(),m_pParent,sal_False );
+ }
+ }
+
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseButtonUp( rMEvt ) )
+ return TRUE;
+
+ // get view from parent
+ const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+
+ if ( rMEvt.IsLeft() ) // left mousebutton pressed
+ checkMovementAllowed(rMEvt);
+
+ m_pParent->getSectionWindow()->getViewsWindow()->EndAction();
+ checkTwoCklicks(rMEvt);
+
+ m_pParent->SetPointer( m_rView.GetPreferedPointer( aPnt, m_pParent) );
+
+ if ( !m_bUiActive )
+ m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
+ m_bSelectionMode = false;
+ return TRUE;
+}
+
+//----------------------------------------------------------------------------
+
+BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( DlgEdFunc::MouseMove(rMEvt ) )
+ return TRUE;
+
+ Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) );
+ bool bIsSetPoint = false;
+
+ if ( m_rView.IsAction() ) // Drag Mode
+ {
+ bIsSetPoint = setMovementPointer(rMEvt);
+ ForceScroll(aPnt);
+ if (m_rView.GetDragMethod()==NULL)
+ {
+ // create a selection
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &m_rView, true, false);
+ }
+ else
+ {
+ if ( m_rView.IsDragResize() )
+ {
+ // we resize the object don't resize to above sections
+ if ( aPnt.Y() < 0 )
+ {
+ aPnt.Y() = 0;
+ }
+ // grow section if it is under the current section
+// else
+// {
+// const Size& aSectionSize = m_rView->GetSizePixel();
+// if ( aPnt.Y() > aSectionSize.Height() )
+// {
+// aPnt.Y() = aSectionSize.Height();
+// }
+// }
+ }
+ // drag or resize an object
+ bool bControlKey = rMEvt.IsMod1();
+ m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPnt, &m_rView, false, bControlKey);
+ }
+ }
+
+ if ( !bIsSetPoint )
+ {
+ m_pParent->SetPointer( m_rView.GetPreferedPointer( aPnt, m_pParent) );
+
+ // restore color
+ unColorizeOverlappedObj();
+ }
+
+ return TRUE;
+}
+// -----------------------------------------------------------------------------
+//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag)
+//{
+//
+// SdrPageView* pPV = m_rView.GetSdrPageView();
+// if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() )
+// {
+// m_rView.SetCurrentObj(OBJ_TEXT);
+// m_rView.SetEditMode(SDREDITMODE_EDIT);
+//
+// BOOL bEmptyOutliner = FALSE;
+//
+// if (!_pTextObj->GetOutlinerParaObject() && m_rView.GetTextEditOutliner())
+// {
+// ::SdrOutliner* pOutl = m_rView.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 != m_rView.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)
+// {
+// m_rView.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 (m_rView.SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor)
+// {
+// //bFirstObjCreated = TRUE;
+// //DeleteDefaultText();
+//
+// OutlinerView* pOLV = m_rView.GetTextEditOutlinerView();
+//
+// nSdrObjKind = _pTextObj->GetObjIdentifier();
+//
+// SdrViewEvent aVEvt;
+// SdrHitKind eHit = m_rView.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..3c19923f4c19
--- /dev/null
+++ b/reportdesign/source/ui/report/makefile.mk
@@ -0,0 +1,72 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+PRJINC=$(PRJ)$/source
+PRJNAME=reportdesign
+TARGET=report
+
+ENABLE_EXCEPTIONS=TRUE
+VISIBILITY_HIDDEN=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+# .INCLUDE : $(PRJ)$/util$/dll.pmk
+
+IMGLST_SRS=$(SRS)$/$(TARGET).srs
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/SectionWindow.obj \
+ $(SLO)$/ReportController.obj \
+ $(SLO)$/ReportControllerObserver.obj \
+ $(SLO)$/FormattedFieldBeautifier.obj \
+ $(SLO)$/FixedTextColor.obj \
+ $(SLO)$/ReportSection.obj \
+ $(SLO)$/SectionView.obj \
+ $(SLO)$/ViewsWindow.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..9e9ae8dffced
--- /dev/null
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -0,0 +1,619 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "precompiled_reportdesign.hxx"
+#include "propbrw.hxx"
+#include "RptObject.hxx"
+#include "ReportController.hxx"
+#include <cppuhelper/component_context.hxx>
+#ifndef _REPORT_DLGRESID_HRC
+#include <RptResId.hrc>
+#endif
+#ifndef _RPTUI_SLOTID_HRC_
+#include "rptui_slotid.hrc"
+#endif
+#include <tools/debug.hxx>
+#include <com/sun/star/awt/XLayoutConstrains.hpp>
+#include <com/sun/star/inspection/ObjectInspector.hpp>
+#include <com/sun/star/inspection/DefaultHelpProvider.hpp>
+#ifndef _SVX_SVXIDS_HRC
+#include <svx/svxids.hrc>
+#endif
+#include <vcl/stdtext.hxx>
+#include <svx/svdview.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/svditer.hxx>
+
+#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
+#include <toolkit/unohlp.hxx>
+#endif
+#include <comphelper/property.hxx>
+#include <comphelper/namecontainer.hxx>
+#include <comphelper/composedprops.hxx>
+#include <comphelper/stl_types.hxx>
+#include <comphelper/types.hxx>
+#include <comphelper/sequence.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/report/inspection/DefaultComponentInspectorModel.hpp>
+#include <comphelper/processfactory.hxx>
+#include "SectionView.hxx"
+#include "ReportSection.hxx"
+#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC
+#include "uistrings.hrc"
+#endif
+#include "DesignView.hxx"
+#include "ViewsWindow.hxx"
+#include "UITools.hxx"
+#include <unotools/confignode.hxx>
+
+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())
+ {
+ Reference< XComponentContext > xOwnContext;
+ try
+ {
+ // our own component context
+ Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW );
+ xOwnContext.set(
+ xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
+ UNO_QUERY_THROW );
+
+ /*uno::Reference< XComponent> xModel = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getModel(),uno::UNO_QUERY) );
+ uno::Reference< XComponent> xDialogParentWindow = new OContextHelper(m_xORB,uno::Reference< XComponent>(VCLUnoHelper::GetInterface ( this ),uno::UNO_QUERY) );
+ uno::Reference< XComponent> xConnection = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getConnection(),uno::UNO_QUERY) );*/
+ // 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() ) ),
+ };
+ m_xInspectorContext.set(
+ ::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( m_xInspectorContext, 3, 8 )
+ : report::inspection::DefaultComponentInspectorModel::createDefault( m_xInspectorContext ) );
+
+ m_xBrowserController = inspection::ObjectInspector::createWithModel(m_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( m_xInspectorContext, xInspectorUI ) );
+ }
+ }
+ xFactoryProperties->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext));
+ }
+ catch (Exception&)
+ {
+ DBG_ERROR("PropBrw::PropBrw: could not create/initialize the browser controller!");
+ try
+ {
+ ::comphelper::disposeComponent(m_xBrowserController);
+ ::comphelper::disposeComponent(m_xBrowserComponentWindow);
+ Reference< XPropertySet > xFactoryProperties( m_xORB, UNO_QUERY_THROW );
+ if ( xOwnContext.is() )
+ xFactoryProperties->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ,makeAny(xOwnContext));
+ }
+ 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();
+
+ try
+ {
+ uno::Reference<container::XNameContainer> xName(m_xInspectorContext,uno::UNO_QUERY);
+ if ( xName.is() )
+ {
+ const ::rtl::OUString pProps[] = { ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContextDocument" ) )
+ , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DialogParentWindow" ) )
+ , ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ActiveConnection" ) )};
+ for (size_t i = 0; i < sizeof(pProps)/sizeof(pProps[0]); ++i)
+ xName->removeByName(pProps[i]);
+ }
+ }
+ catch(Exception&)
+ {}
+
+ ::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+
+ DBG_DTOR( rpt_PropBrw,NULL);
+}
+// -----------------------------------------------------------------------------
+void PropBrw::setCurrentPage(const ::rtl::OUString& _sLastActivePage)
+{
+ m_sLastActivePage = _sLastActivePage;
+}
+//----------------------------------------------------------------------------
+
+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_xMeAsFrame.clear();
+ m_xBrowserController.clear();
+ m_xBrowserComponentWindow.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() )
+ {
+ try
+ {
+ m_xBrowserController->inspect(uno::Sequence< Reference<uno::XInterface> >());
+ m_xBrowserController->inspect(_aObjects);
+ }
+ catch( const Exception& )
+ {
+ OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" );
+ }
+
+ //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)
+{
+ _pObj->initializeOle();
+ 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();
+}
+// -----------------------------------------------------------------------------
+::Size PropBrw::getMinimumSize() const
+{
+ ::Size aSize;
+ Reference< awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY );
+ if( xLayoutConstrains.is() )
+ {
+ awt::Size aMinSize = xLayoutConstrains->getMinimumSize();
+ aMinSize.Height += 4;
+ aMinSize.Width += 4;
+ aSize.setHeight( aMinSize.Height );
+ aSize.setWidth( aMinSize.Width );
+ }
+ return aSize;
+}
+//----------------------------------------------------------------------------
+void PropBrw::Resize()
+{
+ Window::Resize();
+
+ Reference< awt::XLayoutConstrains > xLayoutConstrains( m_xBrowserController, UNO_QUERY );
+ if( xLayoutConstrains.is() )
+ {
+ ::Size aMinSize = getMinimumSize();
+ SetMinOutputSizePixel( aMinSize );
+ ::Size 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->getReportSection()->getSectionWindow()->getViewsWindow();
+ const USHORT nSectionCount = pViews->getSectionCount();
+ for (USHORT i = 0; i < nSectionCount; ++i)
+ {
+ ::boost::shared_ptr<OSectionWindow> pSectionWindow = pViews->getSectionWindow(i);
+ if ( pSectionWindow )
+ {
+ const SdrMarkList& rMarkList = pSectionWindow->getReportSection().getSectionView().GetMarkedObjectList();
+ aMarkedObjects = ::comphelper::concatSequences(aMarkedObjects,CreateCompPropSet( rMarkList ));
+ }
+ }
+
+ if ( aMarkedObjects.getLength() ) // multiple selection
+ {
+ m_xLastSection.clear();
+ implSetNewObject( aMarkedObjects );
+ }
+ else if ( m_xLastSection != m_pView->getReportSection()->getSection() )
+ {
+ uno::Reference< uno::XInterface> xTemp(m_pView->getReportSection()->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..95d1629d13ac
--- /dev/null
+++ b/reportdesign/source/ui/report/report.src
@@ -0,0 +1,682 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "RptResId.hrc"
+#include "rptui_slotid.hrc"
+#ifndef _GLOBLMN_HRC
+#include <svx/globlmn.hrc>
+#endif
+#ifndef _SBASLTID_HRC
+#include <svx/svxids.hrc>
+#endif
+#include "helpids.hrc"
+
+// 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 [ en-US ] = "Properties: ";
+};
+String RID_STR_BRWTITLE_NO_PROPERTIES
+{
+ Text [ en-US ] = "No Control marked";
+};
+String RID_STR_BRWTITLE_MULTISELECT
+{
+ Text [ en-US ] = "Multiselection";
+};
+
+String RID_STR_PROPTITLE_IMAGECONTROL
+{
+ Text [ en-US ] = "Image Control" ;
+};
+String RID_STR_PROPTITLE_FIXEDTEXT
+{
+ Text [ en-US ] = "Label field" ;
+};
+String RID_STR_PROPTITLE_FIXEDLINE
+{
+ Text [ en-US ] = "Line" ;
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_FORMATTED
+{
+ Text [ en-US ] = "Formatted Field";
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_SHAPE
+{
+ Text [ en-US ] = "Shape";
+ Text [ x-comment ] = " ";
+};
+String RID_STR_PROPTITLE_REPORT
+{
+ Text [ en-US ] = "Report";
+};
+String RID_STR_PROPTITLE_SECTION
+{
+ Text [ en-US ] = "Section";
+};
+String RID_STR_PROPTITLE_FUNCTION
+{
+ Text [ en-US ] = "Function";
+};
+String RID_STR_PROPTITLE_GROUP
+{
+ 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 [ en-US ] = "Show ruler";
+};
+
+String STR_SHOW_GRID
+{
+ Text [ en-US ] = "Show grid";
+};
+
+String RID_STR_UNDO_CHANGEPOSITION
+{
+ Text [ en-US ] = "Change Object";
+};
+String RID_STR_UNDO_MOVE_GROUP
+{
+ Text [ en-US ] = "Move Group(s)";
+};
+String RID_STR_UNDO_CONDITIONAL_FORMATTING
+{
+ Text [ en-US ] = "Conditional Formatting";
+};
+String RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER
+{
+ Text [ en-US ] = "Remove report header / report footer";
+};
+
+String RID_STR_UNDO_ADD_REPORTHEADERFOOTER
+{
+ Text [ en-US ] = "Add report header / report footer";
+};
+
+String RID_STR_UNDO_REMOVE_PAGEHEADERFOOTER
+{
+ Text [ en-US ] = "Remove page header / page footer";
+};
+
+String RID_STR_UNDO_ADD_PAGEHEADERFOOTER
+{
+ Text [ en-US ] = "Add page header / page footer";
+};
+
+String RID_STR_UNDO_PROPERTY
+{
+ Text [ en-US ] = "Change property '#'";
+ Text = "The # character is used for replacing";
+};
+
+String RID_STR_UNDO_ADD_GROUP_HEADER
+{
+ Text [ en-US ] = "Add group header ";
+};
+
+String RID_STR_UNDO_REMOVE_GROUP_HEADER
+{
+ Text [ en-US ] = "Remove group header ";
+};
+
+String RID_STR_UNDO_ADD_GROUP_FOOTER
+{
+ Text [ en-US ] = "Add group footer ";
+};
+
+String RID_STR_UNDO_REMOVE_GROUP_FOOTER
+{
+ Text [ en-US ] = "Remove group footer ";
+};
+String RID_STR_UNDO_ADDFUNCTION
+{
+ Text [ en-US ] = "Add function";
+};
+
+String RID_STR_UNDO_DELETEFUNCTION
+{
+ Text [ en-US ] = "Delete function";
+};
+
+String RID_STR_DESIGN_VIEW
+{
+ Text [ en-US ] = "Design";
+};
+
+String RID_STR_PREVIEW_VIEW
+{
+ Text [ en-US ] = "Preview";
+};
+
+String STR_RPT_TITLE
+{
+ Text [ en-US ] = "Report #" ;
+ Text [ x-comment ] = " ";
+};
+
+String STR_RPT_LABEL
+{
+ Text [ en-US ] = "~Report name" ;
+};
+
+String RID_STR_UNDO_REMOVE_GROUP
+{
+ Text [ en-US ] = "Delete Group" ;
+};
+
+String RID_STR_UNDO_APPEND_GROUP
+{
+ Text [ en-US ] = "Add Group" ;
+};
+
+String RID_STR_UNDO_REMOVE_SELECTION
+{
+ Text [ en-US ] = "Delete Selection" ;
+};
+String RID_STR_UNDO_REMOVE_FUNCTION
+{
+ Text [ en-US ] = "Delete Function" ;
+};
+
+String RID_STR_UNDO_CHANGE_SIZE
+{
+ Text [ en-US ] = "Change Size" ;
+};
+
+String RID_STR_UNDO_PASTE
+{
+ Text [ en-US ] = "Paste" ;
+};
+
+String RID_STR_UNDO_INSERT_CONTROL
+{
+ Text [ en-US ] = "Insert Control" ;
+};
+
+String RID_STR_UNDO_DELETE_CONTROL
+{
+ Text [ en-US ] = "Delete Control" ;
+};
+
+String RID_STR_UNDO_GROUP
+{
+ Text [ en-US ] = "Insert Group" ;
+};
+
+String RID_STR_UNDO_UNGROUP
+{
+ Text [ en-US ] = "Delete Group" ;
+};
+
+String RID_STR_GROUPHEADER
+{
+ 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 [ 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;
+ Command = ".uno:DbSortingAndGrouping";
+ Text [ en-US ] = "Sorting and Grouping...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_ATTR_CHAR_COLOR_BACKGROUND;
+ Command = ".uno:DBBackgroundColor";
+ Text [ en-US ] = "Background Color...";
+ };
+ MenuItem
+ {
+ Identifier = SID_RULER;
+ Command = ".uno:ShowRuler";
+ Checkable = TRUE;
+ Text [ en-US ] = "Ruler...";
+ };
+ MenuItem
+ {
+ Identifier = SID_GRID_VISIBLE;
+ Command = ".uno:GridVisible";
+ Checkable = TRUE;
+ Text [ en-US ] = "Grid...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_PAGEHEADERFOOTER;
+ Command = ".uno:PageHeaderFooter";
+ Checkable = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_REPORTHEADERFOOTER;
+ Command = ".uno:ReportHeaderFooter";
+ Checkable = TRUE;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_ARRANGEMENU ;
+ Command = ".uno:ArrangeMenu" ;
+ Text [ en-US ] = "~Arrange" ;
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ ITEM_FORMAT_FRAME_TO_TOP
+ };
+ MenuItem
+ {
+ Identifier = SID_FRAME_UP ;
+ HelpId = ".uno:ObjectForwardOne";
+ Text [ en-US ] = "Bring ~Forward" ;
+ };
+ MenuItem
+ {
+ Identifier = SID_FRAME_DOWN ;
+ HelpId = ".uno:ObjectBackOne";
+ 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" ;
+ Text [ en-US ] = "~Object Resizing" ;
+ Text [ x-comment ] = " ";
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_OBJECT_SMALLESTWIDTH ;
+ Command = ".uno:SmallestWidth" ;
+ Text [ en-US ] = "~Fit to smallest width" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_GREATESTWIDTH ;
+ Command = ".uno:GreatestWidth" ;
+ Text [ en-US ] = "~Fit to greatest width" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_SMALLESTHEIGHT ;
+ Command = ".uno:SmallestHeight" ;
+ Text [ en-US ] = "~Fit to smallest height" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_OBJECT_GREATESTHEIGHT ;
+ Command = ".uno:GreatestHeight" ;
+ Text [ en-US ] = "~Fit to greatest height" ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ };
+
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_SECTION_SHRINK_MENU ;
+ Command = ".uno:SectionShrinkMenu" ;
+ Text [ en-US ] = "Section" ;
+ Text [ x-comment ] = " ";
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_SECTION_SHRINK ;
+ Command = ".uno:SectionShrink" ;
+ Text [ en-US ] = "Shrink" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_SECTION_SHRINK_TOP ;
+ Command = ".uno:SectionShrinkTop" ;
+ Text [ en-US ] = "Shrink from top" ;
+ Text [ x-comment ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = SID_SECTION_SHRINK_BOTTOM ;
+ Command = ".uno:SectionShrinkBottom" ;
+ Text [ en-US ] = "Shrink from bottom" ;
+ Text [ x-comment ] = " ";
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_DISTRIBUTION;
+ Command = ".uno:Distribution";
+ Text [ en-US ] = "Distribution..." ;
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = SID_SHOW_PROPERTYBROWSER;
+ Command = ".uno:FormProperties";
+ Text [ en-US ] = "Properties...";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ ITEM_EDIT_CUT
+ };
+ MenuItem
+ {
+ ITEM_EDIT_COPY
+ };
+ MenuItem
+ {
+ ITEM_EDIT_PASTE
+ };
+ };
+};
+String RID_STR_FIELDSELECTION
+{
+ Text [ en-US ] = "Add field:";
+};
+
+String RID_STR_FILTER
+{
+ Text [ en-US ] = "Filter" ;
+};
+
+String RID_APP_TITLE
+{
+ Text [ en-US ] = " - %PRODUCTNAME Base Report" ;
+};
+
+String RID_APP_NEW_DOC
+{
+ Text [ en-US ] = "Untitled" ;
+};
+String RID_STR_UNDO_ALIGNMENT
+{
+ Text [ en-US ] = "Change Alignment" ;
+};
+String RID_STR_HEADER
+{
+ Text [ en-US ] = "# Header" ;
+ Text[ x-comment ] = "# will be replaced with a name.";
+};
+String RID_STR_FOOTER
+{
+ Text [ en-US ] = "# Footer" ;
+ Text[ x-comment ] = "# will be replaced with a name.";
+};
+String RID_STR_IMPORT_GRAPHIC
+{
+ Text [ en-US ] = "Insert graphics" ;
+};
+String RID_STR_DELETE
+{
+ Text [ en-US ] = "Delete" ;
+};
+String RID_STR_FUNCTION
+{
+ 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 [ en-US ] = "An error occurred while creating the report." ;
+};
+String RID_STR_CAUGHT_FOREIGN_EXCEPTION
+{
+ Text [ en-US ] = "An exception of type $type$ was caught." ;
+};
+String RID_STR_UNDO_CHANGEFONT
+{
+ Text [ en-US ] = "Change font";
+};
+String RID_STR_UNDO_CHANGEPAGE
+{
+ Text [ en-US ] = "Change page attributes";
+};
+String RID_STR_PAGEHEADERFOOTER_INSERT
+{
+ Text [ en-US ] = "Insert Page Header/Footer";
+};
+String RID_STR_PAGEHEADERFOOTER_DELETE
+{
+ Text [ en-US ] = "Delete Page Header/Footer";
+};
+String RID_STR_COLUMNHEADERFOOTER_INSERT
+{
+ Text [ en-US ] = "Insert Column Header/Footer";
+};
+String RID_STR_COLUMNHEADERFOOTER_DELETE
+{
+ Text [ en-US ] = "Delete Column Header/Footer";
+};
+String RID_STR_REPORTHEADERFOOTER_INSERT
+{
+ Text [ en-US ] = "Insert Report Header/Footer";
+};
+String RID_STR_REPORTHEADERFOOTER_DELETE
+{
+ Text [ en-US ] = "Delete Report Header/Footer";
+};
+String RID_ERR_NO_COMMAND
+{
+ Text [ en-US ] = "The report can not be executed unless it is bound to content.";
+};
+String RID_ERR_NO_OBJECTS
+{
+ Text [ en-US ] = "The report can not be executed unless at least one object has been inserted.";
+};
+String RID_STR_UNDO_SHRINK
+{
+ Text [ en-US ] = "Shrink Section";
+};
+String RID_STR_DETAIL
+{
+ Text [ en-US ] = "Detail";
+};
+String RID_STR_PAGE_HEADER
+{
+ Text [ en-US ] = "Page Header";
+};
+String RID_STR_PAGE_FOOTER
+{
+ Text [ en-US ] = "Page Footer";
+};
+String RID_STR_REPORT_HEADER
+{
+ Text [ en-US ] = "Report Header";
+};
+String RID_STR_REPORT_FOOTER
+{
+ Text [ en-US ] = "Report Footer";
+};
+String RID_STR_INSERT
+{
+ Text [ en-US ] = "Insert";
+};
diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
new file mode 100644
index 000000000000..8fa04f47ba7f
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
@@ -0,0 +1,422 @@
+<?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:SaveAs"/>
+ <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:menu menu:id=".uno:Select">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SelectAll"/>
+ <menu:menuitem menu:id=".uno:SelectAllLabels"/>
+ <menu:menuitem menu:id=".uno:SelectAllEdits"/>
+ <menu:menuitem menu:id=".uno:SelectReport"/>
+ </menu:menupopup>
+ </menu:menu>
+ <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:menu menu:id=".uno:EditShapeMenu">
+ <menu:menupopup>
+ <!--
+ <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:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:EditControlMenu">
+ <menu:menupopup>
+ <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:menu menu:id=".uno:SectionAlignmentMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SectionAlignLeft"/>
+ <menu:menuitem menu:id=".uno:SectionAlignRight"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SectionAlignTop"/>
+ <menu:menuitem menu:id=".uno:SectionAlignBottom"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:SectionShrinkMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SectionShrink"/>
+ <menu:menuitem menu:id=".uno:SectionShrinkTop"/>
+ <menu:menuitem menu:id=".uno:SectionShrinkBottom"/>
+ </menu:menupopup>
+ </menu:menu>
+
+
+ <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: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:menuitem menu:id=".uno:Zoom"/>
+ </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:ReportControlMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SelectObject"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ControlProperties"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Label" />
+ <menu:menuitem menu:id=".uno:Edit" />
+ <menu:menuitem menu:id=".uno:ImageControl" />
+ <menu:menuitem menu:id=".uno:InsertObjectChart" />
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:HFixedLine" />
+ <menu:menuitem menu:id=".uno:VFixedLine" />
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:GraphicMenu">
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:InsertGraphic"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:ShapesMenu" >
+ <menu:menupopup>
+
+ <menu:menu menu:id=".uno:BasicShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:BasicShapes.rectangle"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.round-rectangle"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.quadrat"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.round-quadrat"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.circle"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.ellipse"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:BasicShapes.circle-pie"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.isosceles-triangle"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.right-triangle"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.trapezoid"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.diamond"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.parallelogram"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:BasicShapes.pentagon"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.hexagon"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.octagon"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.cross"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.ring"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.block-arc"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:BasicShapes.can"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.cube"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.paper"/>
+ <menu:menuitem menu:id=".uno:BasicShapes.frame"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:SymbolShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:SymbolShapes.smiley"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.sun"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.moon"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.lightning"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.heart"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.flower"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.cloud"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.forbidden"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.puzzle"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.bracket-pair"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.left-bracket"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.right-bracket"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.brace-pair"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.left-brace"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.right-brace"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.quad-bevel"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.octagon-bevel"/>
+ <menu:menuitem menu:id=".uno:SymbolShapes.diamond-bevel"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:ArrowShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:ArrowShapes.left-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.right-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.down-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.left-right-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-down-arrow"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-right-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-right-down-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.quad-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.corner-right-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.split-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.striped-right-arrow"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.notched-right-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.pentagon-right"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.chevron"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.right-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.left-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-arrow-callout"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.down-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.left-right-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-down-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.up-right-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.quad-arrow-callout"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.circular-arrow"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.split-round-arrow"/>
+ <menu:menuitem menu:id=".uno:ArrowShapes.s-sharped-arrow"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:FlowChartShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-process"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-alternate-process"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-decision"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-data"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-predefined-process"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-internal-storage"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-document"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-multidocument"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-terminator"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-preparation"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-manual-input"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-manual-operation"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-connector"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-off-page-connector"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-card"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-punched-tape"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-summing-junction"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-or"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-collate"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-sort"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-extract"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-merge"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-stored-data"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-delay"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-sequential-access"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-magnetic-disk"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-direct-access-storage"/>
+ <menu:menuitem menu:id=".uno:FlowChartShapes.flowchart-display"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:CalloutShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:CalloutShapes.rectangular-callout" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.round-rectangular-callout" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.round-callout" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.cloud-callout" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.line-callout-1" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.line-callout-2" />
+ <menu:menuitem menu:id=".uno:CalloutShapes.line-callout-3" />
+ </menu:menupopup>
+ </menu:menu>
+
+ <menu:menu menu:id=".uno:StarShapesMenu" >
+ <menu:menupopup>
+ <menu:menuitem menu:id=".uno:StarShapes.bang"/>
+ <menu:menuitem menu:id=".uno:StarShapes.star4"/>
+ <menu:menuitem menu:id=".uno:StarShapes.star5"/>
+ <menu:menuitem menu:id=".uno:StarShapes.star6"/>
+ <menu:menuitem menu:id=".uno:StarShapes.star8"/>
+ <menu:menuitem menu:id=".uno:StarShapes.star12"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:StarShapes.star24"/>
+ <menu:menuitem menu:id=".uno:StarShapes.concave-star6"/>
+ <menu:menuitem menu:id=".uno:StarShapes.vertical-scroll"/>
+ <menu:menuitem menu:id=".uno:StarShapes.horizontal-scroll"/>
+ <menu:menuitem menu:id=".uno:StarShapes.signet"/>
+ <menu:menuitem menu:id=".uno:StarShapes.doorplate"/>
+ </menu:menupopup>
+ </menu:menu>
+
+ </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..7e50780b633d
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/statusbar/statusbar.xml
@@ -0,0 +1,6 @@
+<?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:ZoomSlider" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="130" statusbar:helpid="helpid:11065"/>
+ <statusbar:statusbaritem xlink:href=".uno:Zoom" statusbar:align="center" statusbar:width="35" statusbar:helpid="helpid:10000"/>
+</statusbar:statusbar>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml b/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml
new file mode 100644
index 000000000000..2fc8494938d4
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/Formatting.xml
@@ -0,0 +1,23 @@
+<?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:visible="false" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:CharFontName" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontHeight" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Bold" />
+ <toolbar:toolbaritem xlink:href=".uno:Italic" />
+ <toolbar:toolbaritem xlink:href=".uno:Underline" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:LeftPara" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:CenterPara" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:RightPara" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:JustifyPara" toolbar:helpid="helpid:10031" toolbar:text="" toolbar:style="radio" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontColor" toolbar:style="dropdown" />
+ <toolbar:toolbaritem xlink:href=".uno:BackgroundColor" toolbar:style="dropdown" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:FontDialog" 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..1c4a05228a07
--- /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:toolbaritem xlink:href=".uno:AlignCenter"/>
+ <toolbar:toolbaritem xlink:href=".uno:ObjectAlignRight"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:AlignUp"/>
+ <toolbar:toolbaritem xlink:href=".uno:AlignMiddle"/>
+ <toolbar:toolbaritem xlink:href=".uno:AlignDown"/>
+</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..62f2e5e2d534
--- /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:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-down-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.corner-right-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.striped-right-arrow"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.notched-right-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.pentagon-right"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.chevron"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.right-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-arrow-callout"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.down-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.left-right-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-down-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.up-right-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.quad-arrow-callout"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.circular-arrow"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.split-round-arrow"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes.s-sharped-arrow"/>
+</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..e26df54f29ab
--- /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:toolbaritem xlink:href=".uno:BasicShapes.round-rectangle"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.quadrat"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.round-quadrat"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ellipse"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.circle-pie"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.isosceles-triangle"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.right-triangle"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.trapezoid"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.diamond"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.parallelogram"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.pentagon"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.hexagon"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.octagon"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cross"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.ring"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.block-arc"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.can"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.cube"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.paper"/>
+ <toolbar:toolbaritem xlink:href=".uno:BasicShapes.frame"/>
+</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..5a37c8de0301
--- /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:toolbaritem xlink:href=".uno:CalloutShapes.round-rectangular-callout" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.round-callout" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.cloud-callout" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-1" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-2" />
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes.line-callout-3" />
+</toolbar:toolbar> \ No newline at end of file
diff --git a/reportdesign/uiconfig/dbreport/toolbar/drawbar.xml b/reportdesign/uiconfig/dbreport/toolbar/drawbar.xml
new file mode 100644
index 000000000000..07778059053a
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/drawbar.xml
@@ -0,0 +1,10 @@
+<?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" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:ArrowShapes" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:CalloutShapes" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes" toolbar:style="dropdown"/>
+</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..d3e649930942
--- /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:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-alternate-process"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-decision"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-data"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-predefined-process"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-internal-storage"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-document"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-multidocument"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-terminator"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-preparation"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-input"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-manual-operation"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-connector"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-off-page-connector"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-card"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-punched-tape"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-summing-junction"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-or"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-collate"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sort"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-extract"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-merge"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-stored-data"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-delay"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-sequential-access"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-magnetic-disk"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-direct-access-storage"/>
+ <toolbar:toolbaritem xlink:href=".uno:FlowChartShapes.flowchart-display"/>
+</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..ac460a3ba77c
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/reportcontrols.xml
@@ -0,0 +1,19 @@
+<?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:style="radio auto" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:ControlProperties"/>
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Label" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:Edit" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:ImageControl" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:InsertObjectChart" toolbar:style="radio auto" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:HFixedLine" toolbar:style="radio" />
+ <toolbar:toolbaritem xlink:href=".uno:VFixedLine" toolbar:style="radio" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:GridVisible" toolbar:style="radio auto" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:GridUse" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:HelplinesMove" 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..fc21516735a5
--- /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:toolbaritem xlink:href=".uno:SectionAlignRight"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignTop"/>
+ <toolbar:toolbaritem xlink:href=".uno:SectionAlignBottom"/>
+</toolbar:toolbar>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/sectionshrinkbar.xml b/reportdesign/uiconfig/dbreport/toolbar/sectionshrinkbar.xml
new file mode 100755
index 000000000000..0064ce8501b3
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/sectionshrinkbar.xml
@@ -0,0 +1,7 @@
+<?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:SectionShrink"/>
+ <toolbar:toolbaritem xlink:href=".uno:SectionShrinkTop"/>
+ <toolbar:toolbaritem xlink:href=".uno:SectionShrinkBottom"/>
+</toolbar:toolbar>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/starshapes.xml b/reportdesign/uiconfig/dbreport/toolbar/starshapes.xml
new file mode 100644
index 000000000000..820e9c07434d
--- /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:toolbaritem xlink:href=".uno:StarShapes.star4"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star5"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star6"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star8"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star12"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.star24"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.concave-star6"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.vertical-scroll"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.horizontal-scroll"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.signet"/>
+ <toolbar:toolbaritem xlink:href=".uno:StarShapes.doorplate"/>
+</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..4269c1d42e08
--- /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:toolbaritem xlink:href=".uno:SymbolShapes.sun"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.moon"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.lightning"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.heart"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.flower"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.cloud"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.forbidden"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.puzzle"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.bracket-pair"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-bracket"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-bracket"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.brace-pair"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.left-brace"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.right-brace"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.quad-bevel"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.octagon-bevel"/>
+ <toolbar:toolbaritem xlink:href=".uno:SymbolShapes.diamond-bevel"/>
+</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..55d77cb75f97
--- /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:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:EditDoc" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Cut" />
+ <toolbar:toolbaritem xlink:href=".uno:Copy" />
+ <toolbar:toolbaritem xlink:href=".uno:Paste" toolbar:text="" toolbar:style="dropdown" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:Undo" />
+ <toolbar:toolbaritem xlink:href=".uno:Redo" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:AddField" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:ReportNavigator" toolbar:style="radio auto" />
+ <toolbar:toolbaritem xlink:href=".uno:DbSortingAndGrouping" />
+ <toolbar:toolbaritem xlink:href=".uno:ExecuteReport" />
+ <toolbar:toolbarseparator/>
+ <toolbar:toolbaritem xlink:href=".uno:HelpIndex" />
+ <toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" />
+</toolbar:toolbar>
diff --git a/reportdesign/util/dll.pmk b/reportdesign/util/dll.pmk
new file mode 100644
index 000000000000..c2ce7d89d88f
--- /dev/null
+++ b/reportdesign/util/dll.pmk
@@ -0,0 +1,31 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# define REPORTDESIGN_DLLIMPLEMENTATION (see @ dllapi.h)
+CDEFS += -DREPORTDESIGN_DLLIMPLEMENTATION
+
+VISIBILITY_HIDDEN=TRUE
diff --git a/reportdesign/util/hidother.src b/reportdesign/util/hidother.src
new file mode 100644
index 000000000000..3c52ed77c852
--- /dev/null
+++ b/reportdesign/util/hidother.src
@@ -0,0 +1,175 @@
+/*************************************************************************
+*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+************************************************************************/
+
+#include "../inc/helpids.hrc"
+
+hidspecial UID_RPT_RPT_APP_VIEW { HelpId = UID_RPT_RPT_APP_VIEW ; };
+hidspecial UID_RPT_SCROLLWINDOW { HelpId = UID_RPT_SCROLLWINDOW ; };
+hidspecial UID_RPT_REPORTWINDOW { HelpId = UID_RPT_REPORTWINDOW ; };
+hidspecial HID_RPT_HORZ_RULER { HelpId = HID_RPT_HORZ_RULER ; };
+hidspecial UID_RPT_SECTIONSWINDOW { HelpId = UID_RPT_SECTIONSWINDOW ; };
+hidspecial UID_RPT_VIEWSWINDOW { HelpId = UID_RPT_VIEWSWINDOW ; };
+hidspecial HID_RPT_ENDMARKER { HelpId = HID_RPT_ENDMARKER ; };
+hidspecial HID_RPT_SPLITTER { HelpId = HID_RPT_SPLITTER ; };
+hidspecial HID_REPORTSECTION { HelpId = HID_REPORTSECTION ; };
+hidspecial HID_RPT_HORZ_SCROLLBAR { HelpId = HID_RPT_HORZ_SCROLLBAR ; };
+hidspecial HID_RPT_VERT_SCROLLBAR { HelpId = HID_RPT_VERT_SCROLLBAR ; };
+hidspecial HID_RPT_STARTMARKER { HelpId = HID_RPT_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 SID_ESCAPE { HelpId = SID_ESCAPE ; };
+*/
+
+hidspecial HID_RPT_FIELDEXPRESSION { HelpId = HID_RPT_FIELDEXPRESSION ; };
+hidspecial HID_RPT_SORTORDER { HelpId = HID_RPT_SORTORDER ; };
+hidspecial HID_RPT_GROUPSBRW { HelpId = HID_RPT_GROUPSBRW ; };
+hidspecial HID_RPT_GROUPSSORTING_DLG { HelpId = HID_RPT_GROUPSSORTING_DLG ; };
+hidspecial HID_RPT_PAGENUMBERS_DLG { HelpId = HID_RPT_PAGENUMBERS_DLG ; };
+hidspecial HID_RPT_DATETIME_DLG { HelpId = HID_RPT_DATETIME_DLG ; };
+hidspecial HID_RPT_CONDFORMAT_DLG { HelpId = HID_RPT_CONDFORMAT_DLG ; };
+hidspecial HID_RPT_CRTL_FORMAT_PREVIEW { HelpId = HID_RPT_CRTL_FORMAT_PREVIEW ; };
+hidspecial HID_RPT_COND_DLG { HelpId = HID_RPT_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 HID_RPT_PROPDLG_TAB_GENERAL { HelpId = HID_RPT_PROPDLG_TAB_GENERAL ; };
+hidspecial HID_RPT_PROPDLG_TAB_DATA { HelpId = HID_RPT_PROPDLG_TAB_DATA ; };
+
+hidspecial HID_RPT_PROP_FORCENEWPAGE { HelpId = HID_RPT_PROP_FORCENEWPAGE; };
+hidspecial HID_RPT_PROP_NEWROWORCOL { HelpId = HID_RPT_PROP_NEWROWORCOL; };
+hidspecial HID_RPT_PROP_KEEPTOGETHER { HelpId = HID_RPT_PROP_KEEPTOGETHER; };
+hidspecial HID_RPT_PROP_CANGROW { HelpId = HID_RPT_PROP_CANGROW; };
+hidspecial HID_RPT_PROP_CANSHRINK { HelpId = HID_RPT_PROP_CANSHRINK; };
+hidspecial HID_RPT_PROP_REPEATSECTION { HelpId = HID_RPT_PROP_REPEATSECTION; };
+hidspecial HID_RPT_PROP_PRINTREPEATEDVALUES { HelpId = HID_RPT_PROP_PRINTREPEATEDVALUES; };
+hidspecial HID_RPT_PROP_CONDITIONALPRINTEXPRESSION { HelpId = HID_RPT_PROP_CONDITIONALPRINTEXPRESSION; };
+hidspecial HID_RPT_PROP_STARTNEWCOLUMN { HelpId = HID_RPT_PROP_STARTNEWCOLUMN; };
+hidspecial HID_RPT_PROP_STARTNEWPAGE { HelpId = HID_RPT_PROP_STARTNEWPAGE; };
+hidspecial HID_RPT_PROP_RESETPAGENUMBER { HelpId = HID_RPT_PROP_RESETPAGENUMBER; };
+hidspecial HID_RPT_PROP_MINHEIGHTNEWPAGE { HelpId = HID_RPT_PROP_MINHEIGHTNEWPAGE; };
+hidspecial HID_RPT_PROP_PRINTWHENGROUPCHANGE { HelpId = HID_RPT_PROP_PRINTWHENGROUPCHANGE; };
+hidspecial HID_RPT_PROP_VISIBLE { HelpId = HID_RPT_PROP_VISIBLE; };
+hidspecial HID_RPT_PROP_GROUPKEEPTOGETHER { HelpId = HID_RPT_PROP_GROUPKEEPTOGETHER; };
+hidspecial HID_RPT_PROP_PAGEHEADEROPTION { HelpId = HID_RPT_PROP_PAGEHEADEROPTION; };
+hidspecial HID_RPT_PROP_PAGEFOOTEROPTION { HelpId = HID_RPT_PROP_PAGEFOOTEROPTION; };
+hidspecial UID_RPT_PROP_DLG_LINE_STYLE { HelpId = UID_RPT_PROP_DLG_LINE_STYLE; };
+hidspecial HID_RPT_PROP_RPT_POSITIONX { HelpId = HID_RPT_PROP_RPT_POSITIONX; };
+hidspecial HID_RPT_PROP_RPT_POSITIONY { HelpId = HID_RPT_PROP_RPT_POSITIONY; };
+hidspecial HID_RPT_PROP_RPT_WIDTH { HelpId = HID_RPT_PROP_RPT_WIDTH; };
+hidspecial HID_RPT_PROP_RPT_HEIGHT { HelpId = HID_RPT_PROP_RPT_HEIGHT; };
+hidspecial HID_RPT_START_TITLE { HelpId = HID_RPT_START_TITLE; };
+hidspecial HID_RPT_START_IMAGE { HelpId = HID_RPT_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 SID_RPT_NEW_FUNCTION { HelpId = SID_RPT_NEW_FUNCTION; };
+*/
+
+hidspecial HID_RPT_PROP_DEEPTRAVERSING { HelpId = HID_RPT_PROP_DEEPTRAVERSING; };
+hidspecial HID_RPT_PROP_PREEVALUATED { HelpId = HID_RPT_PROP_PREEVALUATED; };
+hidspecial HID_RPT_NAVIGATOR_DLG { HelpId = HID_RPT_NAVIGATOR_DLG; };
+hidspecial HID_REPORT_NAVIGATOR_TREE { HelpId = HID_REPORT_NAVIGATOR_TREE; };
+hidspecial HID_RPT_PROP_FORMULA { HelpId = HID_RPT_PROP_FORMULA; };
+hidspecial HID_RPT_PROP_INITIALFORMULA { HelpId = HID_RPT_PROP_INITIALFORMULA; };x
+hidspecial HID_RPT_PROP_DATAFIELD { HelpId = HID_RPT_PROP_DATAFIELD; };
+hidspecial HID_RPT_PROP_RPT_FONT { HelpId = HID_RPT_PROP_RPT_FONT; };
+hidspecial UID_RPT_RPT_PROP_DLG_FONT_TYPE { HelpId = UID_RPT_RPT_PROP_DLG_FONT_TYPE; };
+hidspecial HID_RPT_PROP_BACKCOLOR { HelpId = HID_RPT_PROP_BACKCOLOR; };
+hidspecial HID_RPT_PROP_PRESERVEIRI { HelpId = HID_RPT_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_RPT_PROP_BACKTRANSPARENT { HelpId = HID_RPT_PROP_BACKTRANSPARENT; };
+hidspecial HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT { HelpId = HID_RPT_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; };
+hidspecial SID_SECTION_SHRINK { HelpId = SID_SECTION_SHRINK; };
+hidspecial SID_SECTION_SHRINK_TOP { HelpId = SID_SECTION_SHRINK_TOP; };
+hidspecial SID_SECTION_SHRINK_BOTTOM { HelpId = SID_SECTION_SHRINK_BOTTOM; };
+*/
+
+hidspecial UID_RPT_PROP_CHARTTYPE_DLG { HelpId = UID_RPT_PROP_CHARTTYPE_DLG; };
+hidspecial HID_RPT_PROP_CHARTTYPE { HelpId = HID_RPT_PROP_CHARTTYPE; };
+hidspecial HID_RPT_FIELD_SEL_WIN { HelpId = HID_RPT_FIELD_SEL_WIN; };
+hidspecial HID_RPT_FIELD_SEL { HelpId = HID_RPT_FIELD_SEL; };
+hidspecial HID_RPT_PROP_FORMULALIST { HelpId = HID_RPT_PROP_FORMULALIST; };
+hidspecial HID_RPT_PROP_SCOPE { HelpId = HID_RPT_PROP_SCOPE; };
+hidspecial HID_RPT_PROP_TYPE { HelpId = HID_RPT_PROP_TYPE; };
+hidspecial UID_RPT_PROP_DLG_LINKFIELDS { HelpId = UID_RPT_PROP_DLG_LINKFIELDS; };
+hidspecial HID_RPT_PROP_MASTERFIELDS { HelpId = HID_RPT_PROP_MASTERFIELDS; };
+hidspecial HID_RPT_PROP_DETAILFIELDS { HelpId = HID_RPT_PROP_DETAILFIELDS; };
+hidspecial HID_RPT_PROP_PREVIEW_COUNT { HelpId = HID_RPT_PROP_PREVIEW_COUNT; };
+hidspecial HID_RPT_PROP_AREA { HelpId = HID_RPT_PROP_AREA; };
+hidspecial UID_RPT_RPT_PROP_DLG_AREA { HelpId = UID_RPT_RPT_PROP_DLG_AREA; };
+hidspecial UID_RPT_PROP_CHARTTYPE_DLG { HelpId = UID_RPT_PROP_CHARTTYPE_DLG; };
+hidspecial HID_RPT_PROP_CHARTTYPE { HelpId = HID_RPT_PROP_CHARTTYPE; };
+hidspecial HID_RPT_FIELD_SEL_WIN { HelpId = HID_RPT_FIELD_SEL_WIN; };
+hidspecial HID_RPT_FIELD_SEL { HelpId = HID_RPT_FIELD_SEL; };
+hidspecial HID_RPT_PROP_FORMULALIST { HelpId = HID_RPT_PROP_FORMULALIST; };
+hidspecial HID_RPT_PROP_SCOPE { HelpId = HID_RPT_PROP_SCOPE; };
+hidspecial HID_RPT_PROP_TYPE { HelpId = HID_RPT_PROP_TYPE; };
+hidspecial UID_RPT_PROP_DLG_LINKFIELDS { HelpId = UID_RPT_PROP_DLG_LINKFIELDS; };
+hidspecial HID_RPT_PROP_MASTERFIELDS { HelpId = HID_RPT_PROP_MASTERFIELDS; };
+hidspecial HID_RPT_PROP_DETAILFIELDS { HelpId = HID_RPT_PROP_DETAILFIELDS; };
+hidspecial HID_RPT_PROP_PREVIEW_COUNT { HelpId = HID_RPT_PROP_PREVIEW_COUNT; };
+hidspecial HID_RPT_PROP_AREA { HelpId = HID_RPT_PROP_AREA; };
+hidspecial UID_RPT_RPT_PROP_DLG_AREA { HelpId = UID_RPT_RPT_PROP_DLG_AREA; };
+hidspecial UID_RPT_PROP_FORMULA { HelpId = UID_RPT_PROP_FORMULA; };
+
+hidspecial HID_RPT_GROUPSORT_MOVE_UP { HelpId = HID_RPT_GROUPSORT_MOVE_UP; };
+hidspecial HID_RPT_GROUPSORT_MOVE_DOWN { HelpId = HID_RPT_GROUPSORT_MOVE_DOWN; };
+hidspecial HID_RPT_GROUPSORT_DELETE { HelpId = HID_RPT_GROUPSORT_DELETE; };
+hidspecial HID_RPT_PROP_MIMETYPE { HelpId = HID_RPT_PROP_MIMETYPE; };
+hidspecial HID_RPT_PROP_VERTICALALIGN { HelpId = HID_RPT_PROP_VERTICALALIGN; };
+hidspecial HID_RPT_PROP_PARAADJUST { HelpId = HID_RPT_PROP_PARAADJUST; };
+
diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk
new file mode 100644
index 000000000000..4f09018437e3
--- /dev/null
+++ b/reportdesign/util/makefile.mk
@@ -0,0 +1,253 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..
+PRJNAME=reportdesign
+TARGET=rpt
+TARGET2=$(TARGET)ui
+# USE_DEFFILE=TRUE
+GEN_HID=TRUE
+GEN_HID_OTHER=TRUE
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+
+.IF "$(L10N_framework)"==""
+
+# ------------------------------------------------------------------
+# --- reportdesign core (rpt) -----------------------------------
+
+LIB1TARGET=$(SLB)$/$(TARGET).lib
+LIB1FILES=\
+ $(SLB)$/api.lib \
+ $(SLB)$/coreshared.lib \
+ $(SLB)$/core_resource.lib \
+ $(SLB)$/core_sdr.lib \
+ $(SLB)$/core_misc.lib
+
+SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
+
+SHL1STDLIBS= \
+ $(EDITENGLIB) \
+ $(SVXCORELIB) \
+ $(SVXLIB) \
+ $(FWELIB) \
+ $(SFXLIB) \
+ $(TOOLSLIB) \
+ $(I18NISOLANGLIB) \
+ $(SVLLIB) \
+ $(SVTOOLLIB) \
+ $(UNOTOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(VCLLIB) \
+ $(TKLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
+
+.IF "$(GUI)"=="OS2"
+SHL1STDLIBS+= \
+ idbu.lib
+.ELIF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
+SHL1STDLIBS+= \
+ -ldbu$(DLLPOSTFIX)
+.ELSE
+SHL1STDLIBS+= \
+ idbu.lib
+.ENDIF
+
+SHL1IMPLIB=i$(TARGET)
+SHL1USE_EXPORTS=name
+SHL1LIBS=$(LIB1TARGET)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME=$(SHL1TARGET)
+DEFLIB1NAME=$(TARGET)
+.ENDIF
+# --- .res file ----------------------------------------------------------
+
+RES1FILELIST=\
+ $(SRS)$/core_strings.srs
+
+RESLIB1NAME=$(TARGET)
+RESLIB1IMAGES=$(PRJ)$/res
+RESLIB1SRSFILES=$(RES1FILELIST)
+
+.IF "$(L10N_framework)"==""
+# --- 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)$(DLLPOSTFIX)
+
+SHL2STDLIBS= \
+ $(EDITENGLIB) \
+ $(SVXCORELIB) \
+ $(SVXLIB) \
+ $(SFXLIB) \
+ $(SVTOOLLIB) \
+ $(TKLIB) \
+ $(VCLLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(FWELIB) \
+ $(SO2LIB) \
+ $(I18NISOLANGLIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="OS2"
+SHL2STDLIBS+= \
+ idbu.lib \
+ i$(TARGET).lib
+.ELIF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
+SHL2STDLIBS+= \
+ -ldbu$(DLLPOSTFIX) \
+ -l$(TARGET)$(DLLPOSTFIX)
+.ELSE
+SHL2STDLIBS+= \
+ idbu.lib \
+ i$(TARGET).lib
+.ENDIF
+
+.IF "$(GUI)"=="OS2"
+SHL2STDLIBS+= \
+ ifor.lib \
+ iforui.lib
+.ELIF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
+SHL2STDLIBS+= \
+ -lfor$(DLLPOSTFIX) \
+ -lforui$(DLLPOSTFIX)
+.ELSE
+SHL2STDLIBS+= \
+ ifor.lib \
+ iforui.lib
+.ENDIF
+
+
+SHL2DEPN=$(SHL1TARGETN)
+SHL2LIBS=$(LIB2TARGET)
+SHL2DEF=$(MISC)$/$(SHL2TARGET).def
+DEF2NAME=$(SHL2TARGET)
+SHL2VERSIONMAP=$(SOLARENV)/src/component.map
+.ENDIF
+# --- .res file ----------------------------------------------------------
+RES2FILELIST=\
+ $(SRS)$/uidlg.srs \
+ $(SRS)$/ui_inspection.srs \
+ $(SRS)$/report.srs
+
+RESLIB2NAME=$(TARGET2)
+RESLIB2IMAGES=$(PRJ)$/res
+RESLIB2SRSFILES=$(RES2FILELIST)
+.IF "$(L10N_framework)"==""
+
+# ------------------- rptxml -------------------
+TARGET3=rptxml
+# --- Library -----------------------------------
+LIB3TARGET=$(SLB)$/rpt_flt.lib
+LIB3FILES=\
+ $(SLB)$/xmlshared.lib \
+ $(SLB)$/$(TARGET3).lib
+
+SHL3TARGET=$(TARGET3)$(DLLPOSTFIX)
+
+SHL3STDLIBS=\
+ $(EDITENGLIB) \
+ $(SVXCORELIB) \
+ $(XMLOFFLIB) \
+ $(VCLLIB) \
+ $(UNOTOOLSLIB) \
+ $(TOOLSLIB) \
+ $(DBTOOLSLIB) \
+ $(COMPHELPERLIB) \
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(UCBHELPERLIB) \
+ $(SFXLIB) \
+ $(SVLLIB) \
+ $(SOTLIB) \
+ $(SO2LIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="OS2"
+SHL3STDLIBS+= \
+ irpt.lib
+.ELIF "$(GUI)"!="WNT" || "$(COM)"=="GCC"
+SHL3STDLIBS+= \
+ -l$(TARGET)$(DLLPOSTFIX)
+.ELSE
+SHL3STDLIBS+= \
+ irpt.lib
+.ENDIF
+
+
+SHL3DEPN=$(SHL1TARGETN)
+SHL3LIBS=$(LIB3TARGET)
+SHL3IMPLIB= i$(SHL3TARGET)
+SHL3VERSIONMAP=$(SOLARENV)/src/component.map
+SHL3DEF= $(MISC)$/$(SHL3TARGET).def
+
+DEF3NAME=$(SHL3TARGET)
+
+.ENDIF
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
+
+
+ALLTAR : $(MISC)/rpt.component $(MISC)/rptui.component $(MISC)/rptxml.component
+
+$(MISC)/rpt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ rpt.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt rpt.component
+
+$(MISC)/rptui.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ rptui.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt rptui.component
+
+$(MISC)/rptxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ rptxml.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt rptxml.component
diff --git a/reportdesign/util/rpt.component b/reportdesign/util/rpt.component
new file mode 100644
index 000000000000..ef5b2cc4c78d
--- /dev/null
+++ b/reportdesign/util/rpt.component
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.report.OFixedLine">
+ <service name="com.sun.star.report.FixedLine"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OFixedText">
+ <service name="com.sun.star.report.FixedText"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OFormatCondition">
+ <service name="com.sun.star.report.FormatCondition"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OFormattedField">
+ <service name="com.sun.star.report.FormattedField"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OFunction">
+ <service name="com.sun.star.report.Function"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OImageControl">
+ <service name="com.sun.star.report.ImageControl"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OReportDefinition">
+ <service name="com.sun.star.report.ReportDefinition"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OReportEngineJFree">
+ <service name="com.sun.star.report.ReportEngine"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.Shape">
+ <service name="com.sun.star.report.Shape"/>
+ </implementation>
+</component>
diff --git a/reportdesign/util/rptui.component b/reportdesign/util/rptui.component
new file mode 100644
index 000000000000..593f06d0b582
--- /dev/null
+++ b/reportdesign/util/rptui.component
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.report.DataProviderHandler">
+ <service name="com.sun.star.report.inspection.DataProviderHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.DefaultComponentInspectorModel">
+ <service name="com.sun.star.report.inspection.DefaultComponentInspectorModel"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.GeometryHandler">
+ <service name="com.sun.star.report.inspection.GeometryHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.ReportComponentHandler">
+ <service name="com.sun.star.report.inspection.ReportComponentHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.report.comp.ReportDesign">
+ <service name="com.sun.star.sdb.ReportDesign"/>
+ </implementation>
+ <implementation name="com.sun.star.report.comp.ReportToolboxController">
+ <service name="com.sun.star.report.ReportToolboxController"/>
+ </implementation>
+ <implementation name="com.sun.star.report.comp.StatusbarController">
+ <service name="com.sun.star.frame.StatusbarController"/>
+ </implementation>
+</component>
diff --git a/reportdesign/util/rptxml.component b/reportdesign/util/rptxml.component
new file mode 100644
index 000000000000..8a0021ecdf9a
--- /dev/null
+++ b/reportdesign/util/rptxml.component
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.Report.XMLOasisContentImporter">
+ <service name="com.sun.star.comp.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Report.XMLOasisMetaImporter">
+ <service name="com.sun.star.comp.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Report.XMLOasisSettingsImporter">
+ <service name="com.sun.star.comp.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.Report.XMLOasisStylesImporter">
+ <service name="com.sun.star.comp.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.ExportDocumentHandler">
+ <service name="com.sun.star.report.ExportDocumentHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.ExportFilter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.ImportDocumentHandler">
+ <service name="com.sun.star.report.ImportDocumentHandler"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.OReportFilter">
+ <service name="com.sun.star.comp.document.ImportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.ORptTypeDetection">
+ <service name="com.sun.star.document.ExtendedTypeDetection"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.XMLContentExporter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.XMLFullExporter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.XMLMetaExporter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.XMLSettingsExporter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.report.XMLStylesExporter">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
+</component>